1

I have a Function App with a Key Vault reference for an App Setting such as the following:

@Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/) 

This will pull the latest secret version for mysecret into the Function App Settings according to the rotation policy, which could be up to 24 hours. For referenced secrets that change frequently this delay is not acceptable.

Within Azure Portal the 'Pull reference values' (formally 'Fetch latest values') button may be pressed to sync the secrets:

enter image description here

Does the community know if there is an Azure CLI command that will achieve the same result as this button press so that the process may be automated?

Without this, I believe my only options that could be automated are:

  • Use specific secret versions rather than 'latest'
  • Remove and re-add the offending app setting
1
  • There is no direct CLI command. But one way is by reseting the value az functionapp config appsettings set --name func0name --resource-group rgname --settings [email protected](SecretUri=https://vv.vault.azure.net/secrets/mysecret/)CommentedSep 23, 2024 at 8:16

1 Answer 1

3

You can try to use az rest with post method:

az rest --method post --url https://management.azure.com/[Resurce ID]/config/configreferences/appsettings/refresh?api-version=2022-03-01 

run results

3
  • Thanks, this seems to work well. Just for my reference, is there any public documentation for the /config/configreferences/appsettings/refresh endpoint?
    – wolfyuk
    CommentedOct 25, 2024 at 9:03
  • @wolfyuk our discussion will be as a public doc )))) I got it through browser developer mode.CommentedOct 25, 2024 at 14:22
  • It's worth noting there's a fair delay between running the command and things being updated. I didn't time it but it's at least 15 seconds. Probably 1 minute
    – John Hunt
    CommentedNov 28, 2024 at 13:28

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.