Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
How could we assign environment variable to key "topicName" in service-bus-trigger/function.json

I have an azure function with type as serviceBusTrigger. Right now the value of "topicName" is considered as a string. I want to add the topicName as an enviroment variable (AZURE_FUNC_TOPIC_NAME) in app.settings.json. would like to have value of this variable AZURE_FUNC_TOPIC_NAME to be assigned to the key topicName in below function.json How could i achieve it?

{
  "bindings": [
    {
      "name": "mySbMsg",
      "type": "serviceBusTrigger",
      "direction": "in",
      "topicName": "AZURE_SERVICE_BUS_TOPIC",
      "connection": "",
      "subscriptionName": ""
    }
  ],
  "disabled": false
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In local.settings.json file, define your variables like topic name in the key-value format and get that environment variable in your function code.

To get an environment variable or an app setting value, use System.Environment.GetEnvironmentVariable, as shown below.

public static string GetEnvironmentVariable(string name)
{
    return name + ": " + 
        System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process);
}

Reference: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-csharp#environment-variables

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda