Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy a different host.json for a different deployment profile?

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?

like image 207
vargonian Avatar asked Nov 12 '18 23:11

vargonian


1 Answers

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

like image 64
PramodValavala-MSFT Avatar answered Nov 15 '22 08:11

PramodValavala-MSFT