Forum Discussion
terruahmad
Microsoft
Nov 06, 2024Mask Azure App Insight Connection String
Hi all,
I have a customer who is looking for a way to mask the App Insight connection string. Is there a way to accomplish that?
Thanks.
balasubramanim
Nov 07, 2024Iron Contributor
To mask the Azure App Insights connection string in Azure DevOps:
Use Secret Variable: Add it as a secret variable in your pipeline settings (APP_INSIGHTS_CONN_STRING). It will be masked in logs.
- script: |
export APP_INSIGHTS_CONN_STRING=$(APP_INSIGHTS_CONN_STRING)
displayName: "Setup App Insights Connection String"
Use Azure Key Vault: Store it in Azure Key Vault, then retrieve it in your pipeline with the Azure Key Vault task. The secret will stay masked.
- task: AzureKeyVault@1
inputs:
azureSubscription: '<Your Service Connection>'
keyVaultName: '<Your Key Vault Name>'
secretsFilter: 'APP_INSIGHTS_CONN_STRING'
Both methods will securely mask the connection string in pipeline logs