Guy Wood
Guy Wood

Reputation: 307

Form or get Azure DevOps URL for Release logs

enter image description hereUsing a PowerShell task running as part of this Agent Job, I want to get the URL to link back to the logs (of the same Agent Job). The URL is consistent but I can't find Predefined variables for releaseID or environmentID which are the missing pieces of the puzzle for the URL. Does anyone know how to get these IDs or another way of programatically retrieving this URL from a task within the Agent Job?

Upvotes: 0

Views: 433

Answers (1)

Vito Liu
Vito Liu

Reputation: 8298

The URL is consistent but I can't find Predefined variables for releaseID or environmentID which are the missing pieces of the puzzle for the URL.

We could check this doc Default variables - Release to get the release predefined variable.

We could also add task Bash and enter the script printenv to print the variable, then we could see that the releaseID is RELEASE_RELEASEID or Release.ReleaseId and environmentID is RELEASE_ENVIRONMENTID or Release.EnvironmentId, we could print them via $(Release.ReleaseId) and $(Release.EnvironmentId)

Result:

enter image description here

Upvotes: 1

Related Questions