Deploying on Windows Server

Deploy your websites on Windows Servers with the Azure Blob Sync tool.

Not only can you deploy a web role on Microsoft Azure and run your website within this role, but also set up your website on a regular Windows Server with the AzureBlobSync tool.

The steps of setting up a website on a Windows Server are similar to those when using a web role on Microsoft Azure.

Upload and configure the website

First of all, prepare a blob storage on Microsoft Azure and preconfigure the website deployment. The steps are the same as those for the web role deployment:

  1. Have a storage account on Microsoft Azure. (Please see "Prepare on Azure".)
  2. Upload a website to the blob storage on Microsoft Azure with Azure Publisher. (Please see "Upload Website to Storage" > "Using Azure Publisher".)
  3. Preconfigure the website in the blob storage before deploying it. (Please see "Configure Website".)

Create a deployment container

Next, on Microsoft Azure, prepare a deployment container in the blob storage for your Windows Server deployment with the AzureBlobSync tool.

  1. Access your blob storage on Microsoft Azure:
    1. Either use a tool of your choice (for example, CloudBerry Explorer for Azure Blob Storage),
    2. or access it directly on Microsoft Azure Portal.
  2. Create a "deployment" container within the blob storage where you have already uploaded your website.

Note. The website has been uploaded to a dedicated "website" (or "data") container. Use a different container for the deployment.

Install the AzureBlobSync tool

Next, install the AzureBlobSync tool on the target Windows Server:

  1. Download the tool (please see "Downloads"). 
  2. Unzip the AzureBlobSync.zip where you want the tool to be installed, for example, in C:\Program Files.

Configure the AzureBlobSync tool

Next, on your Windows Server, configure the AzureBlobSync tool.

  1. Locate and edit Composite.WindowsAzure.C1AzureBlobSync.Service.exe.config. in the AzureBlobSync's installation folder (see the step above).
  2. Set the  environmentConfig and  roleConfig parameters respectively to the full paths to:
    1. the environment configuration file env.config
    2. the role configuration file role.config .

      Sample:
      <configuration>
        <!-- skipped -->
        <appSettings>
          <add key="environmentConfig" value="env.config" />
          <add key="roleConfig" value="role.config" />
        <!-- skipped -->
        </appSettings>
      <!-- skipped -->
      </configuration>
  3. Locate and edit role.config.
  4. Set the parameters with the following placeholders in the sample below:
    1. {DISPLAY_NAME}: The name to be used when referring to the website on a specific Windows Server.
    2. {DEPLOYMENT_NAME}: The name of your deployment. It must be the same as the name of the deployment container you've created earlier (see above).
    3. {ACCOUNT_NAME}: The name of the blob storage account used for the deployment.
    4. {KEY}: The primary access key for the blob storage account used for the deployment.

      Sample:
      <ServiceConfiguration xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
        <Role name="Composite.WindowsAzure.WebRole.SimpleBoot">
          <ConfigurationSettings>
            <Setting name="WebRole.DisplayName" value="{DISPLAY_NAME}" />
            <Setting name="WebRole.Blob.ContainerName" value="{DEPLOYMENT_NAME}" />
            <Setting name="WebRole.Blob.ConnectionString" 
                     value="DefaultEndpointsProtocol=https;AccountName={ACCOUNT_NAME};AccountKey={ACCOUNT_KEY}" />
      
            <Setting name="WebRole.Iis.AppPoolIdleTimeoutMinutes" value="60" />
            <Setting name="WebRole.Blob.UpdateCheckSleepInMilliSeconds" value="5000" />
      
            <Setting name="WebRole.Manager.RollingUpdate" value="true" />
            <Setting name="WebRole.Manager.RollingUpdateIntervalInSeconds" value="30" />
            <!-- Maximum supported value is 60 -->
          </ConfigurationSettings>
          <Certificates></Certificates>
        </Role>
      </ServiceConfiguration>

      For more information on the role configuration parameters, please see "Role Configuration" for more information.
  5. Locate and edit env.config.
  6. Set the parameters with the following placeholders in the sample below: {DEPLOYMENT_ID}, {INSTANCE_ID}, {INSTANCE_NAME}.

    Sample:
    <Settings>
      <add name="Environment.IsThisTheLowestInstance" value="true" />
      <add name="Environment.NumberOfInstances" value="1" />
      <add name="Environment.DeploymentId" value="{DEPLOYMENT_ID}" />
      <add name="Environment.RoleInstanceId" value="{INSTANCE_ID}" />
      <add name="Environment.RoleInstanceName" value="{INSTANCE_NAME}" />
      <add name="Environment.WebsitesPath" value="c:\www" />
      <add name="Environment.RootPath" value="c:\AzureBlobSync" />
    
      <add name="WebRole.Iis.DeleteDefaultSites" value="false" />
      <add name="WebRole.Iis.ManageIisConfiguration" value="true" />
      <add name="WebRole.SmtpServer.Install" value="true" />
    </Settings>

Important. By default, the tool would clear all the websites from the IIS before setting up a new one. When deploying locally, it is important to turn off this setting ('false'):

 <add name="Composite.WindowsAzure.WebRole.Iis.DeleteDefaultSites" value="false" />

For more information on the environment configuration parameters, please see "Environment Configuration."

Run the AzureBlobSync service

To keep the synchronization ongoing, run the AzureBlobSync tool as a Windows service on the Windows Server:

  1. Locate and run install.bat in the AzureBlobSync's installation folder. This will install the AzureBlobSync tool as a Windows service.
  2. Run services.msc . (For that press Win + R to invoke the "Run" box and type in "services.msc".)
  3. In the Services window, locate and run the C1AzureBlobSync service.

This will start the AzureBlobSync tool as a Windows service. The AzureBlobSync will be monitoring the website and deployment containers in the Azure blob storage for changes and address them if any.

Publish the website to the Windows Server

Finally, publish ("down-sync") your website from the blob storage. The steps are the same as for the web role deployment. (Please see "Publish Website to Web Role".)