Could not access key vault reference metadata

arunabha bhattacharya 181 Reputation points
2020-07-30T12:56:36.11+00:00

My goal: read a secret value from Azure key vault in Azure function app
Steps:
Azure key vault side:

  • Generated secret
  • Access control (IAM)>Add role assignment: gave role Reader to my function
  • Secret>Version>Enabled, copy secret identifier
    Azure function app side:
  • Settings>Identity>System assigned: Status=On, Permissions: Reader to my key vault.
  • Configuration>New application settings: name=<name of secret>, value=<secret identifier as copied from key vault, of the form @Microsoft.KeyVault(SecretUri={https://myvaultabc.vault.azure.net/secrets/...})
  • Save, refresh: Error: Could not access key vault reference metadata.

Any help appreciated.
Thanks.

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,107 questions
0 comments No comments
{count} votes

Accepted answer
  1. Saurabh Sharma 23,671 Reputation points Microsoft Employee
    2020-07-30T20:12:33.967+00:00

    @arunabhabhattacharya-3120 I think you are using curly braces "{" in your application settings which is not required. You need to remove curly braces in you Key Vault reference . Key Vault reference would be like below -

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

    Please let me know if you this works else provide more details like, code snippet, application configuration screenshots to help you better. I also suggest you to refer to documentation which provides details of accessing secrets from Azure functions.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. 2020-07-30T14:46:03.503+00:00
    0 comments No comments