Skip to main content
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 automatically. For a given 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 and copy the value.
  2. Add it as a secret pipeline variable named MOMENTIC_API_KEY (mark it as secret so it is masked in logs). Avoid committing it to the pipeline file.
  3. Secret variables are not exposed to scripts automatically, so map it 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 read 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