Search code examples
azureazure-functionsazure-data-factoryazure-keyvault

Azure Key Vault to run Azure Function App in ADF pipeline


I have an Azure Function and I am trying to run this function inside the ADF pipeline with Azure Function App activity. When I run the function with linked service using function master key, it runs successfully. But, I need to run this function using Azure Key Vault. I have created a secret in my Key Vault with the value of master function key. It looks like this master key is updated and I get the old version in my Key Vault secret. How can I update the secret value according the value of the Azure Function master key inside the ADF pipeline?

The first time I run the function with linked service using Azure Key Vault, it runs successfully. After some days, it looks like the master key value was updated in the Function App, and I get the error message "Unauthorized"


Solution

  • After some days, it looks like the master key value was updated in the Function App, and I get the error message "Unauthorized".

    Once your Function master key secret gets updated with newer version or you update the secret key in key vault of your Function like below :-

    enter image description here

    Make sure to set the Secret Version in your Linked Service to Latest like below:-

    enter image description here

    after this setting, Each time your function''s master key gets updated with new secret value in Key vault, The Linked Service will take the Latest version and secret from Key vault and connect with function.