Running EPiServer CMS on the Azure VM Role, part two

rocket-launchThis blog post is about running EPiServer CMS on the Windows Azure Virtual Machine (VM) Role and the challenges that follow. The approach is expirmental and not officially supported by EPiServer. I strongly recommend that you do not use this for production scenarios.


Create a certificate

In order to be able to upload the Virtual Hard Drive to Windows Azure we need to have a valid certificate installed locally and on Windows Azure.

If you haven’t created a certificate then you need to do so now. First we need to create the certificate using the MakeCert-tool that ships with the Windows SDK. Below is the MakeCert-command needed to create a valid certificate.

2.1.1 MakeCert

Create the certificate

Next install it to the local store and subsequently upload it to the Windows Azure Portal.

2.2 Install Certificate Locally2.3 Upload to Windows Azure

Install the certificate locally and on Windows Azure

Upload the Virtual Hard Drive

With the certificate in place locally and uploaded to the Windows Azure Portal we’re ready to set the connection and upload the Virtual Hard Drive.

We use the csupload-tool when uploading Virtual Hard Drives to Windows Azure. This tool is part of the Windows Azure SDK. So we begin by starting an Azure SDK Command Prompt. See image below.

5.1 Start Azure SDK Command Prompt

Start the Windows Azure SDK Command Prompt

Next you need to go to the Windows Azure portal and copy your subscription ID and certificate thumbprint. We’ll need these when setting the connection for csupload.

5.2 Subscription ID

Copy the subscription id and certificate thumbprint

The csupload-commands are as follows.

5.3 csupload set connection5.4 Upload in progress

The csupload tool

When the tool finishes we have successfully uploaded our Virtual Hard Drive to Windows Azure.

Create the Virtual Machine Role using Visual Studio

Next we need to create the VM Role that will run our Virtual Machine. This Role is responsible for the number of instances, endpoints, diagnostics and how the Virtual Machine can be accessed.

If you haven’t done so already you should run the registry script that was sent with the notification e-mail that you’re account is enabled to use the VM Role.

6.0 Run the registry script

Run the registry script which enables the VM Role in Visual Studio

Next create a standard Windows Azure Project in Visual Studio. Do not add any roles to the project. See images below.

6.1 Creating The Virtual Machine Role Project6.2 Keep the roles empty

Create Windows Azure Project in Visual Studio and keep the Roles empty

Having run the registry script we now have access to the Virtual Machine Role. Right click the Roles-folder in the Visual Studio Project and select Add, New Virtual Machine Role.

6.3 Add new vm role

Add a new Virtual Machine Role

We select our Windows Azure account and the Virtual Hard Drive we just uploaded. The VM Role requires at least two instances to run. This is because there must be a fail-over if the Azure Fabric for one of the VM Roles suffers a catastrophic failure. See images below.

6.4 Selecting Azure Account and VHD6.5 Instances count 2 and enable diagnostics false

Selecting the Windows Azure account, VHD and setting the instances

Next we need to set an endpoint for which the VM Role can be accessed. We need an HTTP endpoint running on port 80. Configure the endpoint as shown below.

6.6 Create Http Endpoint

Setting the HttpEndpoint

With this we’re done with  the configuration of the VM Role.

Publishing the VM Role

Right click the project and select Publish. Select the Azure account to publish to, deployment environment and storage account. Before we click OK we need to configure Remote Desktop connections. See image below.

6.8 Configure Remote Desktop Connections

Configure Remote Desktop connections…

We need to create a new certificate for the Remote Desktop connections. Enter the username and password. These credentials will be used when using Remote Desktop access – write these down!

Check the Enable connections for all roles checkbox. Next we need to export the new certificate – we do this by clicking View and then select Copy to file on the Details tab. See images below.

6.10 View certificate6.11 Copy certificate to file

Create certificate for remote desktop connections

We then add this certificate to the Hosted Service that will be running our Virtual Machine. Failing to do so and trying to publish the VM Role will result in an error. See Images below.6.13 Fail to upload VM Role

6.12 Add certificate

Add certificate to the hosted service

Now we’re ready to publish. Click OK on the Publish-dialogue. If all goes well the process should look as below. Be patient; it takes a while for the Virtual Machines to initialize.

7. Starting up7. Finished

Virtual Machine initialization in the Windows Azure portal

That’s it! You’re now running EPiServer CMS on the VM Role. Note that the MAC-address for our license is no longer valid since this is a dynamic aspect of Windows Azure.

7.3 Running on the VMRole

EPiServer CMS running on the VM Role

Managing the Virtual Machines in the Portal

From the Windows Azure Portal you can now manage the Virtual Machines. You can, among other things, specify how many instances that should be propagated behind the load balancer. See image below.

7.2 Adding instances

Manage the number of virtual machine instances in the portal

We also have Remote Desktop access to our virtual machines. Simply select the instance you want to connect to and click Connect.The Remote Desktop session will use the certificate and credentials we created earlier.

7.4 RDP Portal Access7.5 RDP Access

Remote desktop access to our virtual machines

Further challenges

Stormy CloudRunning EPiServer CMS on the Virtual Machine Role of Windows Azure presents a few challenges. I have adressed a few here, but there are more still. Also, there are a few key parts to the VM Role that need to be highlighted. I’ll deal with these in an upcoming post. Thanks for reading so far.

Recent Posts
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search