By using this site, you agree to the Privacy Policy.
Accept
EnterinITEnterinITEnterinIT
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Office 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Teams
  • WINDOWS
    • Windows Admin Center
    • Windows Client
    • Windows Server
  • SCCM Query Collection List
Reading: Marking Azure DevOps Builds as Failed Using Command Line
Font ResizerAa
EnterinITEnterinIT
Font ResizerAa
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
  • WINDOWS
  • SCCM Query Collection List
Search
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Office 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Teams
  • WINDOWS
    • Windows Admin Center
    • Windows Client
    • Windows Server
  • SCCM Query Collection List
Azure DevOps

Marking Azure DevOps Builds as Failed Using Command Line

Published: February 18, 2024
2 Min Read
SHARE

Marking Azure DevOps Builds as Failed Using Command Line.

In Azure DevOps, you can use the command-line interface (CLI) to manage and automate your build pipeline. Sometimes, you may want to mark a build as failed using the CLI.

To mark a build as failed using the Azure DevOps CLI, you can use the following command:

az pipelines runs update --id <run-id> --state Failed

In this command, <run-id> is the ID of the build run that you want to mark as failed. You can find the run ID by navigating to the build summary page in the Azure DevOps portal.

Once you’ve run the command, the build will be marked as failed and any subsequent tasks in the build pipeline will be skipped.

You can also add a reason for the failure by including the --reason parameter, like this:

az pipelines runs update --id <run-id> --state Failed --reason "Build failed due to errors in script"

In this example, the reason for the failure is “Build failed due to errors in script”. This message will be displayed in the build summary page in the Azure DevOps portal.

In conclusion, using the Azure DevOps CLI, you can mark a build as failed with just a few simple commands. This can be useful in cases where you need to manually trigger a build failure or if there are errors in the build pipeline that you want to highlight.

TAGGED:Azure DevOpsBashMicrosoft AzurePowerShell
Previous Article Configuration Manager Query Collection List Configuration Manager SCCM Current Branch Build Numbers
Next Article Securing Your Linux Server: How to Check TLS/SSL Certificate Expiration Dates
1 Comment 1 Comment
  • M says:
    April 8, 2025 at 2:57 am

    This does not work. There is no command `update` for az pipeline runs.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Translation

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
by Transposh - translation plugin for wordpress

Popular Posts

System Requirements for Windows Server 2016
Windows Server
Configuration Manager Query Collection List
Configuration Manager Query Collection List
ConfigMgr
Structured/Managed Navigation enabled on Modern Pages in Classic Team Sites
Tech
SCCM Failed to get DP locations as the expected version from MP
ConfigMgr

Recent Posts

Installing and Configuring Fail2ban for SSH Protection on Ubuntu 24.04
Linux
Enabling and Configuring FirewallD on AlmaLinux
Linux
User Creation and SSH Key Setup in AlmaLinux
Linux
How to reset password on AlmaLinux
Linux

© 2023 EnterinIT

Go to mobile version
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?