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

Intune – You perform bulk actions on devices

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

You may not have a noticed but you can now perform bulk actions (delete, retire, wipe or send custom notification) on devices registered in...

Endpoint Configuration Manager Intune
Read More

Teams – You can now configure device profile for Collaboration Bar devices

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

You may know new devices type for Microsoft Teams, called Collaboration Bar, are now available (see ...

Microsoft Teams
Read More

Intune – Remove noncompliant devices

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

Intune/Endpoint Configuration Manager has been updated to automatically remove non compliant devices.

Endpoint Configuration Manager Intune
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