azure-devops – skill DevOps & Hạ tầng cho agent AI
Thiết lập Azure Pipelines cho CI/CD, cấu hình pipeline build và release, quản lý dự án Azure DevOps, và tích hợp với các dịch vụ Azure.
Cài skill azure-devops bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-devops-2c36b.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /azure-devops – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-devops-2c36b.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $azure-devops – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-devops-2c36b.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /azure-devops – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-devops-2c36b.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /azure-devops – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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
These fragments require actual build outputs, deploy scripts, service connections and environment checks. Echoing “Deploying” is not a deployment. YAML PR triggers depend on repository provider; Azure Repos Git uses branch build-validation policy. Rolling deployment strategy applies to supported VM environment resources, not arbitrary web apps/Kubernetes. Pin supported runtime/agent versions and obtain the agent package from the current official download instructions with integrity verification; the archive URL below is historical. Keep untrusted PR code away from production credentials and persistent self-hosted agents.
Create azure-pipelines.yml in repository root:
trigger:
branches:
include:
- main
- develop
paths:
include:
- src/*
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
nodeVersion: '22.x'
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- task: NodeTool@0
inputs:
versionSpec: $(nodeVersion)
- script: |
npm ci
npm run build
displayName: 'Build application'
# Adapt dist to the actual build output directory.
- publish: $(Build.SourcesDirectory)/dist
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 productionTriggers
Branch Triggers
trigger:
branches:
include:
- main
- release/*
exclude:
- feature/*
tags:
include:
- v*Pull Request Triggers
pr:
branches:
include:
- main
paths:
include:
- src/*
exclude:
- docs/*Scheduled Triggers
schedules:
- cron: '0 2 * * *'
displayName: 'Nightly build'
branches:
include:
- main
always: trueJobs and Stages
Parallel Jobs
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:integrationMatrix Strategy
jobs:
- job: Build
strategy:
matrix:
linux:
vmImage: 'ubuntu-latest'
windows:
vmImage: 'windows-latest'
mac:
vmImage: 'macos-latest'
pool:
vmImage: $(vmImage)
steps:
- script: npm testJob Dependencies
stages:
- stage: Build
jobs:
- job: A
steps:
- script: echo Job A
- job: B
dependsOn: A
steps:
- script: echo Job BVariables and Parameters
Variable Groups
variables:
- group: 'production-secrets'
- name: buildConfiguration
value: 'Release'Runtime Parameters
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
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
# 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 buildUsing Templates
# azure-pipelines.yml
stages:
- stage: Build
jobs:
- template: templates/build-job.yml
parameters:
nodeVersion: '20'Stage Template
# 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
stages:
- stage: DeployStaging
jobs:
- deployment: DeployWeb
environment: 'staging'
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
- script: ./deploy.sh stagingApproval Gates
Configure in Azure DevOps UI:
1. Go to Environments
2. Select environment
3. Add approval check
4. Configure approvers
Rolling Deployment
jobs:
- deployment: Deploy
environment: 'production'
strategy:
rolling:
maxParallel: 2
deploy:
steps:
- script: ./deploy.shAzure Service Tasks
Azure Web App Deployment
- task: AzureWebApp@1
inputs:
azureSubscription: 'my-azure-connection'
appType: 'webAppLinux'
appName: 'my-web-app'
package: '$(Pipeline.Workspace)/drop/*.zip'Azure Container Apps
- 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
- 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
- task: Docker@2
inputs:
containerRegistry: 'my-acr-connection'
repository: 'myapp'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
tags: |
$(Build.BuildId)
latestSelf-Hosted Agents
Install Agent
# 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 --pool default
# Enter the PAT only in the interactive secret prompt; never in command arguments.
# Run as service
sudo ./svc.sh install
sudo ./svc.sh startUse Self-Hosted Pool
pool:
name: 'my-self-hosted-pool'
demands:
- docker
- Agent.OS -equals LinuxCommon 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 (
terraform-azure) - Azure IaC - azure-aks (
azure-aks) - AKS deployments
Limitations
- Guidance executes against real environments: confirm target, blast radius, and rollback plan before applying anything.
- Never deploy to production without explicit approval. Docs-only impo
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- azure-eventgrid-dotnet – SDK Azure Event Grid cho .NET. Thư viện client để xuất bản và tiêu thụ sự kiện với Azure…
- azure-eventgrid-java – Xây dựng ứng dụng hướng sự kiện bằng SDK Azure Event Grid cho Java. Dùng khi xuất bản sự…
- azure-eventgrid-py – SDK Azure Event Grid cho Python. Dùng để xuất bản sự kiện, xử lý CloudEvents và kiến…
- azure-eventhub-dotnet – SDK Azure Event Hubs cho .NET.
- azure-eventhub-py – SDK Azure Event Hubs cho Python để xử lý streaming. Dùng cho nhập sự kiện thông lượng…
- azure-eventhub-ts – Xử lý streaming sự kiện thông lượng cao và nhập dữ liệu thời gian thực.
- azure-functions – Các mẫu chuyên sâu cho phát triển Azure Functions, bao gồm mô hình isolated worker, điều…
- azure-functions-devsec – Xây dựng ứng dụng serverless trên Azure Functions. Cấu hình trigger, binding và triển…