icon Azure Publisher - World Wide
Created by Orckestra

Azure Server Setup Guide

Deploying on Microsoft Azure

To prepare a target server on Microsoft Azure, you need to use a service package configured with the blob connection information.

You can use a prebuilt service package provided by Orckestra.

The service package will deploy a web role in an Azure cloud service with the required Azure server part, which will monitor the website uploaded to the blob storage for changes and down-sync these changes (or the entire website on the first run) to the web role.

The service package will automatically set up the website on the web server (IIS) and, if chosen to, install the SMTP service.

Preparing the service package

You can use the pre-built service package provided by Orckestra and available at the download page:

The package is distributed as a pre-built solution for virtual machines of the Small (Standard A1) size with SSL support.

The service package itself (.cspkg) comes with a configuration file (.cscfg), which you will use to configure the package before deploying with it and a “dummy” certificate (.pfx) to be used with the web role by default.

Configuring the service package

Before you deploy the web role with the service package, you should configure it specifying the blob connection string and names for the deployment and setting up other parameters.

The following is the boilerplate configuration where you should replace the placeholders ({...}) with your own values.

<ConfigurationSettings>
  <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName={ACCOUNT_NAME};AccountKey={KEY}" />
  <Setting name="WebRole.DisplayName" value="{WEBROLE_DISPLAY_NAME}" />
  <Setting name="WebRole.Blob.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName={ACCOUNT_NAME};AccountKey={KEY}" />
  <Setting name="WebRole.Blob.ContainerName" value="{DEPLOYMENT_NAME}" />
  <Setting name="WebRole.Blob.ConnectionStringEncrypted" value="false" />
  <Setting name="WebRole.Blob.UpdateCheckSleepInMilliSeconds" value="5000" />
  <Setting name="WebRole.Blob.MaximumDownloadConcurrency" value="50" />
  <Setting name="Webrole.Blob.StatusFilesTouchRateInMinutes" value="10" />
  <Setting name="WebRole.Iis.AppPoolIdleTimeoutMinutes" value="60" />
  <Setting name="WebRole.Iis.ManageIisConfiguration" value="true" />
  <Setting name="WebRole.Iis.DeleteDefaultSites" value="true" />
  <Setting name="WebRole.SmtpServer.Install" value="false" />
</ConfigurationSettings>

Listing 3: Example of ServiceConfiguration.cscfg

Edit the service configuration file that comes with the package and set the following parameters replacing the corresponding placeholders:

  • {ACCOUNT_NAME}: The name of the blob storage account used for the deployment.
  • {KEY}: The access key for the blob storage account used for the deployment.
  • {DEPLOYMENT_NAME}: The name of your deployment.
  • {WEBROLE_DISPLAY_NAME}: The name to be used when referring to the web role being deployed.

The ConnectionString (Account Name + Key) is used in the blob connection strings for the deployment and diagnostics. (Please see “Azure blob storage”.)

It is a good practice to specify the same {ACCOUNT_NAME} and {KEY} for both WebRole.Blob.ConnectionString and Diagnostics.ConnectionString.

If you, however, choose to use different sets of account names/keys, make sure they refer to the storages in the same data center to avoid unwanted traffic expenses and / or connection issues.

The ContainerName uniquely identifies the deployment and also used as the name for the deployment container when the latter being created in the blob storage by the service package. The configuration file comes with this value set to “deployment”. You can keep it or change it to the one you like.

The web role’s descriptive DisplayName helps identify a web role where your website is deployed, and makes sense when you scale out your website across multiple web roles. The configuration file comes with this value set to “CMS Cloud Service”. You can keep it or change it to the one you like.

Please keep the default certificate settings and use the default certificate that comes with the package when deploying the role.

For these and other configuration settings in ServiceConfiguration.cscfg, please see "ServiceConfiguration.cscfg".

Deploying with the service package

To deploy the web role with the Azure server part using the service package, you need to have a cloud service created on Microsoft Azure and the certificate (specified in the configuration file) uploaded to this service.

Please note that you can always do the following 3 steps (create a service, upload a certificate and deploy the web role) immediately as a combined step while creating a service. Here, we will consider each step separately.

To create a cloud service:

  1. Log in to your Microsoft Azure Portal.
  2. Create a cloud service (New / Compute / Cloud service).
  3. Specify:
    1. the DNS name
    2. the Subscription
    3. the Resource group
    4. the Location
  4. Click Create.

It will take a few moments to create the service.

  

Figure 7: Creating a cloud service on Microsoft Azure

Next, upload the certificate that comes with the package.

  1. Open the cloud service you’ve just created (All Resources / [your cloud service]).
  2. Click “Certificates” below “Settings”.

    Figure 8: Selecting a cloud service’s ”Certificates”.

  3. Click “Upload” to upload the default certificate.
  4. Browse to, and select, the default certificate that comes with the package (“dummy.certificate.pfx”).
  5. Specify the password written in the file “dummy.certificate.password.txt”.
  6. Click “Upload” down below.

Figure 9: Uploading a certificate to a cloud service

Once the certificate gets uploaded, go on and upload the service package and its configuration to the cloud service to deploy the web role:

  1. Open the cloud service you’ve just created (All Resources / [your cloud service]).

    Figure 10: Opening a cloud service

  2. If necessary, select between a production and staging deployment (Production slot or Staging slot).
  3. Click Upload to upload your service package and configuration to the cloud service.

    Figure 11: Uploading the service package

  4. In the “Upload a package” form, set these parameters:
    1. Select a storage account (it should be of the “Classic” deployment model)
    2. Specify the “Deployment label”
    3. Browse for, and select, the service package and configuration you've prepared earlier for the “Package” and “Configuration” parameters. This will upload your package and configuration to the blob storage immediately.
  5. Also, make sure these options are enabled:
    1. “Deploy even if one or more roles contain a single instance.”
    2. “Start deployment.”
  6. Click the “OK” button.

This will start deploying the web role. Please note that the deployment might take some time.

You can monitor the status and progress of the deployment in the "Role and instances" box.

Figure 12:

You can also check a trace log for a specific message that signifies that the web role has been deployed properly and now is running. You can use Visual Studio or other 3rd -party tools such as Azure Management Studio for monitoring diagnostics data. The message will read something like: “CmsCloudService: Ready... ; TraceSource 'WaIISHost.exe' event”.

For a scaled-out deployment, you should repeat the steps above for as many deployments as you need. Please see below “Scaling out on Microsoft Azure”.

Now that you've deployed the web role(s) in the cloud, you are ready for the final step - having your website down-synced to the web role(s).

Scaling out on Microsoft Azure

You can scale out your website for load balancing and geo-targeting purposes across a number of data centers on Microsoft Azure.

For the scaled-out deployment, you need to repeat the deployment of the web role with the service package but use ServiceConfiguration.cscfg with a different value for the “DisplayName” setting.

  1. Configure the service package specifying a unique web role display name {WEBROLE_DISPLAY_NAME} in the service configuration file.
  2. Create a new cloud service, upload the default certificate and deploy the web role in it with the configuration from Step 1.
  3. Repeat steps 1-2 for as many deployments as you need

Please note that keeping the same display name for the role will not affect the deployment itself. It helps distinguishing one copy from another within the scaled-out deployment, for example in the Azure Publisher.

Please also note that when scaling out, you must keep the same deployment name.

 

It makes sense to prepare in advance as many service configuration files as you need for your scaled-out deployment on Microsoft Azure. The service package should be reused.

Important: Make sure to disable write-backs on the websites in the cloud when scaling out by setting the writeback parameter to 'false' in the website configuration file (configuration/Runtime/@writeback). For more information, please refer to ”Disabling write-backs from live websites”.

Setting up Azure Traffic Manager

NOTE: Take this step only for the scaled-out deployment.

You should set up a Traffic Manager on Microsoft Azure to load balance incoming traffic to your website geographically.

  1. In the Microsoft Azure portal, click New / Networkig / Traffic Managerprofiles.

    Figure 13: Creating a Traffic Manager

  2. Specify the Name and select "Performance" for the Routing method.
  3. Also, select the Subscription and Resource group if needed.
  4. Click Create.

Figure 14: Setting parameters for the Traffic Manager

Once it has been created, add endpoints (individual deployments in your scaled-out deployment):

  1. Open it (All Resources / [your traffic manager]).
  2. Click on the Endpoints box to open the list of endpoints (empty for now).
  3. Click Add to add an endpoint.
  4. Set the parameters:
    1. Set the Type to “Azure endpoint”
    2. come up with the Name
    3. Set the Target resource type to “Cloud service”
    4. Set the Target resource to the cloud service with the web role deployed as part of your scaled-out deployment.
  5. Click OK.
  6. Repeat Steps 3-5 for as many individual deployments as you have.

Figure 15: Adding endpoints

Figure 16: Endpoints added to the traffic manager

Finally:

  1. Open the traffic manager’s configuration (Settings / Configuration )
  2. Change the port number from 80 to 8888.
  3. Save the changes.

Figure 17: Changing the port for the traffic manager

Back to top
Part of subscriptions:

Have a question?

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