I deploy my Azure Function from Visual Studio, and as part of my Functions project I have a host.json file which specifies some settings which I need to change for Production vs Development. (Specifically, the extensions:queues:batchSize setting). The reason is unfortunately largely beyond my control (the database I use in development is lower-tier than the production one and higher batch sizes will cause it to fall over pretty quickly).
I'd like to be able to specify a small batch size for development and higher batch size for production. I have production and development deployment profiles already, but I don't see any way to vary the host.json file.
Is there 1) a way to do this natively, and/or 2) a better DevOps practice I should be using to make this issue obsolete? I can't use Azure DevOps yet (long story) but perhaps just having separate branches for dev and production would be sufficient?
Another way to do this would be to set environment variables for it. In your case, you could set extensions:queues:batchSize
with one like this
AzureFunctionsJobHost__extensions__queues__batchSize
When deploying to azure, this would be an application setting with this name/key
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With