icon SQL Azure Scale-Out
Created by Orckestra

SQL Azure Scale-Out Setup Guide

Configuring Media File Synchronization

To configure media files synchronization:

  1. Create a container in Azure blob storage
  2. Get the connection string to the blob storage
  3. Specify the blob connection string in Web.config
  4. Configure the media file provider in Composite.config

Creating a container in Azure blob storage

For synchronization, you first need to create a container in Azure blob storage. This is where the scaled-out C1 CMS website will store its media files (instead of the standard place at ~/App_Data/Media):

  1. Log into the Microsoft Azure management portal.
  2. Choose an existing blob storage account or, if needed, create a new one.
  3. Add a storage container (for example, "c1mediafiles") where synchronized media files will be stored.
  4. Make sure the container has the “Private” access.

Figure 4: Creating a new container on Microsoft Azure

Getting the blob connection string

In the following steps you’ll configure your website to synchronize media file. For this, you need to know the connection string to the blob storage where you’ve created a dedicated container (as described in the step above).

  1. In the Microsoft Azure management portal, select the blob storage with the container.
  2. Click “Manage Keys”.
  3. Make a note of, or copy, the storage account name and storage access key.

Figure 5: Getting the values for the blob connection string on Microsoft Azure

Specifying the blob connection string in Web.config

Now you need to specify the blob connection string in Web.config:

  1. Edit ~/Web.config.
  2. Add the blob storage connection string with some name, for example, "c1media":
<configuration>
  <!-- skipped -->
  <connectionStrings>
    <!-- skipped -->
    <add name="c1media"
connectionString="DefaultEndpointsProtocol=https;AccountName=[AccountName];AccountKey=[AccessKey]" />
  </connectionStrings>
</configuration>

Listing 1: Specifying the blob connection string in Web.config

where:

  • [AccountName] is the name of the blob storage account
  • [AccessKey] is the access key to the blob storage account

Configuring the media file provider in Composite.config

Finally, you need to replace the default media provider in Composite.config with the Azure media provider using the name of the blob connection string you've added in Web.config and the name of container you’ve created in the blob storage:

 
  1. Edit ~/App_Data/Composite/Composite.config.
  2. Search for name="MediaFileDataProvider" to locate the default media provider.
  3. Comment out this media file provider.
  4. Add a reference to AzureMediaProvider as shown below:
<configuration>
  <!-- skipped -->
  <Composite.Data.Plugins.DataProviderConfiguration defaultDynamicTypeDataProviderName="…">
    <DataProviderPlugins>
      <!-- skipped -->
      <!-- <add rootDirectory="~/App_Data/Media" 
        storeId="MediaArchive"
        storeDescription="Media Archive Files"
        storeTitle="Media Archive" type="Composite.Plugins.Data.DataProviders.MediaFileProvider.MediaFileProvider, Composite, Version=1.0.3037.13741, Culture=neutral, PublicKeyToken=null"
        name="MediaFileDataProvider" /> -->       
      <add rootDirectory="~/App_Data/Media"
        storeId="MediaArchive"
        storeDescription="Media Archive Files"
        storeTitle="Media Archive" type="Composite.Azure.ScaleOut.AzureMediaProvider.AzureMediaDataProvider, Composite.Azure.ScaleOut.AzureMediaProvider"
        name="MediaFileDataProvider"
        blobStorageConnectionStringName="[BlobConnectionStringName]"
        blobContainer="[BlobContainerName]" />
    </DataProviderPlugins>
</configuration>

Listing 2: Configuring media file provider in Composite.config

where:

  • [BlobConnectionStringName] is the name of the blob connection string added in Web.config (see above).
  • [BlobContainerName] is the name of the container created in the blob storage (see above).

For example:

<add … 
  blobStorageConnectionStringName="c1media"
  blobContainer="c1mediafiles" />

Listing 3: Example of the media file provider configured in Composite.config

Back to top
Part of subscriptions:

Have a question?

Phone: +45 39 15 76 00
Email: Write us
4:48 AM
(Local time at HQ)