Home > OS >  Azure Function App: Can I put maxConcurrentSessions settings in Application settings Configuration l
Azure Function App: Can I put maxConcurrentSessions settings in Application settings Configuration l

Time:07-06

I have below below settings host.json for maxConcurrentSessions for Azure Function app service bus trigger.

"extensions": {
  "serviceBus": {
    "sessionHandlerOptions": {
      "autoComplete": false,
      "maxConcurrentSessions": 100
    }
  }
}

Can I set this host json configuration Function App configuration application settings like service bus connection string? if Yes, how?

enter image description here

CodePudding user response:

Looking at the documentation, you can override settings defined in the host.json using appsettings:

There may be instances where you wish to configure or modify specific settings in a host.json file for a specific environment, without changing the host.json file itself. You can override specific host.json values by creating an equivalent value as an application setting. When the runtime finds an application setting in the format AzureFunctionsJobHost__path__to__setting, it overrides the equivalent host.json setting located at path.to.setting in the JSON. When expressed as an application setting, the dot (.) used to indicate JSON hierarchy is replaced by a double underscore (__).

So in you case defining an appsetting AzureFunctionsJobHost__extensions__serviceBus__sessionHandlerOptions__maxConcurrentSessions will do the trick.

  • Related