Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!