# Azure Devops Pipelines

#### Trigger a Test Run from Azure Devops Pipelines

1. Create the Azure Pipelines project the way you normally would.
2. Add the Testery API Token as a secret variable in your project (follow these steps: <https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables>). The Testery API token can be found on the Settings tab on the Integrations sub-tab.
3. Add the following task to your `azure-pipelines.yml`. Make sure you update the command arguments to match your project.

```yaml
- task: PowerShell@2
  inputs: 
    displayName: Run Tests in Testery
    targetType: inline
    script: | 
       pip -q install testery --upgrade
       testery upload-build-artifacts --token "${env:TESTERY_TOKEN}" --project "example-specflow-dotnet-core" --path "$(Build.SourcesDirectory)\Web.Specs\bin\Release\netcoreapp3.0\" --build-id "$(Build.BuildNumber)" --zip-dir
       testery create-test-run --token "${env:TESTERY_TOKEN}" --git-ref "$(Build.SourceVersion)" --project "example-specflow-dotnet-core" --environment "dev" --build-id "$(Build.BuildNumber)"
    env: 
      TESTERY_TOKEN: $(TesteryToken)
```

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testery.io/integrations/ci-cd-integration-guide/azure-devops-pipelines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
