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:

  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 Engineering at UnlimitedViz where he helps build the tyGraph product line for data analytics in Microsoft 365. Corey is an eleven-time recipient of the Microsoft MVP award in Office Apps and Services. Corey helps ISVs develop mobile-first applications for Office 365 using technologies such as Ionic Framework and Azure. Corey has always focused on rapid adoption of new Microsoft technologies including Office 365 and Azure. In his spare time, Corey works with his wife, Jennifer, on their product BrewZap, a mobile app platform for breweries.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: