Reputation: 149
How can I set a variable with the value that I have stored in a KeyVault secret?
Upvotes: 6
Views: 6153
Reputation: 6083
Update:
Hi @willy sepulveda. We only can secure the input and output in Web Activity,like follows:
Input and output data will be sensitive:
You can use Web activity to access the Key Valut value. Refer this documentation. I also created a test.
Open the properties of your data factory and copy the Managed Identity Object ID value. Open the key vault access policies and add the managed identity permissions to Get and List secrets.
Then I created a secret named myKey
and set the value helloworld
.
Note: The name of the secret (myKey
) will be used below at Step 5.
Web1
activity settings
URL: https://<your-keyvalut-name>.vault.azure.net/secrets/<your-secret-name>?api-version=7.0
.
You need replace keyvalut name and secret name.
Authentication: Select Managed Identity
.
Resource: Enter https://vault.azure.net
.
In Set variable1
activity, add dynamic content @activity('Web1').output.value
.
Debug result: I can see that the variable successfully received the secret value.
Upvotes: 4