Azure DevOps
Integrate bricks CLI into Azure DevOps pipelines
Integrate bricks CLI into your Azure DevOps pipelines to publish blueprints, plan infrastructure changes on PRs, and deploy across collections with approval gates.
Setup
Create a Variable Group named
bluebricks-credentialswith a secretBRICKS_API_KEY(see Long-Lived Tokens)Create Environments (
bluebricks-dev,bluebricks-staging,bluebricks-production) with approval checks on staging and production
Install the CLI in any pipeline job:
- script: |
/bin/bash -c "$(curl -fsSL https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/install.sh)"
displayName: 'Install bricks CLI'The CLI reads configuration from environment variables prefixed with BRICKS_. Set BRICKS_NON_INTERACTIVE and BRICKS_API_KEY at the pipeline level so every step picks them up automatically. Since BRICKS_API_KEY is a secret, it must also be mapped via env: on each step.
CI/CD Flags
See bricks install and bricks blueprint publish for full reference.
BRICKS_API_KEY
Authenticate without browser login
BRICKS_NON_INTERACTIVE
Suppress interactive prompts
--plan-only
Preview changes without applying
--yes
Auto-approve and apply
Deploy Pipeline
Plans on PRs, then deploys through dev (automatic), staging (approval), and production (approval). Uses ${{ each }} to loop over environments so the deploy logic is defined once:

Publish Pipeline
Publishes blueprints to the registry when changes merge to main:
Deployment Manifest
Each environment has a deploy.yaml:
See Deployment Manifest File Format for the full reference. For blueprint definitions (bricks.yaml), see Creating Blueprints.
Repository Structure
Troubleshooting
authentication required
Verify BRICKS_API_KEY is set and linked to the pipeline
Pipeline hangs on publish
Bump the version in bricks.yaml before merging - the CLI prompts when a version already exists
INVALID_PACKAGE_NAME
Use underscores, not hyphens (e.g., aws_vpc not aws-vpc)
Last updated