Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

190
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda