Introduction
Managing an HDInsight cluster, or running an HDInsight job, from an Azure worker role, requires you to set up a certificate to access the HDInsight cluster. This post shows the steps to generate the certificate files we need. The next one will show you how to upload the certificates to the Azure management portal, and how to configure your cloud service (Setting up a cloud service to run HDInsight jobs – Part 2).
Creating the certificate files
The certificates you download from your Azure subscription will not allow you to generate a pfx file, so we’ll need to create our own. This can be done in two ways: we can buy a certificate from firms like VeriSign or Entrust, or, we can create one ourselves with IIS, for free!
Create the .pfx file
- Go to Start –> Run (or press Win + R).
- Type ‘inetmgr’ (without the quotes. This will open IIS Manager.
- Select the root node in left panel.
- Double click the ‘Server Certificates’ icon in the middle panel:
- Click on ‘Create Self-Signed Certificate’ in the right side panel.
- Give it a friendly name and click OK.
- Save the certificate file (.pfx):
- In IIS Manager, double click on the certificate which you just created.
- In the Certificate properties window, go to the Details tab.
- Click ‘Copy to File’.
- The wizard will open, click Next.
- Select ‘Yes, export the Private key’ and click Next.
- Select ‘Personal Information Exchange…’ and click Next.
- Set a Password and click Next.
- Select the file location and click Next.
- Lastly, check the information and click Finish to export the certificate.
Create the .cer file (out of the .pfx certificate)
First, we need to install our pfx certificate in our computer’s certificate store, and then we’ll export it as a .cer file.
- Open the Certificate Manager by going to Start, then Run, and entering ‘certmgr.msc’:
- Import the pfx certificate to the personal store:
- Select Personal -> Certificates from the left menu:
- Go to Action -> All Tasks -> Import…
- A new wizard will open, click Next.
- Browse for the pfx file we generated earlier, and click Next.
- Enter the password and click Next.
- Select the store in which to save the certificate and click Next.
- Confirm the information and click Finish.
- Select Personal -> Certificates from the left menu:
- Now we’ll export the .cer file:
- Right click the certificate we just imported, select All Tasks -> Export…
- Select ‘No, do not export the private key’ and click Next.
- Select the default: ‘DER encoded binary X.509 (.CER)’ and click Next.
- Specify the file location and click Next.
- Confirm the information and click Finish.
- Right click the certificate we just imported, select All Tasks -> Export…
Summary
In this post we saw how to create the certificates we need to manage or run jobs in our HDInsight cluster. In the next post we’ll see how to upload the certificates to the Azure portal and how to configure our service.
Happy coding!
Pingback: Setting up a cloud service to run HDInsight jobs – Part 2 | Guillermo Bellmann
Pingback: Setting up a WebJob to run HDInsight jobs | Guillermo Bellmann