Ved at bruge denne side, du accepterer Privatlivspolitik.
Acceptere
EnterinITEnterinITEnterinIT
  • HJEM
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orkester
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kontor 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Hold
  • WINDOWS
    • Windows Admin Center
    • Windows klient
    • Windows Server
  • SCCM-forespørgselsindsamlingsliste
Læsning: Bash start Azure DevOps Release via API
Font ResizerAa
EnterinITEnterinIT
Font ResizerAa
  • HJEM
  • IT PRO
  • TECH
  • MICROSOFT
  • WINDOWS
  • SCCM-forespørgselsindsamlingsliste
Søge
  • HJEM
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orkester
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Kontor 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Hold
  • WINDOWS
    • Windows Admin Center
    • Windows klient
    • Windows Server
  • SCCM-forespørgselsindsamlingsliste
Bash

Bash start Azure DevOps Release via API

Published August 26, 2024
2 Min læst
DELE

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

TAGGET:Azure DevOpsBashCentOSLinuxMicrosoft AzureUbuntu
Forrige artikel Securing Your Linux Server: How to Check TLS/SSL Certificate Expiration Dates
Næste artikel How to Update Sysmon on Windows – Step by Step Guide
Efterlad en kommentar Efterlad en kommentar

Efterlad et svar Annuller svar

Din e-mailadresse vil ikke blive offentliggjort. Påkrævede felter er markeret *

Denne side bruger Akismet til at reducere spam. Lær, hvordan dine kommentardata behandles.

Oversættelse

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

Populære indlæg

Systemkrav til Windows Server 2016
Windows Server
Configuration Manager Forespørgselsindsamlingsliste
Configuration Manager Forespørgselsindsamlingsliste
ConfigMgr
Struktureret/administreret navigation aktiveret på moderne sider i klassiske teamwebsteder
Tech
SCCM Kunne ikke hente DP-placeringer som den forventede version fra MP
ConfigMgr

Seneste indlæg

Installation og konfiguration af Fail2ban til SSH-beskyttelse på Ubuntu 24.04
Linux
Aktivering og konfiguration af FirewallD på AlmaLinux
Linux
Brugeroprettelse og SSH-nøgleopsætning i AlmaLinux
Linux
Sådan nulstiller du adgangskoden på AlmaLinux
Linux

© 2023 EnterinIT

Gå til mobil version
adbanner
Velkommen tilbage!

Log ind på din konto

Brugernavn eller e-mail-adresse
Adgangskode

Mistet din adgangskode?