$npx -y skills add wshaddix/dotnet-skills --skill dotnet-ado-uniqueUsing ADO-exclusive features. Environments, approvals, service connections, classic releases.
| 1 | # dotnet-ado-unique |
| 2 | |
| 3 | Azure DevOps-exclusive features not available in GitHub Actions: Environments with approvals and gates (pre-deployment checks, business hours restrictions), deployment groups vs environments (when to use each), service connections (Azure Resource Manager, Docker Registry, NuGet), classic release pipelines (legacy migration guidance to YAML), variable groups and library (linked to Azure Key Vault), pipeline decorators for organization-wide policy, and Azure Artifacts universal packages. |
| 4 | |
| 5 | **Version assumptions:** Azure DevOps Services (cloud). YAML pipelines with multi-stage support. Classic release pipelines for legacy migration context only. |
| 6 | |
| 7 | **Scope boundary:** This skill owns ADO-exclusive platform features that have no direct GitHub Actions equivalent. Composable YAML pipeline patterns (templates, triggers, multi-stage) are in [skill:dotnet-ado-patterns]. Build/test pipeline configuration is in [skill:dotnet-ado-build-test]. Publishing pipelines are in [skill:dotnet-ado-publish]. Starter CI templates are owned by [skill:dotnet-add-ci]. |
| 8 | |
| 9 | **Out of scope:** Composable pipeline patterns (templates, triggers) -- see [skill:dotnet-ado-patterns]. Build/test pipeline configuration -- see [skill:dotnet-ado-build-test]. Publishing pipelines -- see [skill:dotnet-ado-publish]. Starter CI templates -- see [skill:dotnet-add-ci]. GitHub Actions equivalents -- see [skill:dotnet-gha-patterns], [skill:dotnet-gha-build-test], [skill:dotnet-gha-publish], [skill:dotnet-gha-deploy]. CLI release pipelines -- see [skill:dotnet-cli-release-pipeline]. |
| 10 | |
| 11 | Cross-references: [skill:dotnet-add-ci] for starter CI templates, [skill:dotnet-cli-release-pipeline] for CLI-specific release automation. |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Environments with Approvals and Gates |
| 16 | |
| 17 | ### Defining Environments in YAML |
| 18 | |
| 19 | Environments are first-class Azure DevOps resources that provide deployment targeting, approval gates, and deployment history: |
| 20 | |
| 21 | ```yaml |
| 22 | stages: |
| 23 | - stage: DeployStaging |
| 24 | jobs: |
| 25 | - deployment: DeployToStaging |
| 26 | pool: |
| 27 | vmImage: 'ubuntu-latest' |
| 28 | environment: 'staging' |
| 29 | strategy: |
| 30 | runOnce: |
| 31 | deploy: |
| 32 | steps: |
| 33 | - download: current |
| 34 | artifact: app |
| 35 | - script: echo "Deploying to staging" |
| 36 | |
| 37 | - stage: DeployProduction |
| 38 | dependsOn: DeployStaging |
| 39 | jobs: |
| 40 | - deployment: DeployToProduction |
| 41 | pool: |
| 42 | vmImage: 'ubuntu-latest' |
| 43 | environment: 'production' |
| 44 | strategy: |
| 45 | runOnce: |
| 46 | deploy: |
| 47 | steps: |
| 48 | - download: current |
| 49 | artifact: app |
| 50 | - script: echo "Deploying to production" |
| 51 | ``` |
| 52 | |
| 53 | Environments are created automatically on first reference. Configure approvals and gates in Azure DevOps > Pipelines > Environments > (select environment) > Approvals and checks. |
| 54 | |
| 55 | ### Approval Checks |
| 56 | |
| 57 | | Check Type | Purpose | Configuration | |
| 58 | |-----------|---------|---------------| |
| 59 | | Approvals | Manual sign-off before deployment | Assign approver users/groups | |
| 60 | | Branch control | Restrict deployments to specific branches | Allow only `main`, `release/*` | |
| 61 | | Business hours | Deploy only during allowed time windows | Define hours and timezone | |
| 62 | | Template validation | Require pipeline to extend a specific template | Specify required template path | |
| 63 | | Invoke Azure Function | Custom validation via Azure Function | Provide function URL and key | |
| 64 | | Invoke REST API | Custom validation via HTTP endpoint | Provide URL and success criteria | |
| 65 | | Required template | Enforce pipeline structure | Specify required extends template | |
| 66 | |
| 67 | ### Configuring Approval Checks |
| 68 | |
| 69 | Approval checks are configured in the Azure DevOps UI, not in YAML. The YAML pipeline references the environment, and the checks are applied: |
| 70 | |
| 71 | ```yaml |
| 72 | # Pipeline YAML -- environment reference triggers checks |
| 73 | - deployment: DeployToProduction |
| 74 | environment: 'production' # checks configured in UI |
| 75 | strategy: |
| 76 | runOnce: |
| 77 | deploy: |
| 78 | steps: |
| 79 | - script: echo "This runs only after all checks pass" |
| 80 | ``` |
| 81 | |
| 82 | **Approval configuration (UI):** |
| 83 | - Navigate to Pipelines > Environments > production > Approvals and checks |
| 84 | - Add "Approvals" check: assign individuals or groups |
| 85 | - Set minimum number of approvers (e.g., 2 for production) |
| 86 | - Enable "allow approvers to approve their own runs" only if appropriate |
| 87 | |
| 88 | ### Business Hours Gate |
| 89 | |
| 90 | Restrict deployments to specific time windows to reduce risk: |
| 91 | |
| 92 | - Navigate to Pipelines > Environments > production > Approvals and checks |
| 93 | - Add "Business Hours" check |
| 94 | - Configure: Monday-Friday, 09:00-17:00 (team timezone) |
| 95 | - Pipelines will queue and wait until the window opens |
| 96 | |
| 97 | ### Pre-Deployment Validation with Azure Functions |
| 98 | |
| 99 | ```yaml |
| 100 | # The environment's "Invoke Azure Function" check calls: |
| 101 | # https://myvalidation.azurewebsites.net/api/pre-deploy |
| 102 | # with the |