Setting Up Named Authentication Credentials
To publish an application to Windows Azure from Visual Studio or to monitor an existing cloud service, you must provide credentials that Visual Studio can use to authenticate requests to Windows Azure. There are several places in Visual Studio where you can sign in to provide these credentials. For example, from the Server Explorer, you can open the shortcut menu for the Windows Azure node and choose Connect to Windows Azure. When you sign in, the subscription information associated with your Windows Azure account is available in Visual Studio, and there is nothing more you need to do.
Windows Azure Tools also supports an older way of providing credentials, using the subscription file (.publishsettings file). This topic describes this method, which is still supported in Windows Azure SDK 2.2.
Two items of data are required for authentication to Windows Azure:
Your subscription ID
A valid X.509 v3 certificate
|The length of the X.509 v3 certificate's key must be at least 2048 bits. Windows Azure will reject any certificate that doesn’t meet this requirement or that isn’t valid.|
Visual Studio uses your subscription ID together with the certificate data as credentials. The appropriate credentials are referenced in the subscription file (.publishsettings file), which contains a public key for the certificate. The subscription file can contain credentials for more than one subscription.
You can edit the subscription information from the New/Edit Subscription dialog box, as explained later in this topic.
If you want to create a certificate yourself, you can refer to the instructions later in this topic and then manually upload the certificate to the management portal.
|These credentials that Visual Studio requires to manage your cloud services aren’t the same credentials that are required to authenticate a request against the Windows Azure storage services.|
Modify or Export Authentication Credentials in Visual Studio
You can also set up, modify, or export your authentication credentials in the New/Edit Subscription dialog box, which appears if you perform either of the following actions:
In Server Explorer, open the shortcut menu for the Windows Azure node, choose Manage Subscriptions, choose the Certificates tab, and choose the New or Edit button.
Publish a Windows Azure application from the Publish Windows Azure Project wizard by choosing Manage in the Choose your Subscription list, and then choosing the Certificates tab and then choosing the New or Edit button.
The following procedure assumes that the New/Edit Subscription dialog box is open.
To set up authentication credentials in Visual Studio
In the Select an existing certificate for authentication list, choose a certificate.
Choose the Copy the full path button.
The path for the certificate (.cer file) is copied to the Clipboard.
Important To publish your Windows Azure application from Visual Studio, you must upload this certificate to the Management Portal.
To upload the certificate to the Management Portal
Choose the Windows Azure Portal link.
The Management Portal opens.
Sign in to the Management Portal by using your Microsoft account, and then choose the Cloud Services button.
Choose the cloud service that interests you.
The page for that service opens.
On the Certificates tab, choose the Upload button.
Paste the full path of the .cer file that you just created, and then enter the password that you specified.