C
C#5w ago
Mickaël

✅ Attribut ServiceBusTrigger

Hello I have a fonction with an ServiceBusTrigger attribut. I want to retrieved the value of the topic name base on the environment. So I have a appsettings.Developement.json For example "ServiceBus": { "TopicName": "workitem" } But when I do %ServiceBus:TopicName% it don't return a value. And in the program.cs I add the json file
7 Replies
Unknown User
Unknown User5w ago
Message Not Public
Sign In & Join Server To View
Saber
Saber5w ago
You can include stuff in appsettings/other configuration providers just fine for application code, however things that the host needs access to need to be hostfile/environment variables
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
Mickaël
MickaëlOP4w ago
Thanks. The solution was indeed to add env vraibles in azure but in visual studio you can include in the cs.proj un local.settings.json Values { "ServiceBus:TopicName": "workitem" } Then you can access with %ServiceBus:TopicName% in the attribut
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
Mickaël
MickaëlOP4w ago
Yes, thank you
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?