Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Using Workspace variables in deployment variables

We have a number of keys that are used by all of our builds (but are different for each of our environments) and we would like to store these as workspace variables - but expose these in each of our deployments by referencing the workspace variables.


Workspace Variables


   - echo $KEY

Is there any way of having a deployment variable reference a workspace variable?

1 answer

0 votes
Ben Atlassian Team Mar 13, 2022

Hey Alan!

I have just tested on my end and can confirm the exact configuration you have defined will work to reference workspace-level variables IF those workspace-level variables are unsecured, as you are able to reference both deployment/workspace variables when running a pipelines build.

For more information please refer to the following link:


- Ben (Bitbucket Cloud Support)

The variables the user asked about were "KEYS" so they probably need to be secured.

Your saying this won't work for secured workspace variables?

Is there just a way to define environments at the workspace level?

Like Drew Heasman likes this
Ben Atlassian Team Jul 12, 2022

Hey Ben,

Yes, the idea behind "secured" variables is that they are secure and therefore echoing them will not reveal the values inside these.

There is some text when configuring workspace variables from within Workspace Settings > Pipelines > Workspace Variables that defines the above:

Environment variables added at the workspace level can be accessed from all repositories that are within that workspace. To access a variable, put the $ symbol in front of its name. For example, access AWS_SECRET by using $AWS_SECRET. 
Workspace variables can be overridden by variables added on the repository level.

If you want the variable to be stored unencrypted and shown in plain text in the logs, unsecure it by unchecking the checkbox.

Environments can only be defined at the repository level from within Repository Settings > Pipelines > Deployments.


- Ben (Bitbucket Cloud Support)

Like Douglas Carmo likes this

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events