azure-pipelines-agent: ##[error]A potentially dangerous Request.Path value was detected from the client (:).
When using ##vso[task.setvariable variable=variableName;]$myVarValue, my value has a semicolon in it i.e. $myVarValue = “test:value”.
However, I get the following error in the pipeline ##[error]A potentially dangerous Request.Path value was detected from the client (:). which suggests it’s getting blocked?
Is there a way to escape this?
Agent Version and Platform
2.160.0 - Windows Server 2019
Azure DevOps Type and Version
dev.azure.com (formerly visualstudio.com)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 16 (1 by maintainers)
@MrOwen I ended up with a similar workaround. I constructed the JSON payload for my API call directly, rather than using the ConvertTo-Json. Your solution does looks cleaner though, so I think I’ll adopt that moving forwards. 😃
Interestingly the API documentation (Tags - Add Build Tag) stated to use the PUT method - but that failed when I tried, so instead I used a PATCH (which is what the web console appeared to use) and that works as expected.
I note though your own solution uses the POST method.
I find it somewhat ironic the documentation states to use PUT, but it only works if we use the PATCH or POST methods instead.
Personally I feel this should be treated as a bug with
##vso[build.addbuildtag], so I opened a feedback case: Error when setting ##vso[build.addbuildtag] containing a colon