|
| 1 | +--- |
| 2 | +title: Use Azure Key Vault secrets in pipeline activities | Microsoft Docs |
| 3 | +description: Learn how to fetch stored credentials from Azure key vault and use them during data factory pipeline runs. |
| 4 | +services: data-factory |
| 5 | +author: ChrisLound |
| 6 | +manager: craigg |
| 7 | +editor: '' |
| 8 | + |
| 9 | +ms.service: data-factory |
| 10 | +ms.workload: data-services |
| 11 | +ms.tgt_pltfrm: na |
| 12 | + |
| 13 | +ms.topic: conceptual |
| 14 | +ms.date: 10/31/2019 |
| 15 | +ms.author: chlound |
| 16 | +--- |
| 17 | + |
| 18 | +# Use Azure Key Vault secrets in pipeline activities |
| 19 | + |
| 20 | +You can store credentials or secret values in an Azure Key Vault and use them during pipeline execution to pass to your activities. |
| 21 | + |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +This feature relies on the data factory managed identity. Learn how it works from [Managed identity for Data Factory](https://docs.microsoft.com/azure/data-factory/data-factory-service-identity) and make sure your data factory has one associated. |
| 25 | + |
| 26 | +## Steps |
| 27 | + |
| 28 | +1. Open the properties of your data factory and copy the Managed Identity Application ID value. |
| 29 | + |
| 30 | +  |
| 31 | + |
| 32 | +2. Open the key vault access policies and add the managed identity permissions to Get and List secrets. |
| 33 | + |
| 34 | +  |
| 35 | + |
| 36 | +  |
| 37 | + |
| 38 | + Click **Add**, then click **Save**. |
| 39 | + |
| 40 | +3. Navigate to your Key Vault secret and copy the Secret Identifier. |
| 41 | + |
| 42 | +  |
| 43 | + |
| 44 | + Make a note of your secret URI that you want to get during your data factory pipeline run. |
| 45 | + |
| 46 | +4. In your Data Factory pipeline, add a new Web activity and configure it as follows. |
| 47 | + |
| 48 | + |Property |Value | |
| 49 | + |---------|---------| |
| 50 | + |Secure Output |True | |
| 51 | + |URL |[Your secret URI value]?api-version=7.0 | |
| 52 | + |Method |GET | |
| 53 | + |Authentication |MSI | |
| 54 | + |Resource |https://vault.azure.net | |
| 55 | + |
| 56 | +  |
| 57 | + |
| 58 | + > [!IMPORTANT] |
| 59 | + > You must add **?api-version=7.0** to the end of your secret URI. |
| 60 | +
|
| 61 | + > [!CAUTION] |
| 62 | + > Set the Secure Output option to true to prevent the secret value from being logged in plain text. Any further activities that consume this value should have their Secure Input option set to true. |
| 63 | +
|
| 64 | +5. To use the value in another activity, use the following code expression **@activity("web").output.value)**. |
| 65 | + |
| 66 | +  |
| 67 | + |
| 68 | +## Next steps |
| 69 | + |
| 70 | +To learn how to use Azure Key Vault to store credentials for data stores and computes, see [Store credentials in Azure Key Vault](https://docs.microsoft.com/azure/data-factory/store-credentials-in-key-vault) |
0 commit comments