Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Output Variables in Release pipeline

I searched all the docs about Output Variables are for build pipeline and only told me how to set in .yaml. But how to use it in release pipeline?

Supposed I have 2 variables $abc="123" $def="456" in step Login. How to set them in below text box? and How to use them in step Deploy? enter image description here

like image 485
Newton Zou Avatar asked Dec 17 '19 07:12

Newton Zou


People also ask

How do you use output variables in Azure DevOps release pipeline?

Just specify the reference name in the blank of task, and then, you can call this output variable abc by using the format: <reference name>. <variable name> . For example, if you specify the reference name as mycustom , just call the output variable by using $(mycustom. abc) .

How do you use variables in a pipeline release?

You define and manage these variables in the Variables tab in a release pipeline. In the Pipeline Variables page, open the Scope drop-down list and select "Release". By default, when you add a variable, it is set to Release scope. Share values across all of the tasks within one specific stage by using stage variables.

How do you use variables in Azure pipeline?

Set variables in pipeline. In the most common case, you set the variables and use them within the YAML file. This allows you to track changes to the variable in your version control system. You can also define variables in the pipeline settings UI (see the Classic tab) and reference them in your YAML.

What is output variable in Azure DevOps?

An output variable is a specific kind of pipeline variable that is created by a task. The deployment task assigns a value to a variable which then makes it available to use across a pipeline.


Video Answer


1 Answers

Some tasks define output variables

For brief text, it represents the follow scripts:

echo "##vso[task.setvariable variable=abc;isOutput=true]123"

Just specify the reference name in the blank of task, and then, you can call this output variable abc by using the format: <reference name>.<variable name>.

For example, if you specify the reference name as mycustom, just call the output variable by using $(mycustom.abc).

like image 117
Mengdi Liang Avatar answered Oct 18 '22 10:10

Mengdi Liang