MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

It is also possible to use pre-set the keys in the keyvault and use just Get permissions from the kubernetes pod #120745

Open gerbendv opened 6 months ago

gerbendv commented 6 months ago

In the article it is stated:

The access policy should grant the identity the following secret permissions: Get,Set, List, and Delete.

It is however, also possible to create the KeyVault keys before launching the pod and allow the pod to only use Get permissions. For production environments it might not be possible to use all Get,Set, List, and Delete permissions as is the case in my current project.

I've set AzureWebJobsSecretStorageType to "keyvault" and AzureWebJobsSecretStorageKeyVaultUri to my vault URI and only allow the workload identity to use Get. In the vault I have preconfigured the following secrets:

It took me quite a bit of studying the code of the Azure Functions WebHost (https://github.com/Azure/azure-functions-host/tree/dev/src/WebJobs.Script.WebHost) so I figured it might help some people to add this to the docs.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Naveenommi-MSFT commented 6 months ago

@gerbendv Thanks for your feedback! We will investigate and update as appropriate.