Switch to Ubuntu Agent Pools in Azure DevOps for faster SPFx build times

If you have taken the time to set up SPFx builds (CI / CD) in Azure DevOps pipelines, you should take a look at which agent pool you are using. I had always heard that Ubuntu was significantly faster and the rumors are in fact true. I found that Ubuntu cut my build times in half. Take a look at the screenshot below.

In my example, build times went from 8m 34s to 4m 23s. That’s a lot faster. If that still seems a bit high, we build two SPFx projects with this job.

Switching your hosted agent pool

If you have configured your pipeline using a YAML file, you can change to a Ubuntu agent pool pretty easily. Just change the vmImage parameter to ‘ubuntu-latest’. If you don’t have a pool or vmImage line in your YAML file, you may have a queue line instead. Remove it and replace with the following snippet:

pool:
  vmImage: 'ubuntu-latest'

You can view all of the options available for hosted agent pools at this link. If you are doing automated build with Azure DevOps, have you already made this change? If you do make the change, try it out and let me know if you get a performance gain.

Published by coreyroth

Corey Roth is the Vice President of Product Strategy at AvePoint where he helps build the tyGraph product line for data analytics in Microsoft 365. Corey is an thirteen-time recipient of the Microsoft MVP award in Office Apps and Services. Corey has always focused on rapid adoption of new Microsoft technologies including Microsoft 365 and Azure.

Leave a comment