I am trying to fetch secret values from azure key vault in Azure App Service. My App Service has a managed identity In the Azure Key vault, this managed identity is added under 'Role assignments' as 'Key vault contributor' Also access policies has been added in azure key vault to give 'Get' permission to the AppServices's managed identity Now in my c# code, I am trying to get the value of the AppSetting element using the code ConfigurationManager.AppSettings['something'];
In my azure app service, under app settings, I have added the a key with name 'something' and it has the value pointing to the reference of the Key Vault as below:
@Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/ec96f02080254f109c51a1f14cdb1931)
Now I am able to retrieve the value from the appsettings, but instead of the actual value, it is pulling the output as @Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/c96f02080254f109c51a1f1cdb1931)
I am expecting the output to be value that I have set, not the keyvault reference string itself.
I am using .Net MVC 4.7 web app