The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve environment variable values dynamically in pipeline

Joey Bradshaw
Contributor
September 11, 2017

I have the following code in a bash script running through a bitbucket pipeline that is not being set to the correct secure value. 

declare -n -x -g AZURE_STORAGE_ACCESS_KEY="AZURE_STORAGE_ACCESS_KEY_${__ENVIRONMENT^^}"

When I later run the azure CLI that uses the AZURE_STORAGE_ACCESS_KEY env, variable I get an error:

az storage blob upload: error: Storage account 'AZURE_STORAGE_ACCOUNT_QA' not found.

It appears that atlassian has code that strips secured env. variable values for security reasons and is doing so in this case.

Our setup is that we will have env. vars setup on a per environment basis and we need to dynamically grab the correct one during execution of the pipeline, however the value is being stripped by atlassian.

AZURE_STORAGE_ACCESS_KEY_DEV

AZURE_STORAGE_ACCESS_KEY_QA

AZURE_STORAGE_ACCESS_KEY_PROD

 

What linux command will allow me to accomplish this task without the secure value being stripped?

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events