Forum Discussion
bhuvanesh1208
Sep 19, 2022Copper Contributor
Special Characters not accepted in Azure Pipeline variable
Hi, I'm trying to set password in pipeline variable and use that variable for encoding it in base64 format before uploading to key vault. But when i try to set password with special characters like ...
balasubramanim
Apr 01, 2025Iron Contributor
Azure DevOps pipeline variables can have issues with special characters like $, ", ', and \ — especially when used in bash scripts.
1. Wrap the variable in single quotes in the script:
echo '${{ variables.mySecret }}' | base64
2. Escape special characters if setting the value inline:
variables:
mySecret: "test\$123*'>\"pl"
3. Use a secure pipeline variable (marked as secret) and pass it safely:
echo "$MY_SECRET" | base64
- praveenambatiApr 01, 2025Copper Contributor
Hi bhuvanesh1208
I have tried with below pipeline code, but no displayed the out as expected.variables:
- group: dev
steps:
- script: echo '${{variables.db_name}}' | base64
displayName: "Print db_name"
output:
expected to print db_name : $*)@*$))($)!_!3242&*)@#_Below is the variable group created for testing.