Saturday 29 March 2014

Creating Custom Certificates for Azure Worker Roles



I like to create my own self signed certificate when deploying worker roles and using Remote Desktop.This is so that I can share the certificate with the team rather than have a locally created certificate without a backup and other issues on my local machine.
The best way to do that is to manually create a private export key certificate
Launch a VS2012 Command Prompt.

Execute makecert

makecert -sv ALPerformanceCounter.pvk -sky exchange  -ir LocalMachine -in ALPerformanceCounter -pe -n CN="ALPerformanceCounter" ALPerformanceCounter.cer

Execute pvk2pfx

pvk2pfx -pvk ALPerformanceCounter.pvk -spc ALPerformanceCounter.cer -pfx ALPerformanceCounter.pfx -po abc123

This will now create a private key.

Import the private key pfx in your local certificate storage under personal storage.

Using certmgtr.msc open the certificate. Under details ensure you have

“You have a private key that corresponds to this certificate”

Select Details TAB -> Edit Properties

Change Friendly Name and Description to ALPerformanceCounter.

Now when packaging the worker role.

Select the Enable Remote Desktop for all roles. When selecting the certificate the Friendly Name Certificate will be available for you to select and use.

When deploying ensure you have uploaded the private certificate in the cloud service.