Azure DevOps

Azure DevOps

Prerequisites

  • The azure-pipelines.yml file should have been created in the Repository that contains your project code and tests under Pipelines. The following is an example of yml file.

Authorization

To supply the Authorization header with the value Basic <auth>, perform the following steps:

  1. Build a string of the form username: PAT. Read below about how to generate Personal Access Token in Azure DevOps.

  2. Encode the string in Base64 format.

  3. Supply an "Authorization" header with content "Basic " followed by the encoded string.

 

Generate Personal Access Token in Azure DevOps

Follow the steps mentioned below to generate a Personal Access Token (PAT) in Azure DevOps. Refer to Use personal access tokens - Azure DevOps for more details.

Steps: 

1. Log into Azure.

2. Go to User Settings > Personal access tokens.

3. Click New Token.

Create a new personal access token by providing the details.

 

Construct Webhook URL

The following is an example of a web request URL to trigger a build in Azure DevOps and follows this syntax.

For example, the organization and project values are as below:

Organization: qmetry
Project: qtm

PipelineId: 4

The URL to trigger the build would be -

CI/CD Rule Configuration in QTM

The following are examples of triggering the build without parameters, with query parameters, and with RAW parameters.

CI/CD Rule without Parameters

image-20250104-131046.png

CI/CD Rule With JSON Parameters

image-20250103-093615.png

After creating the CI/CD rule in QTM, you can trigger a pipeline job in Azure DevOps.

The pipeline gets triggered successfully.