Azure / Azure/azure-functions-host
Support dynamic enabling/disabling of functions
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
#### What problem would the feature you're requesting solve? Please describe.
Enhancement idea derived from: https://github.com/Azure/azure-functions-dotnet-worker/issues/997. The scenario is the customer has a service bus function trigger they want to enable/disable on-demand (dynamically).
#### Describe the solution you'd like
This best fits as a host feature as we would need to stop consuming messages from the queue while the function is disabled. This is to avoid delivering and re-delivering messages (which may lead to dead-lettering) while the consuming function is disabled.
Ideally, the act of enabling/disabling is done via `IConfiguration` with a reloadable source. This will let the customer decide how they enable/disable it (Azure AppConfiguration for example). Or we can expose some UI or CLI commands to assist with setting this config value dynamically.
#### Describe alternatives you've considered
A workaround for now would be to have middleware in the worker detect when the function is disabled and it will "park" these messages in some separate storage. Then when the function is re-enabled, these parked messages will be re-added to the queue. This requires considerable code from the customer, so it would be much more ideal for the host to just stop consuming from the queue.
#### Additional context
N/A
Contributor guide
Assessment
This issue has not been assessed yet.