Forum Discussion

thomasberthelsen's avatar
thomasberthelsen
Copper Contributor
Mar 24, 2023

Share environment variables across Projects

Hi everyone

 

I tried to browser around to figure this out. Are there any native functionality in Azure Devops to share environment variables across projects? I'm asking because we have a token that has a fixed expiration time, which gives the pipelines access to a portal that we're using, and ideally we don't want to include (and change) that in every project that we have. Are there any place that can be centrally managed and then be picked up during release in Azure Devops?

  • chandra805's avatar
    chandra805
    Copper Contributor
    Variables give you a convenient way to get key bits of data into various parts of the pipeline. The most common use of variables is to define a value that you can then use in your pipeline. All variables are strings and are mutable. The value of a variable can change from run to run or job to job of your pipeline. When you define the same variable in multiple places with the same name, the most locally scoped variable wins. So, a variable defined at the job level can override a variable set at the stage level. A variable defined at the stage level overrides a variable set at the pipeline root level. A variable set in the pipeline root level overrides a variable set in the Pipeline settings UI. You can use variables with expressions to conditionally assign values and further customize pipelines. Variables are different from runtime parameters. Runtime parameters are typed and available during template parsing.

Resources