azure-functions-host icon indicating copy to clipboard operation
azure-functions-host copied to clipboard

Specifying host.json options on a per function level

Open APIWT opened this issue 5 years ago • 6 comments

Is your question related to a specific version? If so, please specify:

v3 runtime

What language does your question apply to? (e.g. C#, JavaScript, Java, All)

C#

Question

I am trying to specify queues -> batchSize on a per function basis. It seems like I should be able to do this. Right now, it looks like my only option is to create a separate Azure Functions instance/project for each function that I want to take a different configuration.

APIWT avatar May 04 '20 16:05 APIWT

I'm coming to a similar conclusion with concurrency settings in Durable Functions. My application has ended up being comprised of multiple functions apps with subtly different settings, and it would be nice if possible to change settings per function to allow more of these to be consolidated into one app.

benbelow avatar Aug 13 '20 12:08 benbelow

I have several functions in a project that we deploy with Azure DevOps. We have to limit concurrency for only one of our functions, but now we need to separate it out, create an additional Function App, separate release, etc. It would be really nice it we could configure some options either on the trigger attribute or specify a separate attribute on the method.

Matthewsre avatar Aug 25 '20 03:08 Matthewsre

Same scenario here. Need to limit Service Bus "maxConcurrentCalls" per function. This also increases cost with Premium Service Plan and generally more cold starts. Currently now way to do this right ?

jernejc avatar Jan 29 '21 14:01 jernejc

Same issue here with Azure Storage Queue. Wanted multiple maxDequeueCount values for different functions and queues in the app.

cyberpion-yotam avatar Feb 09 '21 18:02 cyberpion-yotam

My recent use case here was log sampling ratio. I've an app with multiple functions. one is common, and is sampled. others are rare(once per day).

We already admit that logging has more granular scope than 'app' by allowing different log levels per namespace, but it would be great to say 'these functions are important, don't sample them', 'these functions are not important, only trace 1 message per minute to ensure nothing wierd is happening'

Azure support currently suggests "just deploy them to different apps if they have different needs" . The effort to deploy and mange a complete new app (identy, secrets, deployment pipeline complexity,....) just to set up a single different log parameter (or queue concurrency) does not seem to be a deliberate design decision.

AartBluestoke avatar Feb 09 '21 21:02 AartBluestoke

Exactly the same here for the serviceBus.maxMessageBatchSize which, on our side, should be different from one queue to another for example.

florianchevallier avatar Oct 11 '22 13:10 florianchevallier

My recent use case here was log sampling ratio. I've an app with multiple functions. one is common, and is sampled. others are rare(once per day).

We already admit that logging has more granular scope than 'app' by allowing different log levels per namespace, but it would be great to say 'these functions are important, don't sample them', 'these functions are not important, only trace 1 message per minute to ensure nothing wierd is happening'

Azure support currently suggests "just deploy them to different apps if they have different needs" . The effort to deploy and mange a complete new app (identy, secrets, deployment pipeline complexity,....) just to set up a single different log parameter (or queue concurrency) does not seem to be a deliberate design decision.

is this still the best solution or is it solved somehow differently?

dvrbanic avatar Jan 20 '23 15:01 dvrbanic

Any update on the feasibility of enabling settings e.g queue batch size to be set at the function level?

cpsnowden avatar Jan 03 '24 20:01 cpsnowden