Walkthrough: Configuring the Message Bus role to use Azure Service Bus

Abstract

How to configure the Sitecore Message Bus role to use Azure Service Bus.

Before you can configure the Message Bus role to use Azure Service Bus, you must provision Azure Service Bus and get the primary connection string. See the Microsoft Create a Service Bus namespace using the Azure portal documentation for details.

This walkthrough describes how to:

You must change the messaging connection string from Microsoft SQL Server to Azure Service Bus on all roles that references the Message Bus role.

To change the messaging connection string:

  1. In the <wwwroot>\App_Config\ folder, open the ConnectionStrings.config file.

  2. Locate the add name="messaging" property and change the connectionString attribute to the Azure Service Bus connection string.

    <add
      name="messaging"
      connectionString="<your Azure Service Bus connection string>" />
  3. Save the ConnectionStrings.config file.

  4. Repeat the procedure for all relevant roles.

You must change the messagingTransport key from Microsoft SQL Server to Azure Message Bus on all Core roles that references the Message Bus role.

To change the messagingTransport key:

  1. In the <wwwroot>\ folder, open the Web.config file.

  2. Locate the add key="messagingTransport:define property and change the value attribute from SQL to AzureServiceBus.

    <add key="messagingTransport:define" value="AzureServiceBus" />
  3. Save the Web.config file.

  4. Repeat the procedure for all relevant roles.

You must switch all messaging configuration files from Microsoft SQL Server to Azure on all XP service roles that references the Message Bus role. The configuration files are in the following folders:

  • <wwwroot>\App_Data\Config\Sitecore\ and its subfolders

  • <wwwroot>\App_Data\jobs\continuous\*\App_Data\Config\sitecore\ and its subfolders

To switch messaging configuration files:

  1. Add the .disabled extension to all files matching *Messaging.SqlServer.xml.

    *Messaging.SqlServer.xml -> *Messaging.SqlServer.xml.disabled
  2. Remove the .disabled extension from all files matching *Messaging.Azure.xml.disabled.

    *Messaging.Azure.xml.disabled -> *Messaging.Azure.xml
  3. Repeat the procedure for all relevant roles.