Sunny-Dee
Sunny-Dee

Reputation: 97

Set an output variable from an agentless job

I have a pipeline that runs an agentless job. This job produces a result that I would like to pass to the next or next job. The problem is that all the examples I've found set variables on agent jobs, not agentless. See here, all the examples use script commands, which need to be run on an agent.

Is there a way to set an output variable from an agentless job? How else can I pass the result from an agentless job to the next?

Upvotes: 1

Views: 1066

Answers (1)

Max B
Max B

Reputation: 66

Setting output variables from agentless jobs isn't supported

powershell runs Windows PowerShell and will only work on a Windows agent.

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops

Depending on what your use-case is, you may be able to use dependsOn and condition in your jobs to achieve your goal. E.g. for retries for builds that are not idempotent. Otherwise an agent-based configuration may be needed.

Upvotes: 1

Related Questions