AZ-400 Question 132
Select 2Your organization needs to set up a scalable infrastructure for self-hosted Azure DevOps agents or GitHub runners to handle roughly 50 builds a day, which can occasionally spike to 200. You want to minimize costs by shutting down idle agents, ensure connectivity from your private network to the cloud build service, and support your specialized toolset, which includes licensed Windows tools. Which two approaches should you consider to effectively meet these requirements?
- A
Set up on-premises virtual machines that remain online, installing all tooling manually, and avoid any auto-scaling or re-imaging strategy to keep consistency
- B
Leverage an Azure Virtual Machine Scale Set to deploy Windows-based agents that automatically scale and shut down during non-peak times
- C
Use containerized Linux agents on ephemeral Azure Kubernetes Service (AKS) pods, with automatic provisioning and deprovisioning, connecting through self-hosted runners
- D
Rely exclusively on GitHub-hosted or Azure DevOps Microsoft-hosted agents, as they provide unlimited build minutes for all scenarios
Show answer and explanation
Correct answers: B, C
Explanation
When designing a self-hosted agent or runner infrastructure, it is critical to balance cost, scalability, licensing, and network connectivity. Leveraging auto-scaling solutions like Azure Virtual Machine Scale Sets or container-based ephemeral agents in Azure Kubernetes Service ensures agents are available on-demand, reducing overall cost by shutting them down when idle. For more details on setting up scalable agents, refer to official Azure DevOps documentation on self-hosted agents (https://learn.microsoft.com/azure/devops/pipelines/agents/agents) and GitHub documentation on self-hosted runners (https://docs.github.com/en/actions/hosting-your-own-runners).
- A. Incorrect.
Option 1: Incorrect. Keeping on-premises VMs online at all times fails to minimize costs. Without auto-scaling or re-imaging, you spend on constant hardware and infrastructure, and you risk outdated tooling unless manually maintained. This approach does not align well with an environment needing elasticity for spikes.
- B. Correct.
Option 2: Correct. Azure Virtual Machine Scale Sets allow you to automate scaling up and down Windows-based agents, which can be stopped when idle to reduce costs. Moreover, deploying Windows agents accommodates your specialized licensing requirements while maintaining up-to-date images more easily.
- C. Correct.
Option 3: Correct. Containerized Linux agents within an AKS cluster let you provision ephemeral pods only when builds run. This approach reduces operating costs (no need to keep idle nodes online) and simplifies tooling updates since containers can be rebuilt with necessary tools. A secure connection, such as Azure Private Link or a VPN, can facilitate private network to cloud integration.
- D. Incorrect.
Option 4: Incorrect. GitHub-hosted or Microsoft-hosted agents do not inherently provide unlimited build minutes for all scenarios, and they may not support specialized licensed software installations. Hosted agents also have default time and resource limits that may not meet heavy or highly specialized workloads.