如何在Azure发布管道中跨代理作业使用输出变量 [英] How to use output variables across agent jobs in azure release pipeline
问题描述
在我的azure发布管道中,我有2个代理作业,一个是使用power-shell进行sql部署,另一个是使用power-shell进行kubernetes. 如何使用power-shell在第一个代理作业中设置输出变量并在第二个代理作业中使用输出变量.
In my azure release pipeline I have 2 agent jobs, one is for sql deployment using power-shell and other is for kubernetes using power-shell. How to set an output variable in 1st agent job and use that in second agent job using power-shell.
推荐答案
如何在Azure发布管道中跨代理作业使用输出变量
How to use output variables across agent jobs in azure release pipeline
恐怕目前暂时无法直接在座席工作中使用输出变量.
I am afraid there is no way to use output variables across agent jobs directly for now.
存在一个相关问题通过日志记录命令设置的变量在代理之间不是持久的 s,您可以跟进.
There is a related issue Variables set via logging commands are not persistent between agents, you can follow up.
要解决此问题,您可以尝试按照解决方法:
To resolve this problem, you can try following workaround:
- Define a variable in the release definition Variable.
- Use REST API (Definitions - Update) to update the value of the release definition variable in the agent job 1.
- Use the updated value of the release definition variable in the next agent job.
有关使用REST API更新发布定义变量的值的详细信息,您可以遵循以下标签:
The details info about using REST API to update the value of the release definition variable, you can follow the below ticket:
希望这会有所帮助.
这篇关于如何在Azure发布管道中跨代理作业使用输出变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!