PDC ‘09: Three Screens and a Cloud, Pt. 1 - Azure

Microsoft's 2009 Edition of the Professional Developers Conference is officially over. The theme this year was "Three Screens and a Cloud," with the three screens being desktop, web, and mobile, coupled with the Azure cloud-computing platform. Here are some takeaways from this year's announcements. To make it a bit easier to digest, I’ll break this into two posts. This first will focus primarily on Azure (the “cloud” part of the vision), with the next focused on Silverlight 4 (one of the three screens in the vision). There were other technologies shown, but Azure and Silverlight dominated PDC this year.

Before I dive into all the Azure Goodness, let me revisit the rumor mill I posted here:

  • Internet Explorer 9. We got to see a preview of IE9. No download available yet, but the ACID 3 results were discussed (they’re not perfect, but test scores went from 20/100 with IE8 to 32/100 with IE9). new features were demo’d (such as the new font rendering engine and Javascript engine).
  • Silverlight 4 This rumor was spot-on, but the announcement didn’t come until Day 2. A developer preview is now available here. Silverlight 4 seriously ups the ante against AIR and Flex, and further reduces the need for a full WPF application, now that a Silverlight app can extend beyond the browser sandbox, access local resources (such as USB, webcams, and microphones), and supports printing.
  • Windows Mobile 7. Well, we heard about Windows Mobile 7 in the keynote, but nothing specific was announced – we’ll have to wait for MIX 2010. There was a subtlety in one of the keynote slides, showing Silverlight spanning all three “windows” – so, I suspect we’ll see a sneak peek of Silverlight 4 running on WinMo 7 at MIX, along with WinMo 7 hardware requirements.
  • Azure. As you’ll see below, Azure dominated the first day of PDC, with a bunch of announcements.

 

Ok, time for Azure…

About a year ago (at PDC ‘08), Microsoft introduced Azure, their cloud computing platform. Since then, the tools and SDKs have gone through numerous revisions (including several SDK updates, new or updated APIs, and the occasional removal of in-flux features such as workflow, logging, and Live Mesh integration). This week, Microsoft announced the commercial availability of Azure, slated to go live in January, with customer billing commencing in February.

PDC’s Day #1 keynote and sessions were dominated by Azure. It was an avalanche of announcements:

  • Go-live and first-month free. Azure will be live starting January 1 2010. For the month of January, all usage will be free, and customers will receive a bill showing their usage and cost breakdown, to help project actual costs. Billing goes into effect February 1.
  • Codename Sydney. Sydney, arriving in 2010, provides a simple way to securely connect Azure services to on-premise resources, such as databases. Prior to Sydney, the Service Bus was the primary enabler for on-premise access.
  • Codename Dallas. Dallas is Microsoft’s new information marketplace, or “data as a service.” Data can be published to the cloud, and subscribers can easily consume this data. This service won’t be commercially available until some time in 2010. For now, the published data sources are free. The API is REST-based. Microsoft’s Dallas portal is now online.
  • Microsoft PinPoint. PinPoint is a new online catalog of companies that are available to help build applications and services. PinPoint is integrated into both the Azure portal and the Microsoft Partner network.
  • AppFabric. AppFabric is essentially the new brand name for .NET Services and incorporates features previously seen in Codename Dublin  and Codename Velocity (essentially a caching engine). It encompasses access control and service bus configuration. A beta release, installable on Windows Server 2008, provides a complete management interface built into IIS, that provides configuration and monitoring for WCF, Workflow, caching, multi-tenant, access control, and service bus.
  • Multiple Virtual Machine Sizes. Customers will now be able to deploy instances of their application to differnt VM sizes:
VM Size CPU cores
(1.6GHz)
Memory (GB) Local storage (GB) Cost (per service hour)
Small

1

1.7

250

$0.12

Medium

2

3.5

500

$0.24

Large

4

7.0

1000

$0.48

ExtraLarge

8

14.0

2000

$0.96

  • Custom Virtual Machines and Remote Desktop.  In 2010, Microsoft will provide a choice of Virtual Machines to provision. Customers may then tailor these VMs via Remote Desktop (with full admin privileges!), save a snapshot, and use the customized VM for future provisioning.
  • Visual Studio 2010 Integration. VS10 will ship with integrated Azure tools. The SDK may be downloaded now, which works with both Visual Studio 2008 and Visual Studio 2010. We were given a glimpse of an unreleased Azure Application Model project which allows existing applications and services to be easily added to Web Roles and Worker Roles just by dragging the project files to Web Role and Worker Role containers on the Application Model design surface (this was an amazing demo, and should really simplify the migration of apps to the cloud).
  • Azure language support. Azure apps are now supported in a broad set of tools and languages: PHP, FastCGI, Java, and MySQL just to name a few.
  • Azure monitoring. Microsoft System Center will now run in Azure, and will monitor Azure applications (SLA, availability, etc.). We’ll see this in 2010. There’s also an Azure Diagnostics Management API included in the Azure SDK.
  • Storage replication. Azure data will now be geo-replicated across pairs of data centers, going live in January: Chicago/San Antonio, Dublin/Amsterdam, Singapore/Hong Kong. All data centers are based on a container design.
  • Azure Data. Azure data storage received numerous enhancements, including entity group transactions, snapshots, block blobs, page blobs, leases, shared access signatures, custom domain names, and content delivery network. A new site, OddlySpecific.com, is an example of a site running in Azure, based on Azure blob storage and SQL Azure.
  • Azure X-Drives. Probably the biggest announcement around Azure data: the ability to mount an X-drive storage blob as an NTFS volume.
  • SQL Azure. SQL Azure is the new name for Azure’s cloud-based relational database. There’s now support for T-SQL, ADO.NET, PHP, JDBC, Excel, for example. While still in CTP, a few customers are now officially live, including Automatic, the makers of WordPress. Their WordPress platform is now Azure-hosted.

I think that covers the bulk of Azure announcements.

PDC '09: What will we learn?

I'm camped out just outside West Hall A in the Los Angeles Convention Center. Behind me, there are already at least a hundred people lined up to get into the hall, which doesn't open for another hour. The rumor-mill is buzzing with speculation about what we'll see this week.

I'll post updates here as the keynotes today and tomorrow unfold. However, I do want to mention three four product announcement rumors that are gaining legs:
  • Internet Explorer 9
  • Silverlight 4
  • Windows Mobile 7
  • Azure (ok, not really a rumor - this is scheduled to be launched today)
I attended a pre-conference party last night where several Microsoft employees were present. Funny how nobody there could confirm nor deny any of these announcements. However, I did run into someone in the hotel lobby last night (a UK-based Mobile developer) who insisted I keep the faith, and that Windows Mobile 7 is "going to rock!"

Usability and Touch

With the additions of the Windows Touch API into Windows 7, a developer now how has a brand new way of soliciting input into his or her application. However, there are usability considerations which are needed. Some UI designs which make sense in a keyboard / mouse world will need to be adjusted for touch scenarios, and I’ll attempt to address some of them below.


Are the controls big enough?
When putting controls on your form or canvas, remember that your user’s fingers have to be able to touch it without accidently activating the wrong control. Consider the following screenshots of a music player.



image image(the height of the picture was altered to fit better in the post).



Notice how the buttons are too close together. I can say first-hand that touching the pause button often misses and accidently skips to the next track. A better approach for touch would be make the buttons larger and perhaps space them out a little more. Also notice the scroll bar width. It is not really wide enough for a user to easily scroll through options.



Is there too much ‘stuff’ on the screen?
It is very easy to fall into the trap of trying to make an application have a tremendous amount of functionality and putting it in as little space as possible. Many times, this is done to minimize the number of ‘clicks’ a user needs to do. In doing this, we tend to forget is that the purpose of minimizing clicks is to make an application easier to use. Users will often be more than happy to perform another click (or touch in our case) if it makes the application more intuitive. Make sure that the screens in your touch application don’t have too much ‘stuff’ on each one and to present information in a way readable to your average user.


Are extra visual clues needed?
One technique designers use to follow the “less is more” principle is to hide functionality until it is needed. In the screenshot below, the column resizing markers are hidden until the mouse pointer is hovering over the column resizing row.



image



In a touch screen, hardware might not be present to simulate “hover” functionality. This leaves the user to use trial-and-error in order to find where to resize the column. That is, if they’re aware they can resize it in the first place! (See the little lines between the heart and the MP3 player icon? That's the column resizing area. Now imagine trying to touch a screen to resize it!) This issue can be minimized in touch programs by not using hover-based (mouse over) functionality. Alternatively, provide an alternative means to do the same thing.



Can less traditional controls be used?
Maybe there are better ways of handling application function by using less of the traditional controls. Here are some examples of this technique.


image image



Note how the application allows for buttons at the bottom (stylized like a DVR remote control), but also has touchable album art which yields more information. Although it is hard to see from the image, there is plenty of space for someone to touch the desired action, with much less chance of accidently touching the wrong area.


Can the user touch where they need to?
A user often can’t touch areas right at the edge of the screen. With the TouchSmart tablet I use, there is an area of plastic around the screen which makes it difficult to touch the Close Window icon (X in the upper right hand of a window) along with any vertical scroll bars usually placed on the right hand side of a window. Make sure to provide extra space to compensate for physical limitations.


These are just some basic questions that should be considered when making an application which uses touch functionality. Additionally, be sure to review the Windows User Experience Interaction Guidelines when designing your application as well. By following these steps and using common sense, you can provide a pleasant, enjoyable, and above all, usable application for your end users.

Hosting WCF Services in Windows Azure

So you want to host a Windows Communication Foundation (WCF) service in Windows Azure? Here’s how you do it. This post will describe the steps you need to get your WCF service up and running in Windows Azure. This walkthrough assumes you are already familiar with the basics of WCF services. Hosting your services in Windows Azure has the benefit of you not having to provide the hardware for hosting your service and you can instead rely on Microsoft providing that capability for you.

Be sure you have the latest version of the Azure CTP installed and are running Windows Vista or Windows 7. Spin up Visual Studio 2008 in Administrator mode. You’ll want to be sure be sure the latest version of the CTP is installed. In this case I will be using the July 2009 CTP.

Begin by creating a Cloud Service solution. For the purpose of this demo, we’ll name it ‘AzureHostedWCF’.



When the dialog prompts you to create a new cloud service project, add a new ASP.NET Web Role project:

The web role is required as part of the cloud service.

Next, add a new Item to the web role project, namely a WCF Service item, called ‘TestWCFService’. For the purpose of this demonstration, we’ll augment the service interface as follows:

using System;

using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WebRole1
{
[ServiceContract]
public interface IService1
{
[OperationContract]
string TellUserCurrentTime(string name);

}
}

The implementation looks like this:

using System;

using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WebRole1
{
public class Service1 : IService1
{
public string TellUserCurrentTime(string name)
{
DateTime now = DateTime.Now;
return string.Format("Hi {0}. Currently it is {1} {2}.",
name, now.ToShortDateString(), now.ToShortTimeString());
}
}
}

This service is very barebones for the purpose of this demonstration. Compile to make sure there are no errors. Right click on the cloud project (‘AzureHostedWCF’) and ‘Set as Startup Project’. Start the project in debug mode. In the browser window that opens, add ‘Service1.svc’ to the URL (the full URL in my case is http://127.0.0.1:81/Service1.svc ). This will show you that the service has been successfully created and hosted in the Azure development fabric. The development fabric simulates the Windows Azure fabric on your development machine for testing before you code is deployed.


Now that we have confirmed that the service is working in the development fabric, we are ready to publish the service to Azure. Right-click on the cloud project (‘AzureHostedWCF’) and select ‘Publish’. You will notice two things happen. First, a browser window is opened for the Windows Azure portal. Second, an explorer window is opened showing the package file and the configuration file for the cloud service. What we need to do is upload that package to Azure so it can be deployed.

Create a new hosted service in Windows Azure, we’ll call it AzureHostedWCF. Provide a description if you choose, then click the ‘Next’ button.



On the following screen a public service name needs to be provided, which is globally unique. Again, we’ll use AzureHostedWCF for the public name of the service. This can be anything you like.

Also, a region needs to be selected. For the purpose of this demonstration, we will select the ‘North Central US’. A discussion of Azure regions is beyond the scope of this demonstration. Once you have entered the information, click the ‘Create’ button.



Next, we are presented with a screen to deploy the service. Click the ‘Deploy’ button in the middle of the screen. Earlier in the Azure CTP, packages first had to be deployed to staging before they could be pushed to production. That process can now be bypassed and packages can be directly deployed to Production. Clicking on the left-facing arrow below highlighted in red will show the staging environment deployment.



On the following screen you are asked to select the application package and the configuration settings files. These are the same files that opened in the explorer window above. Locate the files and select them. You also need to add a deployment label for this service. We will use 1.0 for the purposes of this demo. Click ‘Deploy’ when you are ready.



It will take a couple of minutes for the package to deploy in Azure. When completed, you will be presented with the following screen:



Click the ‘Run’ button to start the service. Again, the package will take a few minutes to be deployed. The progress indicator under the web role name will go from a blue dot indication of ‘Stopped’, to a yellow dot indication of ‘Initializing’ and finally to a green checkmark of ‘Ready.

Once the service is ready, click on the web site URL. When the URL opens in the browser, add the service name to the end of the URL. In this case, the URL will be: http://azurehostedwcf.cloudapp.net/Service1.svc. You’ll notice the service page is now displayed.

Now we want to test that the service is properly hosted and can be consumed from Azure. Create a console test project. Add a service reference to the URL. Notice that it can’t be done. Click on the WSDL link in the above screenshot. Again, it doesn’t appear to work. There is a known bug with Azure where a proxy cannot be created from the Azure hosted service. The workaround is to create the service reference using the service hosted in the development fabric, then change the URL reference to point to the service hosted in Azure. So, go back to the ‘AzureHostedWCF’ solution, start debugging and open the service in a browser window. Now go back to test project and add a reference to the local service providing whatever namespace you choose. The code to call the service should look something like this:

using System;

using ConsumeAzureHostedWCFR.AzureHostedWCFService;

namespace ConsumeAzureHostedWCF
{
class Program
{
static void Main(string[] args)
{
Service1Client client = null;

try
{
client = new Service1Client();
string time = client.TellUserCurrentTime("Greg");

Console.WriteLine(string.Format("The service responded with: {0}", time));
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(string.Format("{0}\n{1}", e.Message, e.StackTrace));
}
finally
{
if (client != null)
client.Close();
}
}
}
}

Finally, go into the web.config of the test project and update the address of the service endpoint to http://azurehostedwcf.cloudapp.net/Service1.svc. The node in the web.config file will look like this:

<client>

<endpoint address="http://azurehostedwcf.cloudapp.net/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1" contract="AzureHostedWCFService.IService1"
name="BasicHttpBinding_IService1" />
</client>

The output of the service call looks something like this:

This is a very simply example of an Azure hosted WCF service. More complicated services are deployed to Azure in much the same way. Go forth and deploy your WCF services to Azure!