Incremental Builds in Azure Pipelines: A Solution for Efficient DevOps | Microsoft Exam AZ-400

Use Incremental Builds in Azure Pipelines for Efficient DevOps Execution

Question

You have an existing build pipeline in Azure Pipelines.

You need to use incremental builds without purging the environment between pipeline executions.

What should you use?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C.

A

When you run a pipeline on a self-hosted agent, by default, none of the subdirectories are cleaned in between two consecutive runs. As a result, you can do incremental builds and deployments, provided that tasks are implemented to make use of that. You can override this behavior using the workspace setting on the job.

Incorrect Answers:

B: The workspace clean options are applicable only for self-hosted agents. When using Microsoft-hosted agents job are always run on a new agent.

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases

When it comes to using incremental builds in Azure Pipelines, the key is to ensure that the environment used by the pipeline is not purged between pipeline executions. This can be achieved using a variety of tools and techniques, but the two most common options are self-hosted agents and Microsoft-hosted parallel jobs.

A self-hosted agent is a dedicated machine or virtual machine that you control, which allows you to customize the environment to your specific needs. With a self-hosted agent, you can configure the pipeline to use incremental builds without purging the environment between pipeline executions. This approach is typically used when you have specialized requirements or when you need greater control over the build environment.

Microsoft-hosted parallel jobs, on the other hand, are a type of agent provided by Azure Pipelines that can be used to run builds in parallel. With this approach, you don't need to worry about managing the agent environment, as it is provided by Azure Pipelines. However, if you need to use incremental builds, you'll need to ensure that the environment is not purged between pipeline executions.

To summarize, both self-hosted agents and Microsoft-hosted parallel jobs can be used to enable incremental builds without purging the environment between pipeline executions in Azure Pipelines. The choice between these options will depend on your specific needs and requirements. If you need greater control over the build environment, a self-hosted agent may be the better choice. If you want to avoid the overhead of managing the agent environment, Microsoft-hosted parallel jobs may be the better option.