Hello App Engine
Yesterday morning I saw the news that Google App Engine was now open for Java as well as Python applications – in beta, that is. I signed up and received notification of access almost immediately. I read the notes on getting started with Eclipse. Fortunately I already have Eclipse installed. I just needed to run Eclipse, and enter the URL of the Google plug-in into the software update configuration dialog. The plug-in downloaded and installed in a few moments. Then it is a matter of File – New – Other and select Google Web Application Project. Enter a project and package name, click Finish.
The wizard creates a skeleton Java Servlet application. I made a few trivial modifications to both the servlet code and the home page. Clicked Run, and the app runs on a local server. It worked. Next, I needed to deploy it. I signed into my App Engine console, and created a new application. I had to find a name that was not yet taken, and selected javaisgo. This generates an application ID. I copied this into the appengine-web.xml file which the Eclipse wizard had generated. Then I hit Deploy App Engine Project in the toolbar. I was prompted for my Google account name and password, the application uploaded, and it was done; you can see the results at http://javaisgo.appspot.com/.
Although Python is dynamic and fashionable, Java is probably the world’s most popular language for business development. I expect the ability to create and deploy applications so easily and for free will be attractive to many, leaving aside anxiety about Google’s plans to take over the Internet.
Hello Windows Azure
All this reminded me that although I had signed up for the Windows Azure CTP (Community Tech Preview) a while back, I had not got round to deploying a web application. I did deploy a Mesh-Enabled Web Application, part of the Live Framework, a process which I found frustrating and ultimately disappointing. That is a different kind of thing though; whereas an Azure ASP.NET application takes a similar approach to that of Google App Engine – write your web application, deploy to the cloud provider’s servers.
I already had an Azure account and developer token; how long would it take to deploy a Hello World project to Azure? Well, first you have to install the Windows Azure Tools for Visual Studio. I tried running this, but the dependencies were not in place. Although I already had Visual Studio 2008 SP1, SQL Server, and .NET Framework 3.5, I needed to add IIS 7.0 with ASP.NET to my development machine, and to configure the .NET Framework to support WCF HTTP Activation, which is off by default. See here for details. I did all this and the tools installed. The SDK also gets installed. When you build and run the samples, it starts up two new services on your machine, Development Fabric and Development Storage.
Next, I started Visual Studio, which apparently has to be run with full local admin rights for Azure to work. New project, Visual C#, Cloud services, Web Cloud Service (essentially an ASP.NET application). This looked familiar, and I quickly added a button and an event handler to make sure it worked. When you debug, it runs on the local development fabric.
Time to deploy. This is where I ran into some difficulties. I logged into the development portal and created a new Hosted Services project, called Azure is go. Next, I went back to Visual Studio and used the Publish wizard. Note: you must not use Publish from the Build menu, as this does not work. You need to right-click the solution in the Solution Explorer and choose Publish from there. This compiles two files, a .cspkg which contains your application, and ServiceConfiguration.cscfg which is configures it.
The wizard is disappointing: it merely opens an Explorer window showing your deployment files, and opens the Developer Portal in a web browser. You deploy your project to a Staging area; then when you are happy with it, hit Promote to copy it to the production URL. In order to deploy, you have to select the two deployment files manually in a web upload dialog. The reason the Wizard opens the Explorer window is to show you where they are so you can copy the path. All rather clunky, though not difficult.
After I did this, the Developer Portal displayed a spinning bagel and the words Package is deploying; then eventually it said Allocated. I hit Run, and it said Initializing. Nothing seems to happen quickly with Azure. It said Initializing for a long time; I got bored and hit Refresh. This may have been a mistake. My Staging icon went red and I got a message: InternalServerError – Information is not available.
I decided to delete the deployment and retry. I clicked Delete, whereupon Azure told me it couldn’t delete the deployment because “tenant status is currently Running”. That almost seemed hopeful; yet the test URL still did not work. I clicked Stop – pause while it stops – then Delete – pause while it deletes – then re-compiled and re-deployed.
My second effort worked, after the usual pauses. I then selected Promote and the application arrived at its final URL: http://azureisgo.cloudapp.net. As with App Engine, it is good to know that your web site is running on a scalable data center rather than on a single machine or virtual machine, and currently without any cost.
These hello world experiences may not seem important later, when you are buried in the intricacies of a real application, but they do have an impact on your desire to explore and experiment with a new platform. Judging from my own experience, getting started with Google App Engine is easier than it is with Azure, even for a Windows developer already set up with Visual Studio. The long pauses as Azure thinks about deploying your project also make a bad impression, in contrast to App Engine’s near-instant response. Maybe it will all come right with Visual Studio 2010 and the final release of Azure. In the meantime, this does nothing to shake my feeling that Microsoft’s Azure launch needs attention if it is to win developer mindshare.