I develop simple Azure Function with Service Bus Topic Trigger in previous article, and I will deploy it to Azure Function App.
Create Function App
1. From add resource, add "Function App".
2. Select .NET 6 as runtime.
3. Once the resource is created, go to "Identity" menu and turn on system assigned managed identity.
4. Next, we need to add one variable. Go to Configurations and add "New Application Settings". Set appropriate value for your environment.
Set IAM for Service Bus
I only assign myself as Data Receiver role of Service Bus in the previous article, so let's add Function's managed identity as well.
1. Go to Service Bus topic resource from Azure Portal and add Role.
2. Select "Azure Service Bus Data Receiver" and add the function app managed account as member. You can easily find it by selecting "Managed identity".
Deploy to Function App
I use Visual Studio feature for deploy.
1. From Visual Studio, right click the project and click "Publish". Then select Azure as target.
2. Select the created Function App by using wizard.
3. Click "Publish" and go to Azure Portal to see the result.
4. Select the function and go to "Code" section, then open "Logs".
5. Send any data from Service Bus Topic and confirm the function is triggered as expected.
Summary
Though there are small differences, developing .NET 6 version of Function app won't vary from previous version. So please try the latest version whenever possible!
Top comments (2)
Thnks!!!
Hello community
I have a question that I would like you to help me with.
Is it possible to publish an Azure Function project of type ServiceBusTrigger made in VS2022 to an IIS? If possible can you give me some guidance please?
Regards