How Do Host.json and Azure App Settings Differ for Function App Configuration?

0
17
Asked By CloudySky9 On

I'm trying to understand how the settings in `host.json` differ from Azure App Settings. Specifically, I want to set the parameters like `MaxBatchSize`, `PollingIntervalMs`, and `MaxChangesPerWorker`. Can these settings only be specified in the `host.json` file, or can they also be configured as environment variables in Azure?

3 Answers

Answered By CoderGal123 On

Just throwing it out there—are you sure about the environment variable limits? I've read that for some logging settings, they can merge between `host.json` and environment variables, but it looks like that doesn't apply to those trigger configurations.

Answered By DevDude99 On

Actually, you can override some service bus trigger settings through environment variables, so it’s worth checking for Cosmos triggers too. It might not be the same for every scenario, but you could find some customization options.

Answered By TechieTom82 On

In Azure Functions, `host.json` is used for function-runtime configuration, so it defines how the Functions runtime behaves for your app. For parameters like `MaxBatchSize`, `PollingIntervalMs`, and `MaxChangesPerWorker`, those must go into `host.json`, particularly under the Cosmos DB section. They aren't read from environment variables.

On the other hand, Azure App Settings work as environment variables and are typically used for things like secrets and connection strings, not for controlling runtime behavior. So, just to clarify, you can't set those trigger tuning values in App Settings, as they wouldn't be recognized by the runtime.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.