Windows Azure deployment script on Kentico Marketplace

   —   
Using this PowerShell script, you can easily deploy a Kentico CMS website to Windows Azure. You only have to do three easy steps and run the script.
This script is intended for all developers and testers who often need to deploy a Kentico CMS website to Windows Azure. Before you run the script for the first time, you have to take the following steps:

1. Install the Windows Azure PowerShell snap-in 'WAPPSCmdlets'.

If you try to run the script before you install the Windows Azure snap-in, the script will warn you that this snap-in is required.

2. Create the certificate that gives you access to the Windows Azure Service Management API functionality.

If you don’t know how to create the certificate, you can follow these instructions – How to create a certificate for a role. It will help you create and install a X.509 v3 certificate on your machine and create a personal information exchange certificate you have to upload to the Windows Azure via Windows Azure portal.

3. Set several basic settings in the script.

The setting names are equivalent to variable names in the script. You can find them at the beginning of the script in the “Configuration variables” region.

Settings for Windows Azure account:
  • serviceName – the name of your hosted service
  • storageName – the name of your storage
  • storageSharedKey – the access key of your storage
  • subscriptionId – Azure account subscription ID
  • thumbprint – the thumbprint of the API certificate (created in step 2)
Settings for SQL Azure:
  • sqlServerName – the name of your SQL Azure server
  • sqlLogin – the SQL Azure login
  • sqlPassword – the SQL Azure password
Settings for silent installer, msbuild process and log file:
  • silentInstall – path to the silent installer
  • silentArgs – path to the configuration XML file for silent installer
  • msbuild – path to the msbuild.exe file
  • logFile – path to the log file (by default, the path is set to the current folder). Output from silent installer and msbuild process is logged into this file.

Using the script

Now you are ready to use the script. As the script usage information says, you can run the script with four parameters (two are required and two are optional).
As required parameters you have to specify:
  • Path to the Kentico CMS website.
  • Deployment slot where you want to deploy your website.
As optional parameters you can specify:
  • Remote desktop access to Windows Azure role - it will modify service definition and cloud configuration files with appropriate username and password. If you decide to configure remote access, the script will prompt you for Windows Azure password policy to be sure the password meets it.
  • Using silent installer - it will use silent installer to install a Kentico CMS website before it is deployed.
For example, the command for running the script without using silent installer (typically you have the website already installed) and with configured remote access looks like this:

.\AzureDeployment.ps1 –path C:\inetpub\wwwroot\KenticoCMS –slot production –ra Username1,P4ssw0rd

What does it do?
  • It updates cloud configuration file with Azure account credentials and database settings.
  • It updates service definition file and cloud configuration file with remote access settings.
  • It creates Windows Azure package.
  • It removes an old deployment (if a deployment already exists on the same deployment slot).
  • It uploads a new package and creates a new deployment.
  • It creates a database.
Only the Kentico CMS database installation and sample sites installation need to be done manually by accessing the deployment domain. That’s all.

I hope this script will be useful for you and will make your work a little bit easier. You can download the script from Kentico Marketplace. Feel free to post any questions and suggestions below.
Share this article on   LinkedIn

Juraj Komlosi

Chief Information Security Officer at Kentico Software

Comments