How do I promote a validated pipeline to production using Azure Pipelines?
Add a job to azure-pipelines.yml that installs the Bruin CLI and runs bruin run ./pipeline --environment prod. It runs against the production environment only after validation and tests have passed. Store warehouse credentials as Azure Pipelines variable groups, and use a deployment job so two deploys can never write the same tables at once. Keep validation and deployment as separate jobs: validation should be fast and credential-free, deployment serialised and gated.
Command
bruin run ./pipeline --environment prodDefined in
YAML + CI
Works with
Azure Pipelines + Bruin CLI
What you get
How to do it
- 1
Create or open azure-pipelines.yml in your repository.
- 2
Install the Bruin CLI as a step: curl -LsSf https://getbruin.com/install/cli | sh.
- 3
Add bruin run ./pipeline --environment prod as the job's command.
- 4
Store warehouse credentials as Azure Pipelines variable groups, never in the repository.
- 5
Add a deployment job so concurrent runs cannot write the same tables.
- 6
Make the job required for merge, so a failure actually blocks.
How it works in code
# azure-pipelines.yml
- run: curl -LsSf https://getbruin.com/install/cli | sh
- run: bruin run ./pipeline --environment prodRun bruin run ./pipeline --environment prod and Azure Pipelines fails the build when the pipeline does, before the change reaches production.
Worth knowing
A job that reports failures without failing the build gets ignored within weeks. Make it required. And give CI its own warehouse connection pointed at a scratch schema, because a pull request can come from anywhere and should never hold production credentials.
Other ways to do this
Bruin is not always the right answer. Here is where the alternatives are stronger.
| Option | When it is the better choice |
|---|---|
| Bruin | Wire bruin run ./pipeline --environment prod into Azure Pipelines so pipeline changes get checked the same way application code does. |
| dbt in CI | The same pattern with dbt build and a state-based selector. Well documented, and the right choice if dbt is already your transformation layer. |
| A managed orchestrator | Tools like Dagster or Prefect Cloud handle scheduling and retries more richly than a CI runner, at the cost of another system to run. |
| Soda in CI | Soda's data-contract checks are the strongest documented option if formal contracts between teams are the main goal. |
Common questions
How do I run data pipelines in Azure Pipelines?
Install the Bruin CLI in a job and run bruin run ./pipeline --environment prod. Validation needs no warehouse credentials; deployment reads them from Azure Pipelines variable groups.
How do I stop two Azure Pipelines deploys running at once?
Use a deployment job. Two pipeline runs writing the same tables concurrently is the hardest data bug to diagnose, and it is entirely preventable.
Should validation and deployment be separate Azure Pipelines jobs?
Yes. Validation should run on every pull request, take seconds, and need no credentials. Deployment should run on merge, be serialised, and be gated. Combining them makes validation slow and deployment unsafe.
Related use cases
Promote a validated pipeline to production with GitHub Actions
How do I promote a validated pipeline to production using GitHub Actions?
Promotion in CIPromote a validated pipeline to production with GitLab CI
How do I promote a validated pipeline to production using GitLab CI?
Promotion in CIPromote a validated pipeline to production with Bitbucket Pipelines
How do I promote a validated pipeline to production using Bitbucket Pipelines?
Deploy data pipelines like software
Open source. Validate on every pull request, deploy on merge, roll back with git.