Skip to main content
skill CX Codex

azure-devops · bagelhole — Claude Code skill: Azure Pipelines CI/CD

A skill that lets your agent write and fix Azure DevOps YAML pipelines: build, test, deploy to Azure. Useful when CI/CD lives in Azure Pipelines.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill azure-devops -a claude-code
Open on GitHub

What azure-devops does

The skill covers the shape of azure-pipelines.yml: branch, tag and scheduled triggers, stages and jobs, matrix builds across Linux, Windows and macOS, job dependencies. Variables, variable groups, secrets and runtime parameters each get their own section.

Templates come next — job and stage templates with parameters, environment deployments, rolling strategy, approval gates configured in the Azure DevOps UI. For Azure there are ready tasks: AzureWebApp@1, AzureContainerApps@1, KubernetesManifest@0, plus Docker@2 for building and pushing images.

You need an Azure DevOps organization and project, service connections for the target environments, and basic YAML knowledge. Azure deployments also need a subscription. Tasks like AzureWebApp@1 fail without a service connection, since it goes into azureSubscription.

What it helps with

  • build a multi-stage build and deploy pipeline
  • set up branch, tag and scheduled triggers
  • move shared steps into reusable templates
  • deploy a container to Azure Container Apps or AKS
  • add an approval gate before production

Example prompts for the agent

  • write azure-pipelines.yml with Build and Deploy stages for Node 20
  • add a matrix build for ubuntu, windows and macos
  • set up a production deployment through a service connection

How to install azure-devops

1Skills CLI (Vercel)

npx skills add BagelHole/DevOps-Security-Agent-Skills --skill azure-devops -a claude-code

2Manually: put the files in place

~/.claude/skills/azure-devops/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/azure-devops/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about azure-devops

How do I install azure-devops in Claude?

Run npx skills add BagelHole/DevOps-Security-Agent-Skills --skill azure-devops -a claude-code. The skill lands at ~/.claude/skills/azure-devops/SKILL.md.

What does the azure-devops skill do?

It gives the agent a reference for Azure Pipelines: YAML structure, triggers, stages, templates, environment deployments and Azure tasks.

What do I need before using it?

An Azure DevOps organization and project, service connections for the target environments, and basic YAML knowledge. Azure deployments also need a subscription.

Source text

SKILL.md · MIT
---
name: azure-devops
description: Set up Azure Pipelines for CI/CD, configure build and release pipelines, manage Azure DevOps projects, and integrate with Azure services. Use when working with Azure DevOps Services or Server for enterprise DevOps workflows.
license: MIT
metadata:
  author: devops-skills
  version: "1.0"
---

# Azure DevOps Pipelines

Build, test, and deploy applications using Azure Pipelines with YAML or classic editor.

## When to Use This Skill

Use this skill when:
- Creating CI/CD pipelines in Azure DevOps
- Configuring build and release stages
- Managing Azure DevOps service connections
- Deploying to Azure or other cloud platforms
- Setting up multi-stage YAML pipelines

## Prerequisites

- Azure DevOps organization and project
- Service connections for target environments
- Basic YAML understanding
- Azure subscription (for Azure deployments)

## YAML Pipeline Structure

Create `azure-pipelines.yml` in repository root:

```yaml
trigger:
  branches:
    include:
      - main
      - develop
  paths:
    include:
      - src/*

pool:
  vmImage: 'ubuntu-latest'

variables:
  buildConfiguration: 'Release'
  nodeVersion: '20.x'

stages:
  - stage: Build
    jobs:
      - job: BuildJob
        steps:
          - task: NodeTool@0
            inputs:
              versionSpec: $(nodeVersion)
          - script: |
              npm ci
              npm run build
            displayName: 'Build application'
          - publish: $(Build.ArtifactStagingDirectory)
            artifact: drop

  - stage: Deploy
    dependsOn: Build
    condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
    jobs:
      - deployment: DeployWeb
        environment: 'production'
        strategy:
          runOnce:
            deploy:
              steps:
                - script: echo Deploying to production
```

## Triggers

### Branch Triggers

```yaml
trigger:
  branches:
    include:
      - main
      - release/*
    exclude:
      - feature/*
  tags:
    include:
      - v*
```

### Pull Request Triggers

```yaml
pr:
  branches:
    include:
      - main
  paths:
    include:
      - src/*
    exclude:
      - docs/*
```

### Scheduled Triggers

```yaml
schedules:
  - cron: '0 2 * * *'
    displayName: 'Nightly build'
    branches:
      include:
        - main
    always: true
```

## Jobs and Stages

### Parallel Jobs

```yaml
stages:
  - stage: Test
    jobs:
      - job: UnitTests
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - script: npm run test:unit
      
      - job: IntegrationTests
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - script: npm run test:integration
```

### Matrix Strategy

```yaml
jobs:
  - job: Build
    strategy:
      matrix:
        linux:
          vmImage: 'ubuntu-latest'
        windows:
          vmImage: 'windows-latest'
        mac:
          vmImage: 'macos-latest'
    pool:
      vmImage: $(vmImage)
    steps:
      - script: npm test
```

### Job Dependencies

```yaml
stages:
  - stage: Build
    jobs:
      - job: A
        steps:
          - script: echo Job A
      - job: B
        dependsOn: A
        steps:
          - script: echo Job B
```

## Variables and Parameters

### Variable Groups

```yaml
variables:
  - group: 'production-secrets'
  - name: buildConfiguration
    value: 'Release'
```

### Runtime Parameters

```yaml
parameters:
  - name: environment
    displayName: 'Environment'
    type: string
    default: 'dev'
    values:
      - dev
      - staging
      - prod

stages:
  - stage: Deploy
    variables:
      env: ${{ parameters.environment }}
    jobs:
      - job: Deploy
        steps:
          - script: echo "Deploying to $(env)"
```

### Secret Variables

```yaml
variables:
  - name: mySecret
    value: $(SECRET_FROM_PIPELINE)  # Set in pipeline settings

steps:
  - script: |
      echo "Using secret"
      ./deploy.sh
    env:
      API_KEY: $(mySecret)
```

## Templates

### Job Template

```yaml
# templates/build-job.yml
parameters:
  - name: nodeVersion
    default: '20'

jobs:
  - job: Build
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: ${{ parameters.nodeVersion }}
      - script: npm ci && npm run build
```

### Using Templates

```yaml
# azure-pipelines.yml
stages:
  - stage: Build
    jobs:
      - template: templates/build-job.yml
        parameters:
          nodeVersion: '20'
```

### Stage Template

```yaml
# templates/deploy-stage.yml
parameters:
  - name: environment
    type: string
  - name: serviceConnection
    type: string

stages:
  - stage: Deploy_${{ parameters.environment }}
    jobs:
      - deployment: Deploy
        environment: ${{ parameters.environment }}
        strategy:
          runOnce:
            deploy:
              steps:
                - task: AzureWebApp@1
                  inputs:
                    azureSubscription: ${{ parameters.serviceConnection }}
                    appName: 'myapp-${{ parameters.environment }}'
```

## Deployments

### Environment Deployments

```yaml
stages:
  - stage: DeployStaging
    jobs:
      - deployment: DeployWeb
        environment: 'staging'
        strategy:
          runOnce:
            deploy:
              steps:
                - download: current
                  artifact: drop
                - script: ./deploy.sh staging
```

### Approval Gates

Configure in Azure DevOps UI:
1. Go to Environments
2. Select environment
3. Add approval check
4. Configure approvers

### Rolling Deployment

```yaml
jobs:
  - deployment: Deploy
    environment: 'production'
    strategy:
      rolling:
        maxParallel: 2
        deploy:
          steps:
            - script: ./deploy.sh
```

## Azure Service Tasks

### Azure Web App Deployment

```yaml
- task: AzureWebApp@1
  inputs:
    azureSubscription: 'my-azure-connection'
    appType: 'webAppLinux'
    appName: 'my-web-app'
    package: '$(Pipeline.Workspace)/drop/*.zip'
```

### Azure Container Apps

```yaml
- task: AzureContainerApps@1
  inputs:
    azureSubscription: 'my-azure-connection'
    containerAppName: 'my-container-app'
    resourceGroup: 'my-rg'
    imageToDeploy: 'myregistry.azurecr.io/myapp:$(Build.BuildId)'
```

### Azure Kubernetes Service

```yaml
- task: KubernetesManifest@0
  inputs:
    action: 'deploy'
    kubernetesServiceConnection: 'my-aks-connection'
    namespace: 'default'
    manifests: |
      $(Pipeline.Workspace)/manifests/deployment.yml
      $(Pipeline.Workspace)/manifests/service.yml
    containers: |
      myregistry.azurecr.io/myapp:$(Build.BuildId)
```

## Docker Builds

```yaml
- task: Docker@2
  inputs:
    containerRegistry: 'my-acr-connection'
    repository: 'myapp'
    command: 'buildAndPush'
    Dockerfile: '**/Dockerfile'
    tags: |
      $(Build.BuildId)
      latest
```

## Self-Hosted Agents

### Install Agent

```bash
# Download agent
mkdir myagent && cd myagent
curl -o vsts-agent.tar.gz https://vstsagentpackage.azureedge.net/agent/3.227.2/vsts-agent-linux-x64-3.227.2.tar.gz
tar zxvf vsts-agent.tar.gz

# Configure
./config.sh --url https://dev.azure.com/myorg --auth pat --token PAT_TOKEN --pool default

# Run as service
sudo ./svc.sh install
sudo ./svc.sh start
```

### Use Self-Hosted Pool

```yaml
pool:
  name: 'my-self-hosted-pool'
  demands:
    - docker
    - Agent.OS -equals Linux
```

## Common Issues

### Issue: Service Connection Fails
**Problem**: Cannot authenticate to Azure
**Solution**: Verify service principal permissions, check connection in project settings

### Issue: Artifact Not Found
**Problem**: Download artifact fails
**Solution**: Ensure publish task ran successfully, check artifact name matches

### Issue: Environment Not Found
**Problem**: Deployment to environment fails
**Solution**: Create environment in Pipelines > Environments first

## Best Practices

- Use YAML pipelines over classic editor
- Implement templates for reusable components
- Use variable groups for shared configuration
- Configure environment approvals for production
- Use service connections with minimal permissions
- Implement artifact versioning
- Cache dependencies for faster builds

## Related Skills

- [github-actions](../github-actions/) - GitHub CI/CD alternative
- [terraform-azure](../../../infrastructure/cloud-azure/terraform-azure/) - Azure IaC
- [azure-aks](../../../infrastructure/cloud-azure/azure-aks/) - AKS deployments

© devops-skills · MIT · BagelHole/DevOps-Security-Agent-Skills

Similar skills

Everything for DevOps and infrastructure →

azure-devops by other authors comes first.

azure-devops MicrosoftDocs Provides your AI agent with reference guidance for Azure DevOps and server deployments. Useful for troubleshooting issues, checking quotas, and configuring access. CX Codex +1 403installs azure-pipelines-generator akin-ozer This skill writes azure-pipelines.yml for you: stages, jobs, steps and reusable templates. Useful when moving CI to Azure Pipelines or splitting a pipeline into templates. CX Codex +1 647installs azure-pipelines MicrosoftDocs A skill that gives your agent Azure Pipelines expertise: failure triage, YAML templates, agents, service connections, Key Vault secrets and Kubernetes deploys. CX Codex +1 430installs azure-pipelines-validator akin-ozer Runs local scripts over azure-pipelines.yml to catch syntax errors, security issues and best-practice gaps. Useful before you merge a pipeline change. CX Codex +1 637installs azure-cloud-architect Alireza Rezvani Designs Azure architectures, generates Bicep templates, and reviews cloud costs. Use it when planning a migration, delivery pipeline, or Azure service stack. 607installs powershell-master JosiahSiegel A skill for PowerShell work: cmdlet syntax, PSGallery modules, CI/CD pipeline patterns and security. Useful whenever the agent writes a .ps1 or edits a pipeline. CX Codex +1 1,100installs azure-app-service MicrosoftDocs Hands the agent a reference for Azure App Service: plans, VNet integration, managed identity, slots, WebJobs. Useful when work touches config or deployment. CX Codex +1 307installs

From the same set127

cloudflare-zero-trust A skill for securing internal apps and SSH access with Cloudflare Zero Trust without running a VPN. Covers cloudflared tunnels, IdP policies, and device checks. CX Codex +1 325installs ai-pipeline-orchestration A skill that helps the agent build pipelines for data ingestion, model training, batch inference and RAG indexing on Prefect, Airflow or Dagster. CX Codex +1 325installs rag-infrastructure A skill for building RAG infrastructure: document ingestion, embeddings, vector stores, hybrid search and grounded LLM answers. CX Codex +1 325installs cdn-setup Configures CloudFront and Cloudflare CDNs for static asset delivery, caching rules, and cache invalidation. Useful when deploying web apps and edge routing. CX Codex +1 324installs circleci Generates and tunes CircleCI pipelines in .circleci/config.yml. Useful for automating builds, tests, caching, and deployments across environments. CX Codex +1 323installs gcp-audit-logs A skill that walks you through Cloud Audit Logs in GCP: turning on data access logs, exporting them to BigQuery, and querying suspicious events. CX Codex +1 324installs platform-engineering A skill for building an internal developer platform: Backstage portal, Crossplane self-service infrastructure and golden paths. Useful when teams drown in manual environment setup. CX Codex +1 322installs aws-lambda Build and deploy AWS Lambda serverless functions, attach triggers, configure layers, and manage canary releases through the AWS CLI. CX Codex +1 321installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor