ZoharYosef ZoharYosef - 4 months ago 36
C# Question

Get ServiceBusTrigger name from App.config in Console App

I have function that receive ServiceBusTrigger message:

public static void ProcessQueueMessage([ServiceBusTrigger("mysb")] string message)
// do something with message

when I send message to "mysb" Azure Que - this function start to work.

My question is: Can I take the Que name from the App.config?


This SO question seems to answer your question.

You'll use this code: Microsoft.WindowsAzure.CloudConfigurationManager.GetSettings("QueueName")

With this kind of code in your app.config file:

   <add key="QueueName" value="mysb"/>