My challenges in upgrading my Windows Azure App from SDK 1.2 to 1.3 - More Wally - Wallace B. McClure
in

MoreWally.com

Giving people what they want, More Wally. This is the technical and personal blog site of
Wallace B. (Wally) McClure.

This Blog

Syndication

News

Please goy buy 3-4 copies of my book on MonoTouch titled "Professional Android Programming with Mono for Android for .NET/C# Developers." They make great gifts all year round. Plus, I get about $.25 when you buy a copy.

Technical Sites

More Wally - Wallace B. McClure

This blog will have all kinds of posts about Wally McClure. In it, there will be tons of .NET and computer programming posts as well as Wally's views on life in general. As you might guess, this site and blog help you get More Wally in your life. What more could anyone want? iPhone, Android, MonoTouch, MonoDroid, Mobile, HTML5, .NET, ADO.NET, ASP.NET, AJAX, jQuery, jQuery Mobile, ASP.NET AJAX, and Windows Azure............follow me on twitter at Wally

My challenges in upgrading my Windows Azure App from SDK 1.2 to 1.3

I finally got around yesterday evening to updating my Windows Azure Application from the 1.2 SDK to the 1.3 SDK.  Wow, what a fun strange trip that was.  Yes Virginia, it is possible to upgrade.  I ran across the following two issues:

  • Don't try to use beta features if you aren't signed up for them.  Ok, this one should have been obvious, unfortunately, it wasn't.  What was my first thought when I started my upgrade? Of course, it was to try out the ExtraSmall VM.  So, I plugged that into my .csdef file..........and my deployment promptly died with no info as to what had happened beyond some cryptic messages.  Finally, I dug through and figure out that the "Windows.Azure.......PassWord.Encryption.........IDonCareWhatYouTriedToDoException" meant that my app did not have the ExtraSmall VM beta allowed on Azure.  I went back to the Small VM Size to deploy my app with, and the app deployed.  Problem #1 solved.
  • Did I test my app after I deployed it?  Of course not.  Its my test app. There are a few users, but nothing huge.  I logged in this morning, and bomb, the app died.  WTF had I done?  WTF was broken due to moving from 1.2 to 1.3?  I was getting this error

    “SetConfigurationSettingPublisher needs to be called before FromConfigurationSetting can be used”


    I looked at the error, set some break points and ran locally. Boom, it didn't work here either.  Great, what was wrong.  Finally, I found the answer. The change to using the Full IIS7 instead of the Web Core had introduced a breaking change in the app.  So, I copied some code from my WebRole.cs to my Global.asax and things worked.  Sweetness.  Here is the code, it will look a little familiar to someone developing in Azure.
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            CloudStorageAccount.SetConfigurationSettingPublisher(
                 (configName, configSettingPublisher) =>
                 {
                     var connectionString = RoleEnvironment.IsAvailable
                     ? RoleEnvironment.GetConfigurationSettingValue(configName)
                     : ConfigurationManager.AppSettings[configName];
                     connectionString = RoleEnvironment
                              .GetConfigurationSettingValue(configName);
                     configSettingPublisher(connectionString);
                 });

            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
            RoleEnvironment.Changing += RoleEnvironmentChanging;

        }
        private void RoleEnvironmentChanging(object sender, RoleEnvironmentChangingEventArgs e)
        {
            // If a configuration setting is changing
            if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))
            {
                // Set e.Cancel to true to restart this role instance
                e.Cancel = true;
            }
        }

Now, my Azure app is back running and chugging along. Hopefully, this helps you out some.

Comments

 

Twitter Trackbacks for My challenges in upgrading my Windows Azure App from SDK 1.2 to 1.3 - More Wally - Wallace B. McClure [morewally.com] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 My challenges in upgrading my Windows Azure App from SDK 1.2 to 1.3 - More Wally - Wallace B. McClure         [morewally.com]        on Topsy.com

December 10, 2010 11:50 AM
 

Dew Drop – December 11, 2010 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop – December 11, 2010 | Alvin Ashcraft's Morning Dew

December 11, 2010 8:20 PM
2006 - Wallace B. McClure
Powered by Community Server (Non-Commercial Edition), by Telligent Systems