Azure ( Classic )

The Microsoft Azure platform is in transition. In the early days of Azure, their so called Rest API was XML based. We believe that the use of XML caused locks, since each cloud operations was required to update the XML.

Since Azure is doing a transition to their new JSON Based API, this is not recommended for production use. Azure have a tendency to provide new features on their new technologies and not the deprecated ones, which is confirmed on their azure blog. This means that any VirtualMachines created using this API will likely require to be rebuilt in the next 18 months.

Create the AZURE Cloud Provider

To use the Azure Classic:

  • You must have a valid .PEM file.
  • You must have your Subscription ID.

First, find the Cloud Providers section from the left menu, then you may click the Add Cloud Provider button.


You will be shown with the following screen.

  • Select the provider Azure in this case
  • Fill in all the informations
Parameter Required Description Example
Name Y Unique name to be displayed to your users. Azure Development - BizSpark Sub
Tag N If you want this API to be inherited to child projects, specify a tag value Dev
Default Storage N By default, the API will find the first storage created for the region to use.
SubscriptionId Y Azure supports multiple subscriptions, which help for reporting and billing. 56ef4053-4a66-411f-a5a3-e9261b65745a
PEM File Y Azure API requests must be authenticated using a PEM file with its .CER file uploaded to Azure
SSH Username Y This will be the boostrap user created for the Portal to run remote commands. acentera
SSH Private Key Y This currently require a password-less ssh-rsa key. id_rsa
  • Once all informations are entered, you may Save the new provider.


Find your Azure Subscription ID

First Method Using Azure Management Portal.

  • Scroll down the left menu until you see the Settings section.
  • Click on the Management Certificates
  • Expand the Subscription ID column


The Id Field, is your subscription ID which would look like the following


Second Method Using Azure Client

Azure Cli Installation

Azure Cli is based on NodeJS. You can install it using the NPM command as follows:

You may be required to prefix the command with sudo, in some cases

npm install azure-cli -g  

Once you have successfully installed azure client, you will be required to import the subscriptions informations. You may visit the following link or execute the azure command below

Azure Publishsetting download

Command to download the subscription file.

azure account download  

Once you have downloaded the subscription file, you have to import it into the azure client as follows:

**Replace with the full path of your *.publishsettings file.

azure account import <file>  

Once the file is imported you may list all your available subscriptions using the following command:

azure account list  

The Id Field, is your subscription ID which would look like the following


Generate API Management Certificate

First, you must generate a self-signed certificate that you will upload to Azure once all steps are completed. During the process you will be requested to fill in some informations that identify your certificate.

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout azure.pem -out azure.pem  

Windows Azure subscriptions require you upload your key certificate (.cer) format. Here is the openssl command that will generate a certificate from your PEM file.

openssl x509 -outform der -in azure.pem -out azure.cer  

Now you can upload your .CER to the Management Certificates sections of the Microsoft Azure Management Portal.


On the new popup, you will be asked to browse to select your previously generated "azure.cer" file, and then to upload by using the check button.


If want to convert a PEM file to PKCS12 format (or .pfx), Here is the openssl command that will convert your PEM file to PKCS12. This is not required.

openssl pkcs12 -export -out azure.pfx -in azure.pem -name "PFX Self Signed Cert"  

Test Azure API Certificate

You may validate your Certificate using a simple cURL command using your previously generated PEM file. Now that you have the cert created and uploaded to Microsoft Azure, you can query directly the REST(XML) API.

First you need to find your Azure Subscription ID.

For example, if you want to list all your existing hosted services, you can use the List Hosted Services API as follows:

curl -E ${AZURE_PEM_FILE} -H "x-ms-version: 2011-10-01" "${SUBSCRIPTION_ID}/services/hostedservices"