Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Key vault value does not update if value changes in secret as it generates new version for the secret

Below is the Key-Vault problem which I am facing.   I have a Key-Vault which stores some keys which is used in web-app and functions using @Microsoft.KeyVault(SecretUri=)   The value of the secret will change every three days using an automation. That will change the version number (GUID) as well and then the app setting value (atleast one in case of Primary and Secondary) will become invalid. Is there any way I can refer the latest value from the KeyVault in app settings. Updating the app settings in all the website will be a tedious process.

like image 363
Kaushik Gayal Avatar asked Apr 03 '19 05:04

Kaushik Gayal


1 Answers

For my App Service, I did have success using a Key Vault reference in the form below with no version:

@Microsoft.KeyVault(SecretUri=https://<vault_name>.vault.azure.net/secrets/<secret_name>/)

However, I did have to Stop and Start (not Restart) the App Service to pull in the new secret value from the key vault.

like image 50
CharlieNoTomatoes Avatar answered Sep 23 '22 10:09

CharlieNoTomatoes