Skip to main content
This page shows an example pipeline for running Momentic on Azure Pipelines. More reference configs live in momentic-ai/examples. Azure DevOps is auto-detected, so Momentic reads git metadata (branch, commit, pipeline) from the build environment. Given this root package.json:
package.json
Create a file called azure-pipelines.yml in your repository with the following contents:
azure-pipelines.yml

Authentication

To run any commands, you must authenticate with Momentic by providing the MOMENTIC_API_KEY environment variable.
  1. Create an API key in the Momentic dashboard.
Copy the value. You add it as a CI secret in the next step.
  1. Add it as a secret pipeline variable named MOMENTIC_API_KEY. Mark it as secret so logs mask it. Do not commit it to the pipeline file.
  2. Azure does not pass secret variables to scripts on its own. Map the variable into the environment of each momentic step with env:, as shown above.

Sharding

If you have a large test set, use sharding to run tests in parallel across CI jobs and shorten total run time. Use a parallel job strategy and use the 1-indexed System.JobPositionInPhase and total System.TotalJobsInPhase for --shard-index / --shard-count. To collect every shard into a single run group in the dashboard, add a job that merges and uploads results after the tests finish.
azure-pipelines.yml