Skip to Content

Microsoft AZ-400: What is the most cost-effective compute type for a self-hosted Azure Pipelines agent?

When designing an Azure Pipelines build that requires a self-hosted agent, learn how to minimize costs by choosing the right compute type between AKS, Container Instances, VM scale sets and VMs.

Table of Contents

Question

You are designing a build pipeline in Azure Pipelines.

The pipeline requires a self-hosted agent. The build pipeline will run once daily and will take 30 minutes to complete.

You need to recommend a compute type for the agent. The solution must minimize costs.

What should you recommend?

A. an Azure Kubernetes Service (AKS) cluster
B. Azure Container Instances
C. an Azure virtual machine scale set
D. Azure virtual machines

Answer

To minimize costs for a self-hosted Azure Pipelines agent that runs a 30-minute daily build, I recommend using an Azure virtual machine (Option D).

Explanation

Here’s why:

  • Azure Kubernetes Service (AKS) clusters are designed for running containerized workloads that require orchestration, scaling, and high availability. They are overkill and not cost-effective for a single daily build job.
  • Azure Container Instances provide a simple way to run containers without managing underlying infrastructure. However, they are billed per second of execution time, which would be wasteful for a job that only runs once per day.
  • An Azure virtual machine scale set allows automatically scaling out VMs based on demand. But since this build pipeline has a steady, infrequent cadence, dynamically scaling VMs are unnecessary and would add management overhead.
  • An Azure virtual machine is the simplest, most straightforward option. You can choose the VM size that provides adequate specs for your build tasks. By deallocating the VM when not in use, you only pay for storage costs during idle periods, and compute costs for the 30 minutes per day it’s actually running.

So in summary, for a self-hosted agent running one short build per day, provisioning a single Azure VM that you deallocate when not needed will give you full control while minimizing your costs compared to other Azure compute options.

Microsoft AZ-400 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft AZ-400 exam and earn Microsoft AZ-400 certification.