Skip to the main content.
Cubesys
Cubesys
  • Services
    • Cloud Managed Services
    • Cloud Adoption, Automation & Optimisation
    • Modern Workplace
    • Azure Virtual Desktop (AVD)
    • Windows 365
    • Disaster Recovery
    • Surface Modern Solutions
  • Solutions
    • Our Solutions
    • Virtual Desktop – Economic Plan for Success
    • ISV Assist
    • Cloud Governance
    • Cyber Aware
    • Microsoft 365 Economic Plan
    • Virtual Desktop Deployment Services
    • Azure Migration Economic Plan
    • Azure Optimisation with CloudClarity
    • Azure Ready and Govern Foundations
  • Support
  • About
    • About cubesys
    • Our Team
    • Our Partners
  • Latest
    • Blog
    • Events
  • Case Studies
  • Careers
  • Contact
1300 043 176
1300 043 176
  • Services
    • Cloud Managed Services
    • Cloud Adoption, Automation & Optimisation
    • Modern Workplace
    • Azure Virtual Desktop (AVD)
    • Windows 365
    • Disaster Recovery
    • Surface Modern Solutions
  • Solutions
    • Our Solutions
    • Virtual Desktop – Economic Plan for Success
    • ISV Assist
    • Cloud Governance
    • Cyber Aware
    • Microsoft 365 Economic Plan
    • Virtual Desktop Deployment Services
    • Azure Migration Economic Plan
    • Azure Optimisation with CloudClarity
    • Azure Ready and Govern Foundations
  • Support
  • About
    • About cubesys
    • Our Team
    • Our Partners
  • Latest
    • Blog
    • Events
  • Case Studies
  • Careers
  • Contact

1 min read

Trigger a DevOps Pipeline from the Azure DevOps Rest API Webhook

cubesys : Aug 11, 2022 12:00:00 AM

Azure DevOps
Trigger a DevOps Pipeline from the Azure DevOps Rest API Webhook

Sometimes, you need the ability to trigger a DevOps build or release pipeline when a condition is met through a piece of code or from outside of the Azure DevOps environment.

In order to achieve this, we can utilise the DevOps API (Application Programming Interface) and send a Push request to a webhook URI (Uniform Resource Identifier) that will act as a trigger for a pipeline.

Creating a Personal Access Token

You can trigger any pipeline to run as long as you have the A Personal Access Token, which can be accessed from Personal Access Tokens within the user menu.

Here, you’ll want to create a new token.

The name is not important, I’ve used “triggerFromWebhook”. For expiry, I’ve set it to custom defined and made it last a year.

You’ll want to use a Custom Defined Scope, for which I’ve used the following settings.

It’s important that you copy the token that appears as you will not be able to access it again once the tab is closed. This token will be used as a basic authentication password.

That’s all we need to now trigger this pipeline from another location using a REST (Representational State Transfer) method.

Triggering the DevOps pipeline

You’ll use the following headers:

Authorization Basic {token}
Content-Type Application/json

And the following body:

{
           definitionId: _
}

The definition ID comes from the pipeline itself. It can be found inside the the URL of the pipeline you’re triggering.

In this case, the ID will be 26.

The endpoint we’re hitting will look something like this:

https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/release?api-version=7.1-preview.8

The API method will be Post. Attach the headers and body and the release pipeline should be triggered.

Triggering a build pipeline

To trigger a build pipeline, you’ll need a different set of body and URL.

https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineID}/runs?&api-version=7.1-preview.1

The body will contain:

{
                      “templateParameters”: {“inputName”:”inputValue”}
}

If no inputs are required, then we run this with an empty template parameters value. The headers and method are the same for both runs.

  • Tweet

Azure – The Azure Security team has developed a Power BI Dashboard

cubesys : Aug 6, 2020 12:00:00 AM

The team in charge of Azure Security Center has developed a Power Bi dashboard to help you track your Secure Score evolution. It also includes...

Azure Security Azure Security Power BI
Read More

Azure – You can now get your virtual machine scale sets to auto-repair

cubesys : Mar 6, 2020 12:00:00 AM

As you know, Azure Virtual Machine Scale Sets let you create a group of identical virtual machine which then will scale up or down to match the...

Azure
Read More

Exchange Online – Use the new Exchange Online PowerShell module v2 with Modern Authentication with your scripts (preview)

cubesys : Jul 3, 2020 12:00:00 AM

As you know, Microsoft is going to retire the basic authentication for Exchange Online PowerShell during the second half of 2021.

Office 365 Exchange
Read More
CBD Office

Suite 221
111 Harrington Street,
The Rocks NSW 2000,
Australia

ABN 39 163 878 859

Phone 1300 163 712

Contacts

Support 1300 043 176

info@cubesys.com.au

sales@cubesys.com.au

Solutions
  • Modern Workplace
  • Cloud Adoption, Automation & Optimisation
  • Disaster Recovery
  • Support Services
Cubesys
  • Privacy Policy
  • Terms of Use

© 2025 cubesys

X Linkedin YouTube