ZoharYosef ZoharYosef - 1 year ago 167
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?

Answer Source

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"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download