Sitecore Azure with SCpbCS

Current version: 8.2

Sitecore Azure is a Sitecore module available from the Sitecore Downloads page that allows you to deploy and host your Sitecore solution from within an Azure Cloud Service. Since Commerce Server supports Azure SQL and Azure Cloud Services this means you can also deploy SCpbCS sites using Sitecore Azure.

The setup steps are as follows:

  1. Set up your SCpbCS site as you would usually, and make sure you have published to Web.

  2. Set up Commerce Server admin and resource databases for your site in Azure SQL by following the steps in the Using Azure SQL Database with Commerce Server section. This will change your local Commerce Server instance to point to the new Azure SQL databases, so you will need to swap this back to run against your local databases by changing the Administration Database connection string in the Commerce Server Manager

  3. Install and Configure Sitecore Azure 8.1. For more information, see the Install Sitecore Azure topic. 

  4. Select your deployment hosting center and deployment type, such as Add Editing Farm and Add Delivery Farm, but do not click Start Deployment in the New Deployment dialog. Instead, click on the More Options link in the bottom left of the dialog.

  5. This will take you to the Staging node of your deployment, which is located at a path similar to /sitecore/system/Modules/Azure/DevTeam-Development/East US/Delivery01/Role01/Staging.

  6. Updated the fields in the Staging node so that the deployment can continue.

  7. Inside the Service Definition field, at the entry below. inside of the field xml at //ServiceDefinition/WebRole[@name=’SitecoreWebRole’]/LocalResources/<LocalStorage name="CommerceLogs" cleanOnRoleRecycle="true" sizeInMB="100" />

  8. Inside the Service Configuration set //ServiceConfiguration/@osFamily to “4” ,which is Windows 2012 R2.

  9. Inside the Diagnostics configuration field, at the entry below, inside of the field xml at //DiagnosticsConfiguration/PublicConfig/WadCfg/DiagnosticMonitorConfiguration/Directories/DataSources/

    <DirectoryConfiguration containerName="wad-commercelogs">

    <LocalResource name="CommerceLogs" relativePath="."/>

    </DirectoryConfiguration>

  10. Inside the Connection Strings Patch field, add a new connection string entry named commerce_admin that points to your MSCS_admin database in Azure SQL. An example of what your entry should look like:

    <add name="commerce_admin" connectionString="Persist Security Info=False; Password=********;User ID=sitecore;Initial Catalog=MSCS_Admin;Data Source=********.database.windows.net" />

  11. Sitecore Azure uses the same Startup Task framework used in the Deploying Commerce Server on an Azure Cloud Service. This means the scripts for installing and configuring Commerce Server can be used with Sitecore Azure.

  12. Create a CommerceServer folder under \Website\App_Data\AzureOverrideFiles\bin\. In this folder add the Commerce Server installer, profile keys, and setup script.

  13. Inside the Startup.cmd, add your call to set up a Scheduled Task that will install Commerce Server.

Once you have followed all previous steps, you are ready to deploy your SCpbCS site to Azure. Return to the Sitecore Azure New Deployment dialog and click the Start Deployment button. Sitecore Azure will now create the Sitecore databases in Azure SQL, create the requested Cloud Service(s), bundle up all of the Sitecore files on disk and deploy them on the Cloud Service(s), and then run the startup task, which will set up Commerce Server. This entire process can take upwards of 30 minutes depending on your internet connection and the size of the Cloud Service and Azure SQL databases you have requested.

Even if the Cloud Services say they are ready and available, that does not mean that Commerce Server has finished the installation and configuration process. Because the Commerce Server installation and configuration task does not start until after the Cloud Service is ready, it can take a few more minutes for Commerce Server to be installed and ready. If Sitecore Azure is finished deploying and your site is not operational, it could be because of this reason. You can also use Windows Azure Diagnostics to monitor the install by using the event logs and commerce logs to see what stage of the install Commerce Server is at.

One thing to be aware of is that you will not be able to start a full search index on the Cloud Service from your local Sitecore instance if you are not sharing a Core database. To enable the remote indexing, first you will need to set the core connection string in the \Website\App_Config\ConnectionStrings.config to be that of the Core database used by the Cloud Services. Second, you will need to patch in the remoteRebuild strategy to the indexes you would like to rebuild remotely, which should at least be sitecore_web_index. You should patch this in your local Sitecore site before you deploy to Azure, so that it gets copied along with everything else. The following is the reference you will need to patch in:

RequestResponse

<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/remoteRebuild" />

The next time you start a full re-index from the Developer ribbon, Sitecore will trigger the remote rebuild strategy after it has finished indexing locally, and the Cloud Service instances will then begin to index.

Do you have some feedback for us?

If you have suggestions for improving this article,