To fix this issue If you are using a git repsotiory you can create another branch and make a pull request. As long as the pull request is not set to auto complete the code will not get committed to the repository. If you are using a TFVC respository you can setup a gated build that is configured to fail. The pipeline should be a copy of your original pipeline but add a PowerShell task at the end of the build pipeline that throws a terminating error. Be sure to setup this gated build on a separate branch so it does not block normal development.
I wish this helpful for you for a pipeline thats using yaml - no. you can only configure it in yaml and you can not switch back to UI experience. If the pipeline is UI - it will continue to work as it was working.
Azure DevOps YAML build pipeline - Set script task name
I wish did fix the issue. I have a YAML build pipeline with a simple script task that sets the build configuration based on the branch being built: , fix indentation:
- script: |
echo Current branch is %BUILD_SOURCEBRANCHNAME%
if %BUILD_SOURCEBRANCHNAME% == "master" (
) else (
echo ##vso[task.setvariable variable=BuildConfiguration]%BUILD_CONFIG%
echo BuildConfiguration set to '%BUILD_CONFIG%'
displayName: 'Determine Build Configuration'
See Build Artifacts in Azure DevOps with YAML Pipeline