Setting Up Ektron in the Azure Cloud

This document contains step-by-step instructions to set up and run Ektron applications in Windows Azure Cloud.

Ektron in the Azure Cloud has the following benefits
  • Simplifies the process of creating, deploying and managing ASP.NET Web sites in Azure
  • Provisions new sites quickly
  • Connects your On Premises infrastructure with the cloud
  • Manages content changes easily through a true hybrid cloud deployment
  • Unlimited scalability
  • Reduces time-to-scale
  • Significant cost reductions
Before you install to the cloud

Before You Install to the Cloud

Before you install or use Ektron in the Windows Azure Cloud, Ektron Administrators and Developers should read this document. First build the system for On Premises use and then follow the instructions in this documentation to get it running in cloud. You also should understand the following:

  • You must have Windows Azure SDK 1.7 (June 2012) on a development machine or on-premise server.
  • You should have a valid subscription from the Windows Azure portal.
  • Use the Azure deployment wizard for proper configurations.
  • Run the security configurator and generate certificates before you deploy Ektron to the Azure cloud.
  • You must start instances before running database or template synchronizations.
  • Ektron eSync deploys the data to SQL databases and file resources to BLOB storage.
  • Connecting an SQL database through enterprise manager requires SQL Server 2008R2 for SQL Management studio (or greater).
  • You can use both Web site and Application model as of this printing.
  • SQL database licensing limits the maximum database size.
  • The following are not supported as of this printing:
    • Active directory
    • eCommerce
    • multi-site
    • Web Alert
    • Notification Services
    • Diagnostic Services
Configuring the portal

Configuring the Portal

1. Sign up

Sign Up

Windows Azure hosting requires Windows Live-ID sign on using your email address and subscription, which can be purchased from Microsoft at http://www.windowsazure.com. When you have the subscription, go to https://manage.windowsazure.com and log in using your Live-ID and password.

2. Install a cloud server certificate

Install a Cloud Server Certificate

  1. From the home page of https://manage.windowsazure.com, click Hosted Services, Storage Accounts & CDN.
  2. Click the Manage Certificates folder.
  3. Click Add Certificate. The Add New Management Certificate dialog box appears.

  4. Choose a subscription from the drop-down list.
  5. Click Browse and choose EktronCloud.cer from the following path:
    • 64-bit system: 
      ~\Program Files (x86)\Ektron\CMS400v8x\AzureCerts
    • 32-bit system: 
      ~\Program Files\Ektron\CMS400v8x\AzureCerts
  6. Click OK.
3. Create a hosting service

Create a Hosting Service

NOTE: This is an optional step. If you do not create the hosted service, Ektron will create it for you.

  1. From the home page of https://manage.windowsazure.com, click New Hosted Service. The Create a New Hosted Service dialog box appears.
     

  2. Enter the name of your service.
  3. Enter the URL prefix for your service. If your host name is mydomain then your URL will be mydomain.cloudapp.net, which is used to configure the CNAME rec and location.
  4. Choose a region.
  5. Click Do not deploy.
  6. Click OK.
4. Create a storage account

Create a Storage Account

You need a storage account to store site resources in the cloud storage service, and to store and synchronize assets, private assets, uploaded files, uploaded images and asset library. To create a storage account:

  1. From the home page of https://manage.windowsazure.com, click New Storage Account. The Create a New Hosted Service dialog box appears.
     

  2. Enter your URL.
  3. Choose a region.
  4. Click OK.
5. Create a CDN endpoint

Create a CDN Endpoint

Content Delivery Network (CDN) serves files faster from distributed servers. For better performance, Ektron recommends that you define the endpoint for your storage accounts. To create a CDN endpoint:

  1. From the home page of https://manage.windowsazure.com, click Hosted Services, Storage Accounts & CDN.
  2. Click on CDN in the left navigation panel.
  3. Click New Endpoint. The Create a New CDN Endpoint dialog box appears.
     

  4. Choose the hosted service from the drop-down menu.
  5. Optionally check Enable CDN, HTTPS, and Query String.
  6. Click OK.
6. Create a database server

Create a Database Server

  1. From the home page of https://manage.windowsazure.com, click Database.
  2. Click the subscription in which you want to create the server.
  3. Click Create in the Server button bar. The Create Server dialog box appears.
  4. Select a region where the SQL database server will be hosted and click Next.
  5. Specify the Administrator Login and Password to use with the SQL server and click Next.
  6. Click Add. The Add Firewall Rule dialog box appears. (See Create a Firewall Rule in an SQL Database.)
  7. Check the box next to Allow other Windows Azure services to access this server.
  8. Click Finish.
7. Create a firewall rule in an SQL database

Create a Firewall Rule in an SQL Database

To set up a firewall rule in an SQL database, including the IP Address from your pre-production and development machines:

  1. From the home page of https://manage.windowsazure.com, click Database.
  2. Choose Subscriptions > Ektron Azure Development > yourServerName.
  3. Click Firewall Rules to open it.
  4. Click Add. The Add Firewall Rule dialog box appears.
     

  5. Specify the rule name, and the starting and ending IP range.
  6. Click OK.
8. Create a service namespace

Create a Service Namespace

You need to create a service namespace for service bus and caching services. Azure does not support sticky sessions, so you need to use the caching service for your caching for more than one instance or load balancing.

Use the service bus to connect to On Premises services for search or any custom-driven services, because there are no search servers in the cloud. Ektron's hybrid deployment model lets you make changes to and run searches on On Premises servers. You can use eSync to deploy the change data to the cloud.

To create a service namespace:

  1. From the home page of https://manage.windowsazure.com, click Service Bus, Access Control & Caching.
  2. Choose Services > Caching.
  3. Click New. The Create a new Service Namespace dialog box appears.
     

  4. Check Service Bus and Cache.
  5. Enter a name (such as myappfabricservice) in the Namespace field.
  6. Select a region from the Country/Region drop-down menu.
  7. Select a subscription from the Subscription drop-down menu.
  8. Select the cache size that your application needs from the Cache - Cache Size Quota drop-down menu.
  9. Click Create Namespace.
Creating and deploying a site package to the cloud

Creating and Deploying a Site Package to the Cloud

1. Download and install EktronCloudSetup.exe

Download and Install EktronCloudSetup.exe

Install EktronCloudSetup.exe.

After you download and install EktronCloudSetup.exe, the Cloud Manager is added to the Workarea Settings.

2. Create the initial deployment

Create the Initial Deployment

IMPORTANT: You must first install EktronCloudSetup.exe. See Download and Install EktronCloudSetup.exe. You must also upload the certificate to the portal and configure it to the cloud service before following this procedure.

  1. In the Workarea, choose Settings > Configuration > Cloud Manager.
  2. Choose Create Hosted Service. A wizard appears (Step 1 of 4: Hosted Service and Storage). Fields with a red asterisk (*) are required.
     

    1. Subscription ID—You can get this from https://manage.windowsazure.com.
      1. Click on Hosted Services, Storage Accounts & CDN.
      2. Click the Storage Account folder.
      3. Copy and paste the Subscription ID from the Properties panel.
    2. Hosted Service Name—Specify the name of the server.
    3. Hosted Service Location—Select the location that is nearest to your hosted service.
    4. Deployment Environment—Choose either Production (Friendly URL) or Staging (GUID-based URL).
    5. Web Virtual Machine Size—Choose Small, Medium (default), Large, or Extra Large for your Web virtual machine. This is your website and you can have as many instances as you want. Each option is described at How to Configure Virtual Machine Sizes (http://msdn.microsoft.com/en-us/library/windowsazure/ee814754.aspx).
    6. Web Instances—Choose the number of servers on which the load will be balanced.
      • 1—no load balancing.
      • more than 1—load balance equally among the number of servers you choose.
    7. Worker Virtual Machine Size—Choose Small (default), Medium, Large, or Extra Large for your windows service virtual machine. You can have only 1 instance of this virtual machine.
  3. Click Next. Step 2 of 4: the Hosted Service Storage and Security dialog box appears. Fields with a red asterisk (*) are required.

    1. Storage Account—Specify the name of the storage account that you created in Create a Storage Account.
    2. CDN—Specify the URL with the Content Delivery Network (CDN). You can get this from https://manage.windowsazure.com.
      1. Click Hosted Services, Storage Accounts and CDN.
      2. Click the CDN folder.
      3. Click on the server name with a CDN endpoint type.
      4. Copy and paste the Default HTTP Endpoint from the Properties panel. Be sure to start the URL with http:// and place a trailing slash (/) on the end.
    3. License Key—Optionally, specify the license key.
    4. Security Protocol Setting—Choose HTTP or HTTPS.
    5. Security Certificate Thumbprint—When you select HTTPS, you must also specify the hexadecimal string that contains the SHA-1 hash of the certificate.
    6. Caching—By default, Ektron uses the inmemory caching. However, Ektron uses the AppFabric provider to configure the session state to use inproc.
      1. Go to the portal.
      2. Click Service Bus, Access Control & Caching.
      3. Go to Services > Caching.
      4. Click on an active namespace.
      5. Click View Client Configuration.
      6. Copy the XML and paste it in the Caching box.

  4. Click Next. Step 3 of 4: Azure SQL Database Connection dialog box appears. Fields with a red asterisk (*) are required.
     

    • Database OptionCreate SQL Database is the default database option. If you already have your database set up, choose Do not create SQL Database.
    • Database Size—Select the size of your database.
    • SQL Database Server—You can get the server name from the https://manage.windowsazure.com portal: click Database and look under the Subscriptions folder for the server name.
    • Database Name—Specify the name of the database.
    • Administrator Login Name—Create the database administrator account name.
    • Password—Specify the password for the account.
  5. Choose to create a new package or upload an existing package to deploy to the cloud. The newly created deployment package is stored at:

    ~\sync\azuredeploy\{subscription-id}\{servicename}\package\{servicename}.cspkg

    • If you choose to create a new package, you get the following dialog box..
       

    • If you choose to upload your files, click the Browse buttons to select the files.
       

    An advanced user can copy the Web.Cloud.config file from Ektron Windows service (~\Program Files (x86)\Ektron\CMS400v8x\AzureConfig).

  6. Click Save. The Create Azure Hosted Service screen appears.

  7. Click Deploy Site. Ektron creates or uploads a new min database, provisions a storage container, creates the deployment package, and deploys them into a hosted cloud service. A confirmation message appears.
  8. Click Finish to close the wizard.
3. Synchronize the database and templates

Synchronize the Database and Templates

  1. Choose Workarea > Settings > Configuration > Cloud Manager. The view panel displays the instances of databases.
  2. Click Add Profile () to create a profile for the database and template. The Add Azure Synchronization Profile screen appears.
     

    • Profile Name—Give a unique name to this synchronization profile. You can have several profiles to synchronize different elements at different times and frequencies.
    • Local Site Name—Specify which site that you want to synchronize.
    • Cloud Database Name—Specify which database you want to synchronize.
    • Items to Synchronize—You can synchronize everything, or select the portions you want to synchronize on schedule, managing the synchronization activity.
    • Include/Exclude Files—You can exclude files and folders from synchronization, which is especially useful for content that is unlikely to change.
    • Synchronization Direction—Choose which way you want to synchronize the sites.
    • Conflict Resolution Policy—When there is a conflict between the local and cloud sites, choose which site resolves the conflict.
    • Schedule—Choose the frequency of the automatic synchronization.
  3. Specify a name, uncheck Database/Resources and CMS Core, and check Template and bin.
  4. Click Save Synchronization Profile. The profile is saved and the View Azure Hosted Services screen appears.
  5. In the Action section of the profile you just saved, click Sync () to synchronize the database and templates.
4. Manage the cloud instances

Manage the Cloud Instances

In the View Azure Hosted Services screen (Workarea > Settings > Configuration > Cloud Manager), you can modify cloud instances in the following ways:

  • Start the instance—If the icon is green, the instance is stopped; click to start it.
  • Stop the instance—If the icon is red, the instance is running; click to stop it.
  • Edit Web Instance—If you have a production and staging server, click to swap the instance (to staging and production).
  • Scheduled Cloud Event—Display all schedule cloud events.
  • Get Status (Hosted Service)—Display the status of all profiles.
  • Delete Hosted Service—Removes the instance from the list.
  • Add Profile—Add a new profile.
  • Profile Settings—Modify the number of instances. One (1) instance means no load balancing; more than 1 instance balances the load equally among instances.
  • Sync—Synchronize the database and templates.
  • Get Status (Profile)—Display the status of the selected profile.
  • Delete Profile—Removes a selected profile.
5. Scheduling Cloud Events

Scheduling Cloud Events

  1. Go to Settings > Cloud Manager. The Cloud Manager screen appears.
     

  2. Click Schedule Cloud Events (). The View Schedule Cloud Events screen appears.
     

  3. Click Schedule Cloud Event. The Schedule Cloud Event screen appears for you to fill in the fields.
     

    • Description—Describe what the event does.
    • Event Type
      • Edit Instances—Change the number of instances.
      • Deploy Site—Deploy the site.
      • Delete Deployment—Opens a selector to choose sites that you want to delete.
    • Number of Web Instances—The number that you specify will overwrite the number of instances that were configured with the initial deployment.
    • Scheduled Date and Time—Specify when the event will occur.
    • Email Notifications—Send an email to the address list. Use commas to separate the addresses.
  4. Click Save.
6. Configure Ektron storage

Configure Ektron Storage

Ektron uses the unity section of your cloud web.config file to configure a storage destination. Follow these steps:

  1. Add the following to the configSections section:
    <section  name="unity.storage" 
      type="Ektron.Unity.Configuration.UnityConfigurationSection,
      Ektron.Unity.Configuration, Version=2.0.414.0, Culture=neutral,
      PublicKeyToken=1e97f90fc2b998db"/>
  2. Define unity.storage as follows:
    <unity.storage>
      <assembly name="Ektron.Storage"/>
      <assembly name="Ektron.Cloud"/>
      <namespace name="Ektron.Cloud.Azure.Storage"/>
      <namespace name="Ektron.Storage"/>
      <container name="storageContainer">
        <register type="IFileService" mapTo="CloudFileService"/>
        <register type="IDirectoryService" mapTo="CloudDirectoryService"/>
      </container>
    </unity.storage>
    
7. Manually Configure Ektron caching

Manually Configure Ektron Caching

NOTE: Caching configuration is required only if you run more than 1 instance (load balancing). You can get the section values from the portal.

In your cloud web.config file, do the following:

  1. Add the following to the configSections section:
    <section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection,
      Microsoft.ApplicationServer.Caching.Core"
      allowLocation="true" allowDefinition="Everywhere"/>
  2. Define dataCacheClients as follows:
    <dataCacheClients>
      <dataCacheClient name="default">
        <host><host name="[yournamespace].cache.windows.net"
          cacheport="22233" /></hosts>
        <securityProperties mode="Message">
          <messageSecurity authorizationInfo="[yoursecretkeyinfo]"/>
        </securityProperties>
      </dataCacheClient>
      <dataCacheClient name="SslEndpoint">
        <host>
          <host name="ektron.cache.windows.net" cacheport="22243"/> 
        </hosts>
        <securityProperties mode="Message" sslEnbaled="true">
          <messageSecurity authorizationInfo="[yoursecretkeyinfo]"/>
        </securityProperties>
      </dataCacheClient>
    </dataCacheClients>
    
  3. Configure the sessions to use Appfabric server:
    <sessionState mode="Custom" 
      customProvider="AppFabricCacheSessionStoreProvider">
      <providers>
      <add name="AppFabricCacheSessionStoreProvider"
        type="Microsoft.Web.DistributedCache.
          DistributedCacheSessionStateStoreProvider,
          Microsoft.Web.DistributedCache"
          cacheName="default"
          useBlobMode="true"
          dataCacheClientName="default" />
      </providers>
    </sessionState>
    
8. Set the SQL database connection string

Set the SQL Database Connection String

In your cloud web.config file, modify the Ektron.DbConnection section to have an SQL database connection string. You can get this value from the portal.

9. Set the BLOB redirect handler

Set the BLOB Redirect Handler

In your cloud web.config file, insert the BLOB redirect handler into the module section:

<add name="EkBlobModule"
  type="[assemblyname].BlobRedirect.Module,[assemblyname]"
  precondition="integratorMode"/>
10. Create the cloud package

Create a Cloud Package

  1. Open the cloud solution from Ektron Developer's SDK.
  2. Configure the storage account details in the service configuration file. Use Visual Studio 2010 (or edit the XML-based configuration file) to have the following details:

     

  3. Compile the project with Visual Studio 2010, or use the msbuild command as follows:

    msbuild yourcloudproject.ccproj /p:Configuration=Release /t:Build;Publish

  4. Log into the portal and upload yourprojectname.cspkg and ServiceConfiguration.Cloud.cscfg into your newly created hosted service.

    NOTE: After you create the deployment, the set up on the cloud takes some time before the files are ready to be accessed.

Configuring eSync to a Cloud Instance

Configuring eSync to a Cloud Instance

Ektron’s sync technology, built on the Microsoft Sync Framework, synchronizes information between the Azure cloud and On Premises data repositories. eSync makes it easy to manage content changes through a true hybrid cloud deployment.

When you run eSync. SQL data and file system resources (such as ~/assets, ~/privateassets, ~/uploadedfiles, ~/uploadedimages, assetlibrary) are synched to SQL Database Cloud BLOB Storage .

Connecting to an on-premises search server

Connecting to an On Premises Search Server

To create a search in the Windows Azure Cloud environment, use Ektron’s hybrid deployment model. Search requests are sent to your pre-production server, which is identical to your cloud server. You make changes on the pre-production server, and the Cloud server displays the changes. To set up a search in the Windows Azure Cloud environment:

  1. In your On Premises site root's web.config file, modify the following settings:
    <extensions>
      <behaviorExtensions>
        <add name="ServiceRegistrySettings"
          type="Ektron.Cloud.ServiceRegistry.
            ServiceRegistrySettingsElement, Ektron.Cloud" />
      </behaviorExtensions>
    </extensions>
    
  2. In your On Premises site root's web.config file, add the endpoint under Ektron.Cms.Search.SearchManager:
    <endpoint address="sb://yourservicebus.servicebus.
      windows.net/SearchNetTcp/" 
      behaviorConfiguration="sharedSecretClientCredentials"
      binding="netTcpRelayBinding" 
      bindingConfiguration="NetTcpRelayEndpointConfig"
      name="RelayEndpoint" 
      contract="Ektron.Cms.Search.ISearchManager" />
    <netTcpRelayBinding>
      <binding name="NetTcpRelayEndpointConfig">
        <security relayClientAuthenticationType="RelayAccessToken" />
      </binding>
    </netTcpRelayBinding>
    <endpointBehaviors>
      <behavior name="sharedSecretClientCredentials">
        <transportClientEndpointBehavior
          credentialType="SharedSecret">
          <clientCredentials>
            <sharedSecret issuerName="owner"
              issuerSecret="yourissuersecret" />
          </clientCredentials>
        </transportClientEndpointBehavior>
        <ServiceRegistrySettings discoveryMode="Public" />
      </behavior>
    </endpointBehaviors>
    
  3. In your cloud web.config file, change the appsettings, extension and binding section:
    <add key="ek_servicespath"
      value ="http://yourserver/workarea/services"/>
    <add key="serviceBusNamespaceDomain" value="yourdomain"/>
    <add key="serviceBusIssuerName" value="owner"/>
    <add key="serviceBusIssuerSecret" value="yoursecret"/>
    <add key="serviceBusPath" value="SearchNetTcp"/>
    <extensions>
      <behaviorExtensions>
        <add name="ServiceRegistrySettings"
          type="Ektron.Cloud.ServiceRegistry.
            ServiceRegistrySettingsElement,
            Ektron.Cloud" />
      </behaviorExtensions>	
      <bindingExtensions>
        <add name="netTcpRelayBinding" 
          type="Microsoft.ServiceBus.Configuration.
            NetTcpRelayBindingCollectionElement,
            Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral,
            PublicKeyToken=31bf3856ad364e35"/>
      </bindingExtensions>
    </extensions>
    <netTcpRelayBinding>
      <binding name="RelayEndpoint" closeTimeout="00:01:00"
        openTimeout="00:01:00" receiveTimeout="00:10:00"
        sendTimeout="00:01:00" transferMode="Buffered"
        connectionMode="Relayed" listenBacklog="10"
        maxBufferPoolSize="524288" maxBufferSize="65536" 
        maxConnections="10" maxReceivedMessageSize="65536">
        <readerQuotas maxDepth="32" maxStringContentLength="8192"
          maxArrayLength="16384"
          maxBytesPerRead="4096"
          maxNameTableCharCount="16384" />
        <reliableSession ordered="true" inactivityTimeout="00:10:00"
          enabled="false" />
        <security mode="Transport"
          relayClientAuthenticationType="RelayAccessToken">
          <transport protectionLevel="EncryptAndSign" />
          <message clientCredentialType="Windows" />
        </security>
      </binding>
    </netTcpRelayBinding>
Customizing role entry points

Customizing Role Entry Points

 

Web role

Web Role

 

Worker role

Worker Role

 

Provisioning multiple storage

Provisioning Multiple Storage

 

Running the notification service

Running the Notification Service

 

Troubleshooting Azure cloud deployment

Troubleshooting Azure Cloud Deployment