Azure Pipelines: "##_vso[" in the log, and the variable is not set
The task printed your logging command, but the agent didn't run it. Since June 2026, Microsoft has been changing its tasks so that ##vso[ in output from a remote machine, or from a tool the task runs, comes out as ##_vso[: a fix for logging-command injection, where output the pipeline doesn't control sets variables or fails the job. The agent acts only on lines that start with ##vso[, so the variable is never set, the step still succeeds, and a later step reads an empty value. From an SSH@0 0.277.0 log: ##_vso[task.setvariable variable=returnValue;isOutput=true]0 (azure-pipelines-tasks #22352).
Tasks that changed
| Task | Change (merged) | What it touches |
|---|---|---|
SSH@0 | 0.277.0 (#22297, June 26) | Output from the remote machine |
PowerShellOnTargetMachines@3, AzureFileCopy | 3.277.1 escaped everything (#22282, June 25) and was reverted; now only commands outside an allow list (#22451, August 26) | Output from the remote machine |
Docker@2, DockerCompose | #22477, September 16 | Docker output |
Kubernetes@1, KubernetesManifest@1 | #22542, September 23; #22631, October 19 | kubectl output |
Npm@0, Npm@1 | #22646, October 9 | npm output, including your package scripts; Npm@1 is also no longer allowed to set variables |
SqlAzureDacpacDeployment@1 | #22663, October 16 | SqlPackage output |
PublishCodeCoverageResults@2 | #22700, October 20 | The coverage tool's output |
Merge dates in 2026; a change reaches your pipeline when the new task version reaches your organization, and the version is at the top of the step's log. Helm and Xcode have the same change under review (#22768, #22801). Microsoft's logging commands page doesn't mention it yet.
When the variable feeds a pull request's build validation: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull request's branch policies with their state in IntelliJ IDEA, Rider or PyCharm, and with Pro runs a failed build policy again once the step is fixed. Its Pipelines tab (version 1.0.86 and later) lists the runs of the repositories you have open and opens a failed task's log in the editor, free to read.
Getting the value across again
- Print the command from your own script step. Run the tool in a
bash,pwshorscriptstep, keep its output, and write the logging command yourself. For npm, run the package script in a script step,script: npm run build:ci, instead of throughNpm@1(the case of Npm@1 1.282.0 in Nerdbank.GitVersioning #1582). For a remote machine, read the value over ssh in a script step:
- bash: |
value=$(ssh deploy@contoso-vm 'cat /opt/app/version')
echo "##vso[task.setvariable variable=appVersion;isOutput=true]$value"
name: remote
- Pin the previous version, for now. Microsoft suggested it as a temporary workaround in the reports:
task: SSH@0.274.0(#22352),task: PowerShellOnTargetMachines@3.276.0(#22333). It brings back the hole the change closed, so treat it as a bridge. - Read the allow list. PowerShellOnTargetMachines and AzureFileCopy escape only commands that are not on the list the service sends as the read-only variable
agent.allowedLoggingCommands; while the list is empty, they change nothing (#22451). Print$AGENT_ALLOWEDLOGGINGCOMMANDSin a script step to see yours.
Is it this?
Search the step's log for ##_vso[. If the line still starts with ##vso[ and the value is still empty in another job or stage, the logging command ran, and the cause is how the variable is read: see an output variable is empty in the next job or stage.
Similar pages
- An output variable is empty in the next job or stage: isOutput=true, a step name, dependsOn, and the expression for each case.
- "The step name ... appears more than once": naming the step whose output you read.
Azure DevOps pull requests in IntelliJ IDEA, Rider and PyCharm
Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It shows the branch policies of a pull request with their state, so a required build that has not passed is next to its pull request, and with Pro you run a failed or expired build policy again from there. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.
Get it on JetBrains Marketplace
Azure DevOps and Azure Pipelines are trademarks of Microsoft Corporation; IntelliJ IDEA, Rider and PyCharm are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.
More: Output variable is empty · Step names must be unique · Build validation · 日本語