Rainbows in the Cloud

September 10, 2010

Deploying Azure Applications

Filed under: Technical Article — Bruce Johnston @ 10:29 pm

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:

http://www.microsoft.com/downloads/details.aspx?familyid=2274A0A8-5D37-4EAC-B50A-E197DC340F6F&displaylang=en

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.

Cloud Service Mgmt Screen Shot

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).

Publish Cloud Serice Screen ShotNext, 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.

Getting Started with Microsoft Azure

Filed under: Technical Article — Bruce Johnston @ 12:51 am

To get started using Azure, Microsoft’s Platform as a Service cloud offering, you need to set up a subscription. Having a subscription enables you to set up projects, and within the projects you set up the required services:

  • Windows Azure – storage, message queues, and hosting services for your applications
  • SQL Azure database
  • AppFabric access control and service bus

To set up the subscription visit this site as they currently have some introductory offers that give a bit of free time for experimentation (at least until the end of Oct 2010):

http://www.microsoft.com/windowsazure/offers/

Use your Windows Live ID to log in to the site with when purchasing a subscription.

If you are experimenting with Azure, I suggest selecting the “Introductory Special” that gives free time and storage. If you have an MSDN subscription there is another offer for that. Partners also get a special offer.

If you are working on a project, then review the rate schedule to see what the costs are and work out what fits your performance needs and budget. Of course, one of the features of cloud services is that you can easily scale them as required so you don’t have up front costs to face – but do be sure to work out what the eventual costs will be so that there are no unpleasant surprises on a future Visa bill!

The process for signing up to a subscription is quite straightforward. The main thing to be aware of is that it requires a CC number or a pre-authorized PO number. CC number is easiest to use for initial experimentation.

After completing the subscription process, set up a Project for yourself. The project is a wrapper that will be used to group together the resources that you are using to host an application (storage, compute, data).

Once you are in the project, you can start configuring the services needed, as follows:

Storage:

  • Windows Azure – click on “New Service”, then click on Storage Accounts (5 in the basic package). A storage account has a maximum size of 100TB.
  • Enter in the “Service Label” – the identifier that shows up in the Azure Developer Portal to identify the account
  • Enter in the “Service Description” – a text description of what it does
  • Click Next
  • Enter in the Endpoint name – this is the actual account name that is used when referencing it, and becomes the first part of the URL for accessing the service (e.g. http://ENDPOINT_NAME.blob.core.windows.net)
  • It also creates a .queue.core… and .table.core… at the same time with the same ENDPOINT_NAME
  • Also it generates the ACCESS_KEY that is  used to authenticate to the service (a big long string)
  • Enter in (or create) an Affinity group, and assign the service a geographic location to run (Asia, Europe, US – several) are the general areas. Future services you create will let you use the same Affinity group to automatically assign them  to run in the same area.

Compute (Hosted) Services:

  • Windows Azure – click on “New Service”, then click on Hosted Services (6 in the basic package). There are different size VM configurations for different load levels.
  • Enter in the “Service Label” – the identifier that shows up in the Azure Developer Portal to identify the account
  • Enter in the “Service Description” – a text description of what it does
  • Click Next
  • Enter in the Service name – this is the actual account name that is used when referencing it, and becomes the first part of the URL for accessing the service (e.g. http://SERVICE_NAME.cloudapp.net)
  • Enter in the Affinity group, and and it will assign the compute to servers that are geographically close to the storage services created above.
  • Later on you can define DNS alias’es to give the site a more meaningful name and to brand it as your own domain.

SQL Azure

  • Select SQL Azure to set up a database
  • Complete the username and password for DBA
  • Set any firewall restrictions to limit DB access
  • Create database(s) as required

To get started on application development, you will need Visual Studio, VS2010 is recommended.

You will also have to install the Windows Azure Tools for Microsoft Visual Studio 1.2 (June 2010) from:

http://www.microsoft.com/downloads/details.aspx?familyid=2274A0A8-5D37-4EAC-B50A-E197DC340F6F&displaylang=en

There is an article on the site that tells you how to install the SDK.

A very useful plug-in for Visual Studio that lets you inspect the Azure storage, tables and queue’s is AzureXplorer, from http://clumsyleaf.com/products/azurexplorer

It costs about $50US, but is great for debugging purposes as it lets you see what’s in the cloud storage, and also create and destroy objects without having to write your own code or use the developer portal.

My next post will go over deploying an app into the cloud from Visual Studio.

May 21, 2010

Hello world!

Filed under: Uncategorized — Bruce Johnston @ 4:56 am

Hello World! has been the classic output of the first program that student’s write when learning a new programming language, ever since it was popularized in the classic book “The C Programming Language” written by Kernighan and Ritchie, published  in 1978. (For the precise computer scientists out there, whose zest for absolute accuracy knows no bounds, it is more accurate to say that “hello, world\n” was actually the string printed by that first program in K&R).

Fast forwarding to 2010, it is interesting that WordPress, a State of the Art Cloud Service provider of blogging tools happens to use exactly that same phrase as the first blog post, to introduce new users to their personal blog!

Its intriguing to see that there are some things in the computing industry that haven’t changed, even after 32 years!

Of course, over the past 32 years a lot of things in this industry have changed, and this blog will be chronicling the promises and practices of one of those major inflections: namely Cloud Computing.

Stay tuned to this blog to share in the experiences of Ideaca Knowledge Services, where I am the Director of our Application Infrastructure practice, as we run across Rainbow’s, and potentially some Thunder and Lightning, in our exploration of The Cloud.

Create a free website or blog at WordPress.com.