Appendix A: Configuring your Windows Azure Management Portal Credentials in Visual Studio

Follow these steps to create the credentials that you can use to access your Windows Azure subscription from Visual Studio.

  1. To add a new set of credentials, open an existing Windows Azure project or create a new one.
  2. Open a Windows Azure Project Management Authentication dialog. To do this, use one of the following two procedures:
    1. In Solution Explorer, right-click the Windows Azure project and select Publish.
    2. In the Publish Windows Azure Application dialog, expand the drop down list labeled Credentials, and then select Add.

      Figure 87
      Configuring Windows Azure account credentials - Option A

  3. Alternatively,
    1. Add a Virtual Machine Role to the Windows Azure project. To do this, right-click the Roles folder inside the project, point to Add, and then select New Virtual Machine Role.
    2. In Solution Explorer, double-click the VM Role to open its properties window.
    3. In the Virtual Hard Disk tab, expand the drop down list labeled Select or create your Windows Azure account credentials, and then choose Add.

      Figure 88
      Configuring Windows Azure account credentials - Option B

  4. In the Windows Azure Project Management Authentication dialog, expand the drop down list below the label Create or select an existing certificate for authentication and choose Create.
  5. In the Create Certificate dialog, set the name to AzureMgmt and click OK.
  6. Choose the newly created certificate from the drop down list.

    Figure 89
    Choosing a certificate for authentication

  7. Now, click the link labeled Copy the full path to store the path to the certificate file in the clipboard.

    Figure 90
    Copying the path of the generated certificate public key file to the clipboard

    Visual Studio stores the public key file for the certificate it generates in a temporary folder inside your local data directory.

  8. Click OK to dismiss the confirmation message box and then save the path in the clipboard to a safe location. You will need this value shortly, when you upload the certificate to the portal.

    Figure 91
    Confirmation that the file path was copied to the clipboard successfully

  9. Now, in the Windows Azure Project Management Authentication dialog, click the link labeled Windows Azure Portal to open a browser window and navigate to the Management Portal.
  10. At the Management Portal, if you have not already done so, sign in using your Windows Live ID.
  11. Select the Hosted Services, Storage Accounts & CDN option, click Management Certificates, and then click Add Certificate on the ribbon.

    Figure 92
    Adding a new management certificate to your subscription

  12. In the Add New Management Certificate dialog, click Browse, change the file name to the path for the public key (.cer) file generated by Visual Studio that you copied earlier to your clipboard, and then click Open. Click Ok to upload the certificate to the Management Portal.

    Figure 93
    Uploading a management certificate

  13. In the Certificates List, click the subscription where you created the certificate and make a record of the subscription ID, located in the Properties pane. You will need it in the next step.

    Figure 94
    Retrieving your subscription ID from the Management Portal

  14. Go back to the Windows Azure Project Management Authentication dialog in Visual Studio and paste the value retrieved from the Management Portal into the subscription ID textbox.

    Figure 95
    Entering your Windows Azure subscription ID

  15. Provide a name to identify your credentials, for example, MyWindowsAzureAccount, and then click OK.