Deploying a Windows Azure application

After creating and developing you application locally on your machine, there's a time you may want to run it on Microsoft's Cloud. There are two options avaible:
  • Running the app locally and storing the data in Windows Azure Storage.
  • Running the app in Windows Azure and storing the Date in Windows Azure Storage.

The first option is recomended for testing and debugging, before you actually run your code in the cloud.

The first thing to do if you want to run you apps in the cloud is creating both the Storage Account and the Hosted Servics for them. The following section explains how to do that.

Creating the Services

1. Select you project in the main screen:

tut1.png

2. Click on "New Service"

tut2.png

3. Select the kind of service you want to create:

tut3.png

4. Give it a label and a description

5. Choose an URL for your service and the region where it'll be hosted. Try to keep the Hosted Service and Storage account from the same app hosted in the same region.

tut4.png

Deploying

After creating the Hosted Service and the Storage Account for your application, it's time to send it to Microsoft's cloud. This can be easily done with the Azure Tools for Visual Studio 2010. Just follow these steps:

1. Double-click your Web and Worker Roles under the Roles folder (in your Project tree)
2. Cick on the "Settings" tab
3. Edit the "Data Connection String" field
4. Select "Enter Storage Account credentials" and fill with your Storage Account information (can be found in the Azure Portal)
  • The "Account Name" is the same name you used to specify the app URL
  • Use the "Primary Access Key" in "Account Key". The "Secondary Access Key" acts just as a backup of the Primary Key.
5. Select "Use default HTTPS endpoints"

tut5.png

(remember to follow these steps for all your Web and Worker Roles)

At this point you application can be run (pressing F5) locally using the Windows Azure Storage. However, if you want your application to run in the cloud (and not only it's storage service), you need to complete a few other steps:

6. Right-click your project in the project three and select the "Publish..." option
  • This will generate a ".cscfg" and a ".cspkg" file in in the "bin/Release/Publish" folder of your project.

tut6.png

7. Now you need to upload these files at the Azure Portal. Just select you Hosted Service in the Azure Portal and upload the generated files as shown in the following image:

tut7.png

Your application will appear as stopped in the Hosted Service page. We,re almost there! Just click run and wait a few minutes and your application will appear in the "Ready" state.

tut8.png

Informações mais detalhadas podem ser encontradas em http://msdn.microsoft.com/en-us/magazine/ee336122.aspx

Last edited Feb 16, 2011 at 6:49 PM by bjurkovski, version 8

Comments

No comments yet.