Getting the Windows Azure WP7 Toolkit demo to work

Posted: May 9, 2011 in Mobile

With Windows Phone 7, we have always been encouraged to think of a mobile solution to be not just the one that runs as an app on the phone; it can be so much more. Modern smartphones, as highly as we think of them, are still not very powerful devices and one always has to think of preserving memory/battery life when delivering a solution on the phone. What if the mobile app could be enhanced with backend services which feed the client? That way, the phone app can do less of the computing/polling and depend on the backend services. Makes sense. However, this leads to the obvious question — where to host the backend services? True, any hosting provider should work; but there are configuration steps to host the applications & supporting data, not to mention cost. How about the cloud?

Enter Windows Azure Toolkit for Windows Phone 7 ! This is a really nice toolkit that makes it easy for WP7 developers to leverage the Azure cloud for their backend processing. This effort has been spearheaded by Wade Wegner (@WadeWegner) and the toolkit built with the help of Azure & Windows Phone teams. So it is pretty cool & works as expected 🙂 Off course, one can hand-code and deploy supporting services & data to Azure; this toolkit just abstracts out the Azure stuff for WP7 developers who do not want to dabble much into Azure. Also, Azure as a cloud computing platform is perfectly capable of serving other mobile platforms like iOS & Android. In fact, just today, the Azure toolkit for iOS was released! This should be helpful for iOS developers looking to “cloudify” their apps. An Azure toolkit for Android is also in the works .. all good stuff. Also, with the recent upgrades to MSDN licensing terms, one should be able to host a service in a decent sized Azure instance & have supporting application data to go with it. I have had several running 24/7 for more than a month; and unlike in the past, I am still within the limits of usage. Off course, this varies with MSDN licenses; so definitely check your subscription details for storage/bandwidth restrictions. Also, there may be a few gray areas if one is making money off a mobile app with services in Azure, using employer-bought MSDN license. So, all I am saying is we have enough limits to play around Azure; but just double-check pricing for commercial usage.

So, if you want to get started with the Azure Toolkit for WP7, head over (here) for the binary/sourcecode download & documentation. Please follow instructions on how to install the toolkit & its dependencies. The installed project templates are pretty cool; if you pick the Windows Phone 7 Cloud Application template, you get an Azure project with web roles & services configured, as well as a WP7 client to interact with the services in Azure. Again, please follow the “Getting Started” instructions as they are pretty clear.

However, I for one, ran into a few issues running the demo application in the project template. I figured stuff out after reading some of the discussion threads & searching around. Just hoping to save someone a few frustrating minutes:

  • If you simply hit F5 on the templated solution, the Windows Phone & Azure compute emulators come up. The Storage Azure emulator may or may not come up based on whether you chose to use local storage as compared to Azure storage with key.
  • The MVC2 application for Admin services should also come up in the default browser.The admin services that run in local IIS on behalf of the Azure compute emulator use a local certificate for HTTPS connection. And the default port for HTTPS in IIS is 443 and that is how the application is configured.
  • However, you might notice that the MVC2 app is not running off port 443 and erroring out. This is possible because 443 is also the default port for HTTPS in IIS and may already be in use by the Default Website. So, head over to the IIS Management console, find the Default Website and check if it is taking up the 443 port under default Application Pool. If so, simply stop the site.
  • Next, we keep trying to recreate the Azure instance of the application until it runs on the right ports (usually does so on first try after you free up port 443). Check the Azure Compute Emulator and the specific service to make sure the right ports (443 & 10080) are in use. If not, we shut down both Azure emulators & restart the instance until we get this right. Please see the troubleshooting section in the toolkit documentation or Michael Collier’s post (here).
  • Once we have gone past the port issue and accepted the local signed certificate, you might still see a blank page at http://127.0.01/. This may be because of your IIS settings. So, we head over to the Control Panel –> Add/Remove Windows Features. The following features should be installed (you could go one-at-a-time-trial or install everything in one scoop):
  1. IIS–>Web Management Tools–>IIS Management Scripts & Tools
  2. IIS–>WWW Services–>App Dev Features–>.NET Extensibility
  3. IIS–>WWW Services–>App Dev Features–>ASP.NET (Doh)
  4. IIS–>WWW Services–>App Dev Features–>Server-Side Includes
  5. IIS–>WWW Services–>Common HTTP Features–>HTTP Redirection
  6. .NET 3.5–>WCF HTTP Activation

That’s it. Stop & restart everything and the demo application should start working! Now, let’s build some WP7 apps that use Azure. I have also been dabbling with ACS in Azure to provide a secured way authenticated users could interact seamlessly with their data on the phone & in Azure. Glad to know that in the next iteration of the Azure Toolkit for WP7, ACS will start working out of the box.

Hope this helps!

Adios

Advertisements
Comments
  1. Wade Wegner says:

    Thanks for putting together such a great post!

  2. […] Windows Phone 7 Love & .NET Ramblings With Windows Phone 7, we have always been encouraged to think of a mobile solution to be not just […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s