Makecert – Azure Management Certificates
November 30, 2014 Leave a comment
I have created this article as a reference for myself when I need to create an Azure management certificate for various tasks such as setting up Azure automation for example. I hope you find this useful too.
Tip:- if you regularly work with Azure then I would advise you install the SDK as soon as you can when you are on a good internet connection as it is ~300Mb. It’s worth having as part of your standard computer build.
Create and Upload an Azure Management Certificate
You will need the Windows SDK so download the installer (less than 1Mb), run it and just select the top option.
Once installed create the certificate via the command line.
I have used the script found on this blog which is every useful.
echo This script will create an Azure certificate and export for use in Windows Azure.
echo Computer Name
echo creating folder: %SystemDrive%\certs
dir “C:\Program Files (x86)\Windows Kits\8.1\bin\x64” | findstr /i “makecert.exe”
IF ERRORLEVEL = 1 GOTO ERROR
IF ERRORLEVEL = 0 GOTO CreateCert
echo creating cert and placing it in %SystemDrive%\certs
“C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe” -r -pe -n CN=%computername%-AzureCert -ss my -sr localmachine -eku 18.104.22.168.22.214.171.124.2 -len 2048 -e 01/01/2016 automation-AzureCert.cer
echo makecert.exe file not found. Please check directory path above or download and install the Windows 8.1 SDK from http://www.microsoft.com/click/services/Redirect2.ashx?CR_EAC=300135395
Create a .bat file with the above script or feel free to alter the dates etc. Run it and the certificate is created.
The certificate is created in the C:\certs folder and imported into the machines personal certificate store.
To export a PFX file for possible later use export the certificate from MMC, Details tab of the certificate, Copy to File.
Click next on the first box,then select export private key.
Leave defaults and press next.
specify a password
Enter the location to save the file and exit.
You can now upload this certificate in the Azure portal, under settings, management certificates, upload.
Upload The Azure Management Certificate
Return to the Azure Portal and upload the management certificate.
I hope you found this useful.
Thanks for reading.