Thursday, December 16, 2010

Strange Behavior of Windows Azure Platform Training Kit with Windows Azure SDK v1.3 under 64-bit Windows 7

Update 12/16/2010: WAPTK’s December 2010 Update solved most problems reported in this post. However, the following runtime exception occurs in the GuestBook_WorkerRole.WorkerRole.vb’s OnStart() function:

image

The DiagnosticMonitor.Start() method isn’t required with the Windows Azure SDK v1.3, so commenting the line highlighted above eliminated the runtime error. The uploaded image resizing is better, but unnecessarily increases the size of a small (50px) image:

image


Update 12/8/2010: Steve Marx (@smarx) described How to Resolve “SetConfigurationSettingPublisher needs to be called before FromConfigurationSetting can be used” After Moving to Windows Azure SDK 1.3 in a 12/8/2010 to his and the Windows Azure Team blog:

If you’re receiving this exception after migrating a web role from Windows Azure SDK 1.2 to SDK 1.3, this may have to do with changes associated with the new full IIS model introduced in SDK 1.3. This post will help you to understand the change and how to use the FromConfigurationSetting method correctly under the full IIS model. If you want to simply go back to using the Hosted Web Core model (as in previous SDK releases), you can do that too. …


Update 12/6/2010: Steve Marx suggested in a 12/5/2010 reply to my forum thread that I might have installed the VS 2008 version (WAPTKVS2008-August2010.exe) instead of the VS 2010 version (WAPTKVS2010-November2010.exe), so I repeated the installation with the following result:

I just renamed my old C:\WAPTK folder, downloaded WAPTKVS2010-November2010.exe to my ...\Downloads folder, and installed it to C:\WAPTK.

Results were exactly as before; failed to detect the Windows Azure SDK v1.3 installation and started the Upgrade Wizard. There might be something strange going on with my machine, but it's a new partition (not a VM) specifically for VS 2010 and Azure development with no related beta software installed.

Fernando Tubio observed on 12/6/2010:

From the screenshots in your blog post, I see that the problem you are having is in one of the demo scripts. The hands-on labs have been upgraded to 1.3 but the demo scripts still target 1.2. There's a note in the download page that mentions this but it's easy to miss.

That sounds like “not fully cooked” to me. The download page contains the following Overview paragraph:

The November update provides new and updated hands-on labs for the Windows Azure November 2010 enhancements and the Windows Azure Tools for Microsoft Visual Studio 1.3. These new hands-on labs demonstrate how to use new Windows Azure features such as Virtual Machine Role, Elevated Privileges, Full IIS, and more. This release also includes hands-on labs that were updated in late October 2010 to demonstrate some of the new Windows Azure AppFabric services that were announced at the Professional Developers Conference (http://microsoftpdc.com) including the Windows Azure AppFabric Access Control Service, Caching Service, and the Service Bus.

I assumed (wrongly) that all source code had been updated for SDK v1.3. The inclusion of a reference to the Microsoft.WindowsAzure.StorageClient v1.1 library (see the Solution Explorer screen capture below) led me to believe that the demo code had been updated.


After installing the Windows Azure Tools for Microsoft Visual Studio 2010 v1.3 (Vscloudservice.exe), which also installs the Windows Azure SDK v1.3, and checking its compatibility with a few simple Windows Azure Web-role apps, I removed the previous version of the Windows Azure Platform Training Kit (WAPTK) and installed the WAPTK November Update.

I had seen a few table storage issues with the instrumented version of the OakLeaf Systems Azure Table Services Sample Project updated to v1.3 and the Microsoft.WindowsAzure.StorageClient v1.1 [see below.] So I tried to build and run the WAPTK’s GuestBook demo projects on my 64-bit Windows 7 development machine with the default Target Framework set to .NET Framework 4.0.

Here’s what I encountered:

1. Clicking the Setup Demo link to run the Configuration Wizard’s Detecting Required Software step indicated that Windows Azure Tools for Microsoft Visual Studio 2010 1.2 (June 2010) or higher is missing:

image

Removing and reinstalling Vscloudservice.exe, and rebooting didn’t solve the problem. This issue might have contributed to the following problems, but a solution wasn’t evident.

2. Opening any of the GuestBook solutions launched the Visual Studio Conversion Wizard. Completing the Wizard resulted in no conversions made and one error reported:

image

3. Attempting to build the solution reported 13 errors and 3 warnings:

image

The actual result was 16 errors, most of which related to a problem with Microsoft.WindowsAzure.* libraries. References collections appeared as follows:

image

Update 12/6/2010 10:30 AM PST in reply to Steve Marx’s question about version numbers: The properties sheet for GuestBook_Data’s erroneous Microsoft.WindowsAzure.StorageClient library shows the version as 0.0.0.0; the GuestBook_WebRoles reference is to version 1.1.0.0.

4. Removing and adding the Microsoft.WindowsAzure.StorageClient reference to the GuestBook_Data library …

image

… removed only one “warning.” I needed to remove and replace the Web Role’s Microsoft.WindowsAzure.StorageClient reference to remove the remaining errors.

5. Building and running the solution resulted in the following run-time error:

image

I had encountered this run-time error in other solutions upgraded from SDK v1.2 to v1.3.

6. I added a reference to Microsoft.WindowsAzure.ServiceRuntime and the standard delegate block shown emphasized here:

image

With these additions, I was able to get the various GuestBook solutions to compile and run:

image

7. I reported these issues in an Are the Windows Azure Platform Training Kit Projects Fully Cooked for SDK v1.3? thread in the SQL Azure, Azure Storage & Data forum.

It seems to me that the WAPTK isn’t fully cooked. Adron Hall (@adronbh) reported Windows Azure v1.3 SDK Issues on 12/3/2010 and Rinat Abdullin recommended that you Don’t Upgrade to Windows Azure SDK 1.3 Yet in a 12/3/2010 post. Both of these articles were excerpted in my Windows Azure and Cloud Computing Posts for 12/4/2010+ post (scroll down).


The most mysterious run-time error I encountered when updating the OakLeaf Systems Azure Table Services Sample Project to v1.3 was the following …

image

… associated with starting the Diagnostics Monitor by a procedure in the Global.asax.cs file. This issue turned out to have been caused by inadvertently setting the WebRole1 as the startup project instead of SampleWebCloudService.

1 comments:

Steve Marx said...

I can't reproduce the issues you describe with the Platform Training Kit. As to the Diagnostics issue, it sounds like you're trying to start Diagnostics the old (1.2) way instead of as a plugin the way 1.3 works? That code might work fine in WebRole.cs, but in the code run by IIS, you're in a different process and running as a different user, so the permissions error may be exactly what it seems.