Azure Management API, "Internal Server Error", and Powershell Azure Commandlets
If you are using the Azure management commandlets for Powershell, be careful to correctly create your certificates in Windows otherwise you will receive an unhelpful Internal Server Error:
You will get this same error with csmanage.exe if you try to use the same certificate thumbprint.
It turns out that this error means that there is “something wrong” with your certificate. It probably wasn’t generated correctly. I’ve always used makecert.exe for my certs, but apparently there is something about makecert that Azure doesn’t like. I just don’t recommend using makecert.exe anymore.
Instead, use IIS7 to make yourself a certificate. IIS7 is just the starting point though. There are quite a few hoops to jump through but it is a sure way of getting it to work. I haven’t found many great articles on how to go through this process so I figured I’d document them here. Here is everything you need to do:
First, open up IIS7 and open up Server Certificates:

Next, click Create Self Signed Certificate:

Type in a great name for your certificate and click OK:

You will now see your certificate in your Server Certificates list:

Next, export this certificate by right-clicking on it and choosing Export. Enter a path to export the certificate to and enter a password:

Locate the exported certificate file (.pfx), then open it (or right-click on it and choose to install it). You’ll be prompted with a Certificate Import Wizard. Click Next through all of the screens except for the one where you enter the certificate password. Make sure to mark the certificate as exportable:

Click Next through the rest of the Wizard.
Now, open the Management Console (mmc.exe) and add the Certificates snap-in. Under Personal -> Certificates you should now see your imported certificate:

Right-click on this certificate, select All Tasks, then select Export. Enter the path to export the final certificate to and click Next through the export Wizard:

At last you will have a .cer file that you can now upload to Azure for your management API commandlets:


Posted: 03 June 2010