Area: Optimizely Commerce
Applies to versions: 14 and higher
Other versions:

Deploying to Azure Web Apps

Recommended reading 

This topic describes how to set up an Optimizely Commerce site to run on Azure Web Sites. In this scenario, a Commerce version 14 site is installed, and you can apply most steps through Visual Studio and NuGet package installations. See Azure Web Apps for information about Azure.


Setting up a cloud website

Like an Optimizely CMS website on Azure, you can run the Commerce website on an Azure Web Site environment with multiple instances. The website instances share the same Azure SQL database, and the BLOB storage in Azure is used to store the file binary data. Load balancing is applied, and the Azure Service Bus manages events among the CMS websites.

Follow these steps to create an Optimizely Commerce website in an Azure Apps environment.

  1. Create a site.
    1. Create a basic EPiServer CMS site.
    2. Install the latest version of the EPiServer.Commerce NuGet package.
    3. Install the EPiServer.Commerce.Azure NuGet package to the project.
    4. Add the cloud license to the website. This is used and activated later, when deploying the website to Azure.
  2. Create Azure resources. See Creating Azure resources in Deploying to Azure Web Apps.
  3. Update configurations. See Updating configuration in Deploying to Azure Web Apps.
  4. Deploy the Optimizely site. See Deploying in Deploying to Azure Web Apps.
    1. Because Commerce has two databases, add two scripts in the Add SQL Script step:
      • EPiServer.Cms.Core.sql under [SolutionDir]\packages\EPServer.CMS.Core.x\tools\ to EPiServerDB
      • EPiServer.Commerce.sql under [SolutionDir]\packages\EPiServer.Commerce.Core.x\tools\ to EcfSqlConnection
    2. When the database is successfully created, run the Update-EPiDatabase command in the Package Manager Console.

  5. Change the site URL. See the Changing the site URL section in Deploying to Azure Web Apps.
  6. Build the site index.
    1. Build the content index. See the Search in Azure section in Deploying to Azure Web Apps.
    2. Rebuild the catalog index.
      1. Access Commerce Admin.
      2. Go to Administration > Search Index.
      3. Click Rebuild Index. The catalog index is restored in your storage.

        Note: If you are using LuceneAzureSearchProvider as the default search provider, complete the following additional steps.

      4. Open appsettings.json, in the Commerce SearchOptions section, set the DefaultSearchProvider key to LuceneAzureSearchProvider.
      5. Set your connectionStringName and storage keys pointing to your Azure storage connection string and index storage folder. Note that the Azure storage connectionString must already exist in your ConnectionString section of appsettings.json.

        The following example shows search config in appsettings.json, defined for using Lucene on Azure.

              "SearchOptions": {
                "DefaultSearchProvider": "LuceneAzureSearchProvider",
                "IndexerBasePath": "indexcontainer",
                "IndexerConnectionString": "EPiServerAzureBlobs",
                "SearchProviders": [
                    "Name": "LuceneAzureSearchProvider",
                    "Type": "Mediachase.Search.Providers.Lucene.LuceneAzureSearchProvider, Mediachase.Search.LuceneSearchProvider",
                    "Parameters": {
                      "queryBuilderType": "Mediachase.Search.Providers.Lucene.LuceneSearchQueryBuilder, Mediachase.Search.LuceneSearchProvider",
                      "storage": "indexcontainer",
                      "simulateFaceting": "true",
        			  "connectionStringName": "EPiServerAzureBlobs"
                "Indexers": [
                    "Name": "catalog",
                    "Type": "Mediachase.Search.Extensions.Indexers.CatalogIndexBuilder, Mediachase.Search.Extensions"
  7.  To improve the user interface experience, enable WebSocket support.

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Sep 28, 2021

Recommended reading