1

I am using the Azure Function Consumption plan to monitor Service Bus topic subscriptions and process the webhook messages from vendors. I am storing my settings in Azure App Configuration but it appears that since App Configuration is considered an External file the function scaler cannot read from these values. So using the topic name as a configuration variable is not advisable.

public async Task Run(
             [ServiceBusTrigger("Common:VendorProcessingSBTopicName", "provider-service", Connection = "Common:VendorProcessingSBTopic")] string msg)

This produces the following message when running.

The Functions scale controller may not scale the following functions correctly because some configuration values were modified in an external startup class

Yes, I can add the key values to the Function Configuration but these values are shared across function apps that use the same values and would like a centralized storage. Since the topic may contain thousands of messages per subscription it is important to scale properly. These functions are processing callback events for over 8 million emails and 19 million sms per month.

If there is a better way to handle this I would be interested in hearing them. Any guidance on how to accomplish the above without affecting scaling is appreciated.

John Tolar
  • 327
  • 1
  • 7

2 Answers2

1

Here is an example of how to get the storage queue name from Azure App Configuration and use it for QueueTrigger. You should be able to do something similar for ServiceBusTrigger. It uses app setting binding expression. However, please note that this is not supported in the consumption plan due to limitations in Azure Functions.

https://github.com/Azure/AppConfiguration/blob/main/examples/DotNetCore/AzureFunction/FunctionApp/ReadQueuedMessage.cs

Zhenlan Wang
  • 1,213
  • 8
  • 10
1

By default service bus triggered function looks for AzureWebJobsServiceBus connection name in the local.settings.json

That means you don't have to define the connection property if you have the value set in the local setting.

For remote deployment, use pipeline that can grab the value/secrets from azure app configuration & set the configuration for that particular app service/function.