Azure / Azure/azure-functions-host
Key vault configuration references no longer updating on function app restart
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
This is still happening. The workaround is to rename the secret then name it back.
cf https://github.com/Azure/azure-functions-host/issues/8269:
I use logic apps to manage the automatic rotation of some Service Bus access keys, which are then stored in a Key Vault. Several Azure Functions have key vault links in their configuration to the secrets. The logic app uses the Azure Management REST API to perform a "restart" operation on the Azure Function to trigger a re-read of the configuration when the keys are rotated.
While all of our functions were on consumption plans, this work like a charm. The restart was executed with the softRestart flag and on restarting the new service bus keys were picked up and the functions continued on as if nothing had changed.
However, I recently moved all of our functions to a standard app service plan with a VNET and NAT so that we could use a consistent outbound IP address as we have a number of firewalls to penetrate. I am reasonably certain that since that move the picking up of the new key vault secret values on app restart has been failing (I am certain it's failing, I am just not sure if it's related to the app service plan change or not).
As a side note, the two "Restart Web App" events that failed have the "softRestart" flag on the restart event set to true. They failed with an "There was an unexpected InternalServerError" error. Only by removing this flag can I now get the restart call to succeed at all. It used to work fine but stopped doing so around the time I changed the app service plan.
Timestamp: Mon Mar 28 2022 06:15:12 GMT+1100
App version: V3
App Name: ndss-dev-integration-fa-d365-api-poll
Region: Australia East
Contributor guide
Research direction
The report names no repository files or tests. Start with the Azure Management REST API restart operation, the softRestart flag, and Key Vault configuration references; compare behavior across the consumption and standard App Service plans. Done means a reproducible cause and a verified fix or documented limitation for refreshed secret values after restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100