AZ-400 Question 128
Single answerYour organization stores its source code in GitHub and wants to leverage existing self-hosted build agents managed in Azure DevOps. They require manual approvals for deploying to a production environment running on Azure App Service. Which deployment automation solution would allow them to reuse existing agents, maintain GitHub as the source of truth, and implement environment-based approvals directly in a YAML pipeline?
- A
Use GitHub Actions with a GitHub environment for production approvals
- B
Use Azure Pipelines with a multi-stage YAML pipeline linked to the GitHub repository
- C
Migrate code to Azure DevOps Repos and configure a classic pipeline with manual approvals
- D
Use GitHub Actions and trigger a third-party approval system via webhooks
Show answer and explanation
Correct answer: B
Explanation
Azure Pipelines supports GitHub repositories as a source, allowing teams to leverage existing self-hosted build agents without moving their code base. Multi-stage YAML pipelines in Azure Pipelines provide built-in functionality for environment-based approvals and deployment gates to production. For more information, see the Microsoft documentation on 'Build, test, and deploy .NET applications � Azure Pipelines' (https://docs.microsoft.com/azure/devops/pipelines/ecosystems/dotnet-core) and 'Approvals and checks in Azure Pipelines' (https://docs.microsoft.com/azure/devops/pipelines/process/approvals).
- A. Incorrect.
Incorrect. While GitHub Actions does support environment protection rules for approvals, reusing existing Azure DevOps self-hosted agents directly is simpler via Azure Pipelines. You would need additional steps to connect GitHub Actions to your existing self-hosted agents and replicate the same control over environment-based approvals.
- B. Correct.
Correct. Azure Pipelines natively supports GitHub as a source repository and can run on self-hosted Azure DevOps agents. Multi-stage YAML pipelines allow for environment-based approvals (pre-deployment and post-deployment approvals), making it easy to manage production releases without moving your code out of GitHub.
- C. Incorrect.
Incorrect. While migrating code to Azure Repos would allow usage of Azure Pipelines, the scenario states the organization wants to retain GitHub as the source of truth. Classic pipelines also offer approvals, but multi-stage YAML pipelines are the recommended modern approach for automation in Azure DevOps.
- D. Incorrect.
Incorrect. While possible, using a third-party approval system via webhooks adds complexity rather than integrating directly with Azure Pipelines. It also doesn�t reuse your self-hosted build agents as effectively as a native Azure DevOps pipeline would.