Azure function to access key vault



You can easily configure Azure function to pull secret value from KeyVault. First you need to setup :-

1. Azure function function -> Platform feature -> Identity -> Go ahead and turn on the identity. This is what the called Managed Identity setup as you will get an App Id (guid). Save it and then setup your vault below :-


2. In your Key Vault, Access policy -> Add New -> Select Principal -> Add the name of your Azure function app Id


3. Restart your azure function app.


4. In your settings file, you can have some an configuration entry say, CONN_WEB_APP with the following value,

@Microsoft.KeyVault(SecretUri=https://blahblahblah.vault.azure.net/secrets/Conn/e74dfd34e8e4415fbd09c540de2cf556)


You're all sorted! :)

Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm