July 14, 2017 | Charlie Turano
In this blog post series I am going to setup a Sitecore instance on Azure, with the initial deployment including some custom built modules as add-ons to the setup. Then I'll go through enabling blue/green deployments on the CD instance, allowing us to utilize an Azure staging slot in order to preview our new release before it goes live, and then swap that slot out with the current live website. This will give us zero downtime deployments, so the front end users of the site will not be affected.
Blue/Green Deployments have been mentioned in the past by various Sitecore MVPs, like Rob Habraken and Bas Lijten. In this series of posts, we will dive deeper into the setup for custom modules with the new Sitecore Azure Toolkit (v1.1), new Sitecore ARM templates (for Sitecore 8.2 Update3+) and some PowerShell scripts that we've created to make this a devops engineer's dream!
The Tools
The list of tools was chosen to keep the environment as simple as possible. These tools are standard in most Sitecore development environments
Set up 'Launch Sitecore' Build
The first step is to actually build Launch Sitecore on a build server. We want to build an MSDeploy package for code and a Sitecore Update Package for the Launch Sitecore items.
Creating the projects
A local development environment for Launch Sitecore needs to be built. The files in the the VS solution were added to a VSO project and two TDS Classic projects were added to the solution - one for the Core database and one for Master.
The items in the Launch Sitecore package were added to the TDS projects and everything was committed to the VSO source code repository. A very similar solution structure for this can be found on Sean Holmesby's LaunchSitecoreTDS repository. (Note that Sean's repository actually has 4 TDS projects, where the Base templates and Media items are separated into their own TDS Classic projects in order to demonstrate other TDS Classic features. This also means the assets/img folder is not part of the web project, so ensure you add that if you're using this example solution to test this out).
For our demo, the LaunchSitecore.Master project was setup to bundle the LaunchSitecore.Core project into a single update package. The Release configuration was setup to generate only an item package at build time.
Creating the build
The VS build was easy to setup with minimal customizations. The first step was to choose an Azure Web App build:
Next, the build was customized by disabling the azure deploy and test tasks:
The Azure Deploy task was disabled since we don't want to deploy directly to Azure and the Test task was disabled because we don't have any tests at this time.
Since the build is creating Sitecore Update Packages, these packages need to be added to the build artifacts. This is done with the "Copy Packages to Artifacts" copy task. The configuration for this is:
The last step is to run the build. Now we have a working solution, with code and items being output as the build artifacts from the VSO build, which we can and will use later in our deployment.