How to build a Salesforce release pipeline with Azure DevOps

How to build a Salesforce release pipeline with Azure DevOps

David Runciman on

Share with

LinkedIn
Twitter

Most Salesforce teams want to have an automated release process. But many struggle to set up a release pipeline that reliably manages continuous integration and continuous delivery (CI/CD), as generic pipeline tools don’t help to handle Salesforce’s unique characteristics.

Help is at hand with Gearset — and you can find CI/CD success using any Git hosting provider. In this post, we’ll lay out why teams might choose Azure DevOps or Azure DevOps Server, then walk through setting up a successful Salesforce DevOps process with these providers.

The benefits of version control and CI/CD

Implementing version control and CI/CD for Salesforce development and release management is now standard practice. But not long ago these development best practices were still novel to lots of teams, and most are still on a journey to full adoption.

There are many reasons to make the switch from org-to-org Salesforce deployments to Git-based development and CI/CD. The key benefits are:

  • Version control makes collaboration significantly easier, tracking who changed what, when, and why.
  • Your Git repository represents a shared source of truth for developers.
  • CI/CD accelerates the release process and shortens the development lifecycle.
  • With automated testing and validations, Salesforce deployments are more secure and reliable.

Glaziers Hall, London

DevOps Dreamin’ London 2024

Find out more

Why choose Azure DevOps as your version control system?

GitHub is the most widely used Git hosting provider, both generally and among the Salesforce community. But teams may choose Azure DevOps if they’re already using other core Microsoft products (Microsoft acquired GitHub in 2018) or if developers on the team already have experience using Azure DevOps.

Azure DevOps also offers a wide range of tools in one place. Once you’ve gathered a user story, everything from planning out work items to managing release automation in pipelines can theoretically be done in Azure DevOps.

Azure DevOps Services vs. Azure DevOps Server

Microsoft offers Azure DevOps as a cloud-based service (Azure DevOps Services) or an on-premises alternative (Azure DevOps Server). Businesses with strict security and compliance requirements are more likely to choose Azure DevOps Server, in order to keep data within their network.

Among the differences between the two offerings, the most important considerations are who has control over (and so responsibility for) scalability and data storage. Azure DevOps Server also supports SQL Server reporting services.

Can you build an Azure DevOps pipeline for Salesforce?

Azure DevOps comes with its own in-built functionality for release automation — Azure Pipelines — and it’s possible to create a CI/CD pipeline for Salesforce. As you’d expect from a robust and widely-used DevOps solution, Azure DevOps allows you to implement the branching strategy that best suits your team. Whether you want a simple branching model where each feature branch is merged back into the master branch, or you need a release branch to deploy source code on a slower cadence, Azure DevOps has you covered.

However, Salesforce is a unique platform, and generic tools just aren’t set up to handle the quirks of Salesforce deployments. So even if you go through the process of integrating the Salesforce CLI (which has replaced the Ant migration tool), and setting up an Azure Pipeline for Salesforce, you’ll find that troubleshooting releases becomes a continuous task.

How does Gearset Pipelines integrate with Azure DevOps?

Gearset integrates with both Azure DevOps and Azure DevOps Server, and provides a CI/CD pipelines solution built specifically for Salesforce. With Gearset you can:

  • Add Salesforce sandboxes directly to the pipeline
  • Automatically create pull requests to adjacent environments
  • Effortlessly sync all environments across the pipeline
  • Manage long-term projects alongside BAU development
  • See way fewer conflicts due to semantic merges
  • Automatically fix common deployment issues
  • Tightly integrate with Azure DevOps including Azure Work Items
  • Enjoy an intuitive UI that serves both devs and admins

Let’s take a look at building a Salesforce CI/CD pipeline with Azure DevOps. To follow along, get started with Gearset’s free 30-day trial:

How to connect Azure DevOps to Gearset

Before we can create our Salesforce DevOps pipeline, we need to connect Azure DevOps to Gearset. First, open Azure DevOps, and click Organization settings in the bottom-left corner.

Open up Organization settings in Azure DevOps

Select Policies from the left-hand menu, and make sure that Third-party application access via OAuth is toggled to On.

Switch on 3rd-party application access via OAuth

Now head to Gearset and select Source control and services, at the bottom of the menu on the left-hand side of the app. Select Connect to Azure DevOps, and click Accept to authorize the connection.

Connect to Azure DevOps from Gearset

Build your Salesforce CI/CD pipeline

1. Create a new pipeline

Now we’re ready to create our new pipeline. Select Continuous integration from the left-hand menu. Choose Pipelines in the top-right corner, then click Create pipeline. Fill out the modal with your preferences (note that Azure work items can be selected on the second tab), then click Save.

Create your CI/CD pipeline in Gearset

Click Add webhook, allowing Gearset to stay synced with your Git repository in Azure DevOps. Then click Finished.

Set up a webhook between Azure DevOps and Gearset

2. Add your pipeline environments

Each stage of your pipeline represents an environment and automation job. To begin adding environments, click Create environment, then Create new environment/job, and follow Gearset’s CI job wizard to configure your first job. To add more environments, click + Add in the top-right corner, and select Add static environment or Add developer sandbox.

3. Connect up your pipeline

With your environments all added, click Edit environments in the top-right corner. Drag and drop your environments into place, then drag and drop the connectors to link up your pipeline. Once you’re done, press Save changes.

Set up a webhook between Azure DevOps and Gearset

Solve Salesforce CI/CD for good

Implementing release automation is only valuable if it achieves continuous delivery. So to create a successful CI/CD pipeline with Azure DevOps, you’ll need Gearset to handle Salesforce deployments repeatably and reliably. Get in touch to arrange a tailored demo of our DevOps platform, and of course you can always start a free trial whenever you’re ready.

If you’d like more resources, you can explore Gearset’s pipelines solution, and download our ebook, CI/CD for Salesforce:

Ready to get started with Gearset?