DEV Community

Kenichiro Nakamura
Kenichiro Nakamura

Posted on

.NET 6 Service Bus Trigger Azure Function - Part 2

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".

Image description

2. Select .NET 6 as runtime.

Image description

3. Once the resource is created, go to "Identity" menu and turn on system assigned managed identity.

Image description

4. Next, we need to add one variable. Go to Configurations and add "New Application Settings". Set appropriate value for your environment.

Image description

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.

Image description

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".

Image description

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.

Image description

2. Select the created Function App by using wizard.

Image description

3. Click "Publish" and go to Azure Portal to see the result.

Image description

4. Select the function and go to "Code" section, then open "Logs".

Image description

5. Send any data from Service Bus Topic and confirm the function is triggered as expected.

Image description

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)

Collapse
 
sergiomg25 profile image
Sergio Molina Guarneros

Thnks!!!

Collapse
 
dcampoverdecampoverde profile image
dcampoverdecampoverde

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