Azure Pipelines E2E tests
Run Monito browser tests from Azure Pipelines with an API key and your deployed URL. Untested YAML example, secret variables and limits.
CI/CD · Checked 2026-11-23
Add a job or stage after your deploy and wait for Monito's browser verdict. The Monito CLI path works today; our team has not run this pipeline in Azure DevOps.
How it works
- Your deploy step finishes and exposes the deployed URL. A step can set that URL with the ##vso[task.setvariable] logging command for later steps in the same job, or as an output variable that a later job reads.
- A script step with Node.js available reads that URL, authenticates with MONITO_TOKEN, and runs the project's saved tests with --base-url.
- The CLI waits and exits nonzero for failed or errored tests, failing the step and the run. Inspect browser evidence in Monito's run report.
Set it up
Pro or Team to create the API key used as MONITO_TOKEN. Browser runs use your credits. Plan details
- Create a Monito API key on Pro or Team. Store it as a secret pipeline variable named MONITO_TOKEN. You can also put it in a variable group, including a group linked to Azure Key Vault. A Key Vault-linked group maps secret names, and the pipeline fetches the values when it runs. Set MONITO_PROJECT_ID as a normal variable to your project ID. Do not put the secret value in the YAML file.
- Secret variables are not automatically decrypted into environment variables for scripts. Map MONITO_TOKEN on the script step with env: MONITO_TOKEN: $(MONITO_TOKEN). The example also maps MONITO_PROJECT_ID and DEPLOY_URL on that step. A missing mapping leaves MONITO_TOKEN unset for the script. Microsoft-hosted agents start each job on a fresh virtual machine, so there is no stored CLI login. Without a token, the CLI does not authenticate.
- Microsoft-hosted agents preinstall Node.js. On 2026-11-23, Microsoft Learn listed ubuntu-latest as the Ubuntu 24.04 image. The included software list that page links to, image version 20261116.376.1, includes Node.js 22.23.5 and lists Node.js 24.22.3 under cached tools. Pin a version with the UseNode@1 task. That task page, checked the same day, calls it Use Node.js ecosystem v1. The NodeTool@0 page says that version is deprecated and to use UseNode@1. The example sets version to 24.x.
- Publish the deployed URL from the deploy step. In the same job, ##vso[task.setvariable variable=deployUrl] is available to later steps. Across jobs, set isOutput=true, name the step, and read dependencies.deploy.outputs['recordUrl.deployUrl'] from a job that dependsOn the deploy job. Keep the token out of that value.
- A failed pipeline can block an Azure Repos pull request when the branch's build validation policy is Required. Builds must then complete successfully before the pull request can complete. Configuring validation builds for an Azure Repos Git repository requires a project administrator. On GitHub, protected branches can require the pipeline's status check so a pull request does not merge until a validation build succeeds. Create the pipeline and run it once so GitHub knows its name, then select that name in the status checks list. The docs say the pipeline shows up when you use GitHub app authentication and it has run at least once in the last week. This example does not post a pull request comment.
pool:
vmImage: ubuntu-latest
variables:
MONITO_PROJECT_ID: project_123
jobs:
- job: deploy
steps:
- script: echo "##vso[task.setvariable variable=deployUrl;isOutput=true]$URL"
name: recordUrl
- job: monito
dependsOn: deploy
variables:
DEPLOY_URL: $[ dependencies.deploy.outputs['recordUrl.deployUrl'] ]
steps:
- task: UseNode@1
inputs:
version: "24.x"
- script: |
test -n "$DEPLOY_URL" || { echo "DEPLOY_URL is empty"; exit 1; }
npx -y @monitodev/cli@4 project run "$MONITO_PROJECT_ID" --wait --base-url "$DEPLOY_URL"
env:
MONITO_TOKEN: $(MONITO_TOKEN)
MONITO_PROJECT_ID: $(MONITO_PROJECT_ID)
DEPLOY_URL: $(DEPLOY_URL)
Example our team has not run in Azure Pipelines. The deploy job stands in for your deployment and only publishes the URL. Replace $URL with the URL your deploy command prints. The guard fails the step if DEPLOY_URL is empty so the CLI cannot silently test the project's default environment. MONITO_TOKEN is mapped with env because a secret variable is not an environment variable on its own. UseNode@1 was the current Node.js task on 2026-11-23, and NodeTool@0 is deprecated in favor of it. The pool is ubuntu-latest, which Microsoft Learn listed as the Ubuntu 24.04 image that day, so the script step runs in bash.
Using GitHub Actions instead?
Using GitHub Actions instead? That page runs saved tests with a project-scoped OIDC binding. The generated workflow does not deploy your branch.
Using GitLab CI instead?
Using GitLab CI instead? The same CLI command runs after a review deploy when the URL arrives through a dotenv artifact. Our team has not run that YAML in GitLab.
Using CircleCI instead?
Using CircleCI instead? Add a job that reads the deployed URL from a workspace and runs the same CLI command. Our team has not run that config in CircleCI.
Using Bitbucket Pipelines instead?
Using Bitbucket Pipelines instead? Add a step that reads the deployed URL from an artifact and runs the same CLI command. Our team has not run that config in Bitbucket Pipelines.
Using Jenkins instead?
Using Jenkins instead? Add a stage that reads the deployed URL from the workspace and runs the same CLI command. Our team has not run that Jenkinsfile in Jenkins.
Azure Pipelines sources
Azure Pipelines behavior on this page was checked against the following documentation on 2026-11-23. UseNode@1 was the current Node.js task that day, and the NodeTool@0 page says that version is deprecated and to use UseNode@1. Microsoft Learn listed ubuntu-latest as the Ubuntu 24.04 image. The included software list linked from that page, image version 20261116.376.1, includes Node.js 22.23.5 and lists Node.js 24.22.3 under cached tools. The benchmark reports below do not validate this pipeline. Our team has not run it in Azure DevOps.
Example result
Example result: field names from the CLI, values illustrative
Selected fields from project run --wait --json. Each runs entry has its own id, status and sessionId. Add --json to read the full result. Open /session/<sessionId> on Monito, or follow the run report from the dashboard or GitHub summary to inspect browser evidence.
{
"runs": [
{
"id": "run_example",
"scenarioId": "scenario_example",
"status": "failed",
"sessionId": "session_example"
}
]
}Limits to account for
Azure Pipelines makes an effort to mask secrets in logs. Once a secret is mapped into a step, code running in that step can read the value. Substrings of a secret are not masked. A transformed value is not masked as the original secret. The logging commands page says ##vso[task.setsecret] registers a value for the rest of the job, and that this command is useful when a secret is transformed (for example, base64 encoded) or derived. Values that already appeared before that command are not masked.
Unlike a normal variable, a secret is not automatically decrypted into an environment variable for a script. Map it on the step with env. A missing MONITO_TOKEN mapping leaves that name empty in the script. The CLI reads MONITO_TOKEN for CI authentication, and without a token or a stored login it does not authenticate.
By default with GitHub pipelines, secrets associated with your build pipeline are not made available to pull request builds of forks. Those secrets include build variables marked secret. The control is Make secrets available to builds of forks, and the docs say that option is disabled by default. GitHub Enterprise Server pipelines enable these secrets by default. A fork build that does not receive MONITO_TOKEN cannot authenticate the CLI.
A variable set with ##vso[task.setvariable] is available to later steps in the same job. The logging commands page says the first task can set a variable and following tasks can use it, and that a non-secret variable is exposed to those tasks as an environment variable. A later job needs isOutput=true and dependsOn the job that set the variable. Reference it as dependencies.<job>.outputs['<step>.<variable>']. Output variables are only available in the next downstream job unless each consumer depends on the job that set the variable.
A base-URL override preserves scenario paths and saved-login origin restrictions. It does not authorize credentials on a new preview origin.
Comparable benchmark runs
Our team published these runs in the reliability benchmark. They show comparable browser journeys, not executions of the configuration or illustrative result above. Run your own scenario before relying on this integration.
Questions
Is there a Monito Azure DevOps extension?
No. Monito does not publish an Azure DevOps extension. This page runs the Monito CLI with npx from a script step.
Does this work with classic (UI) release pipelines?
A Bash task can run the same command. Map MONITO_TOKEN in that task's environment variables, because a classic task does not receive a secret variable as an environment variable on its own. Our team has not run that task.
Which plan do I need?
Pro or Team. Creating the API key used as MONITO_TOKEN requires Pro ($79/mo) or Team ($199/mo). Browser runs use credits.