Azure DevOps

Prerequisites

The azure-pipelines.yml file must exist in the repository that contains your project code and tests under Pipelines. The following is an example of .yml file.

Azure DevOps editor showing an example azure-pipelines.yml file that defines parameters like name, build, environment, component, and priority, along with a script step that echoes a message when the pipeline is triggered.

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 these steps to generate a Personal Access Token (PAT) in Azure DevOps. For detailed guidance, see the Microsoft documentation on Personal Access Tokens.

Steps:

  1. Log in to Azure DevOps.

  2. Go to User Settings, then select Personal access tokens.

  3. Click New Token.

    Azure DevOps User Settings screen showing the Personal Access Tokens section with the + New Token button highlighted and the navigation path to Personal access tokens from the user profile menu.
  4. Provide the required details and create the token.

  5. Copy and store the generated token securely.

Construct Webhook URL

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

https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=7.0

Placeholder values:

  • organization: qmetry

  • project: qtm

  • pipelineId: 4

Example URL:

https://dev.azure.com/qmetry/qtm/_apis/pipelines/4/runs?api-version=7.0

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

QMetry CI/CD Rule configuration for Azure DevOps showing a webhook URL, Authorization header, POST method, and JSON webhook body without additional parameters.

CI/CD Rule With JSON Parameters

QMetry CI/CD Rule configuration screen for Azure DevOps showing a webhook URL, query parameter api-version set to 7.0, Authorization header, POST method, and JSON webhook body type.

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

The pipeline gets triggered successfully.

Azure DevOps pipeline summary page displaying manually triggered build details, including job name, status as Success, and duration under the Jobs section.
Azure DevOps job execution view showing runtime parameters such as input name, build number, environment, component, and priority within the job preparation parameters section.
Publication date: