I created an Azure Function and selected Azure Service Bus Topic as the trigger in Visual Studio 2019. I also created a Service Bus Topic in my Azure account and have the Primary Connection String and Primary Key.
My questions are:
- How can I integrate the Azure Service Bus with the Azure Function that I created? What attributes should be changed in the code generated?
- How can I send a message to Azure Service Bus Topic locally on my machine? Is there any application like SQL Management Studio that can connect to my Azure Service Bus resource?
[FunctionName("Function1")]
public static void Run([ServiceBusTrigger("mytopic", "mysubscription", Connection = "ConnectionString")]string mySbMsg, ILogger log)
{
log.LogInformation($"C# ServiceBus topic trigger function processed message: {mySbMsg}");
}