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: Bash start Azure DevOps Release via API
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
Bash

Bash start Azure DevOps Release via API

Published: February 18, 2024
2 Min Read
SHARE

Bash start Azure DevOps Release via API.

To start a release from Azure DevOps via the API using bash, you can use the following steps:

  1. Obtain a Personal Access Token (PAT) from Azure DevOps. This token will be used to authenticate your API requests.
  2. Determine the Azure DevOps organization name, project name, and release pipeline ID for the release you want to start. You can find the release pipeline ID by navigating to the Releases page in Azure DevOps, selecting the release pipeline, and copying the ID from the URL.
  3. Construct the API request URL with the appropriate parameters. The URL should have the following format:
https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases?api-version=7.0

Replace {organization} with the name of your Azure DevOps organization, {project} with the name of your project you want to start.

  1. Create a bash script with the following code, replacing the placeholders with your own values:
#!/bin/bash

# Set variables
PAT="YOUR-PAT-HERE"
ORGANIZATION="YOUR-ORGANIZATION-NAME-HERE"
PROJECT="YOUR-PROJECT-NAME-HERE"
RELEASE_ID="YOUR-RELEASE-ID-HERE"

# Construct API request URL
URL="https://vsrm.dev.azure.com/${ORGANIZATION}/${PROJECT}/_apis/release/releases?api-version=7.0"

# Start release
curl -X POST \
  -H "Authorization: Basic $(echo -n ":${PAT}" | base64)" \
  -H "Content-Type: application/json" \
  -d "{"definitionId": "${RELEASE_ID}"}" \
  ${URL}
  1. Save the script and execute it in a terminal window. The script will start the release pipeline in Azure DevOps using the API.

Note that this script assumes you have the curl command-line tool installed on your system. If you don’t have curl, you can install it using your package manager.

Note that if you need to start releases in Release Pipeline automatically (without manual actions) make this change in Release Pipeline

TAGGED:Azure DevOpsBashCentOSLinuxMicrosoft AzureUbuntu
Previous Article Securing Your Linux Server: How to Check TLS/SSL Certificate Expiration Dates
Next Article How to Update Sysmon on Windows – Step by Step Guide
Leave a Comment Leave a Comment

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?