Windows Azure is a Platform as a Service offering from Microsoft that supports applications, storage and databases, as well as plumbing like the service bus.
On the application side, Windows Azure has two types of Roles: Web Roles and Worker Roles.
Web Roles are similar to a standalone web application running under IIS, and providing HTTP(S) endpoints that are Internet accessible.
Worker Roles are like a Windows Service. They Start upon deployment and can be restarted (automatically) after crashing. Worker Roles are used to process messages from Queue’s or to be “normal” executable applications, in the “traditional” sense.
Windows Azure Storage is an abstracted storage system which is needed because none of us mortals have any access to the underlying Operating System. It supports three storage types: Tables, Queues and BLOB’s.
There are three types of BLOB’s Microsoft has defined so far:
- Block BLOB’s -maximum size of 200GB. Optimized for streaming
- Page BLOB’s – maxof 1TB. Optimized for random access R/W ops
- Windows Azure Drive (Beta currently). Its an NTFS formatted VHD, hosted within a page BLOB
Note that a Storage Account has a maximum size of 100TB. If you need more storage than that, you’ll have to design a way to span your data across multiple Storage Accounts.
To deploy the application to the cloud using Visual Studio 2010 (or 2008), it is necessary to have a Hosted Service and a Storage Service created already. See this post for details about setting up these services: Getting Started with Windows Azure
Deployment Process
There are two different deployment processes you can use. One creates a zip file of the app and uses the developer portal to upload it. The other uses Visual Studio to deploy. We’ll be talking about the latter method here as its more graceful. However, to use this deployment process you need to have Installed the Windows Azure Tools for Microsoft Visual Studio 1.2 (June 2010) which you can get from:
With the Azure tools in place and with the accounts / connection strings created in the Azure Developer Portal, you can now go to Visual Studio, right click on your Cloud Service Project and select “Publish”.
Select “Deploy your Cloud Service to Windows Azure”. Click the “Credentials ” drop down and select “Add”. This starts a dialog to create a Certificate for Authentication, which will be needed in order to use the Management API to do the deployment. Click “Create” in the drop down list and give the certificate a name.
Next, click on the “copy the full path” link in the window to copy it to the clipboard. Click on the “Developer Portal” link in the window to launch the web portal site so you can log in and post the certificate up to the Portal.
To install the certificate, select the project in which to install the certificate, then click the “Accounts” tab, then click “Manage API Certificates”. Click the “Browse” button and paste the location of the certificate into the dialog box, then click “Upload”.
Next, copy the “Subscription ID” from the account page, and paste it into Visual studio in the “Copy Subscription ID…” textbox.
Give the credentials a name, as a tracking means for you, click OK.
Choose the “Hosted service slot to deploy to” (may be pre-populated with production or staging in the drop down, otherwise its the one you created earlier).
Next, select the Storage Account which you are deploying thru (its the upload target for the deployment file and is the one created in the preparatory steps). You can Label your deployment, to track sequences, or leave the default label in place.
Click OK to start the deployment. It runs in the background and its status can be tracked in the Windows Azure Activity Log window. A small server (1 cpu) deployment seems to take 15 – 30 minutes typically.
Done! You should be able to use the Server Viewer in Visual Studio to see the status, or use the Summary tab of the developer portal, selecting the hosted service to view.
The alternate approach to deployments, is to create a Service Package (cspkg), to upload in the Azure Developer portal along with the service.config file, but its nicer to do everything from within Visual Studio. The cspkg is basically a zip file of the app.