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 the 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 https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows 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.

The scope of authorization can be Full access or Custom defined as per your requirement. For Custom defined, you can select Read, Write & Manage/Execute for all options.

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 QTM4J

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

 

CI/CD Rule without Parameters

CI/CD Rule With JSON Parameters

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

The pipeline gets triggered successfully.