Designing a Build Pipeline with Cost-Effective Compute Type for Azure Pipelines

Minimizing Costs with a Self-Hosted Agent in Azure Pipelines

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?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B

If your pipelines are in Azure Pipelines, then you've got a convenient option to run your jobs using a Microsoft-hosted agent. With Microsoft-hosted agents, maintenance and upgrades are taken care of for you. Each time you run a pipeline, you get a fresh virtual machine. The virtual machine is discarded after one use.

Microsoft-hosted agents can run jobs directly on the VM or in a container.

Note: You can try a Microsoft-hosted agent for no charge.

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted

Given the requirement to have a self-hosted agent for a build pipeline in Azure Pipelines that runs once daily and takes 30 minutes to complete, the recommended compute type would be an Azure virtual machine scale set (Option C).

Here's why:

Option A, an Azure Kubernetes Service (AKS) cluster, would not be the most cost-effective option as it is designed to orchestrate and manage containerized applications at scale. It involves a significant amount of setup and configuration, which is not necessary for this use case.

Option B, Azure Container Instances, provides a quick and easy way to run containerized applications in the cloud without worrying about infrastructure management. However, it may not be the most cost-effective option in the long run, as it charges by the second, and the pipeline would run for 30 minutes every day.

Option C, an Azure virtual machine scale set, is the best option as it allows for the creation of multiple identical VMs that can scale automatically based on workload demand. It provides a cost-effective solution as VMs can be turned off when not in use, and the number of VMs can be scaled down during periods of low demand. The use of virtual machine scale sets also provides flexibility in terms of selecting the appropriate VM size for the agent and operating system image based on workload requirements.

Option D, Azure virtual machines, is also a viable option but may require more manual configuration and management compared to using virtual machine scale sets. However, it still provides flexibility in terms of selecting the appropriate VM size and operating system image for the agent.

In summary, the most cost-effective and efficient compute type for the given requirements would be an Azure virtual machine scale set.