Beware of Using Memory Storage With The ASP.NET Chart Control In Windows Azure With Multiple Instances of Your WebRole

April 12 2010

In the documentation here: http://blogs.msdn.com/deliant/archive/2008/12/02/managing-chart-generated-images-with-chart-image-handler.aspx on the ASP.NET Chart Controls, it states:

Do not use this [the memory storage] option in a server cluster or a multiple-process site.

Well, if you have multiple instances of your web role in Windows Azure, this is gonna get you.  It got me. But hats off to the Windows Azure for actually simulating multiple instance in my development fabric -- didn't realize they did that.

 

Rhizotron

April 8 2010

I'm not sure exactly what the rhizotron is, but I feel some kinship and connection to it. And it sure looks rad.

from http://www.flickr.com/photos/its_gem/4179999304/ 

Presenting at MIX10 - Incarnate: Behind the Scenes

March 2 2010

My session at Mix has been posted:

Incarnate: Behind the Scenes

A recent MIX Online lab, Incarnate is a service that finds your avatars around the web, so you don't have to upload a new one every time you join a service or leave a comment. Behind the scenes, Incarnate is a service hosted in Windows Azure with a WordPress plug-in. In this session, we dive into some of the more interesting aspects of Incarnate, including how microformats are used to discover avatars, the diagnostics and logging support in Azure, writing a JSON-P service in Windows Communication Foundation and writing the WordPress plug-in.

Lagoon AB on Tuesday at 11:35 AM, March 16

So, if you are interested in the nitty gritty on Incarnate, come on by. And if you'll be at MIX and want to catch up, let me know...

Presenting At Future Of Web Applications 2010 in Miami

February 12 2010

Just got confirmation that I'll be doing a presentation at the illustrious Future of Web Applications 2010 conference in Miami on February 23rd. Here's my talk:

How To Think About Services For The Open Web

Today, if you are building websites, you are probably using services from any number of web providers (Facebook Connect, Disqus, etc.). You might even be thinking about exposing some services yourself. There's a dizzying array of choices and protocols when it comes to actually dealing with services. You are expected to become savvy with JSON-P, OAuth, XML, SOAP and perhaps even screen scraping HTML. Based on years of experience with building and consuming standards based services, Karsten will review the matrix of options available to you with some practical advice.

Also, while it isn't listed on the agenda, I'm doing a session during lunch. Here's what it's about:

What’s Cooking in the Mix Online Labs

Mix Online creates free, open source, ready-to-use prototypes on emerging trends for web developers and designers. Past projects have included Oomph: A microformats toolkit and Glimmer: a jQuery Design Tool. Come get a special sneak peek into upcoming, cutting edge projects coming out of the Mix Online labs. 

If you are going to the conference or are in Miami, lemme know

 

BlogEngine.NET and Incarnate

February 5 2010

With the release of BlogEngine.NET 1.6, Incarnate is now supported.  Read all about it here: http://www.visitmix.com/LabNotes/Incarnate-Updates 

Skip, Take and Twitter Paging: Using TweetSharp To Download All Tweets from the Twitter Timeline

February 4 2010

I have been using TweetSharp lately and I am pretty happy with it so far. One thing that was a little confusing is how they implemented paging in their API on top of the Twitter API. 

What they did was to use the LINQ syntax (Skip and Take). Basically, think of Skip as the page number and Take as the number of records on a page. So, let's say you want to download all of a person's tweets. This assumes of course that you've already gone through the OAuth process and have permission to do so.  Twitter lets you download a maximum of 3200 tweets from a user, 200 tweets at a time.

So, the code to grab all of a user's tweets using TweetSharp would be as follows:

            for (int i = 1; i < 17; i++)
            {
                var query = FluentTwitter.CreateRequest()
                       .AuthenticateWith(_consumerKey,
                                         _consumerSecret,
                                         _accessToken,
                                         _accessKey)
                       .Statuses().OnUserTimeline().Take(200).Skip(i).AsXml();
                var responses = query.Request().AsStatuses();
                if (responses.Count() > 0)
                {
		    //do something with tweets
                }
                else
                {
                    break;
                }
	     } 

 So, what's going on here?  Basically I am attempting to download all 3200 tweets with a for loop, asking to take 200 tweets for each page, which is my counter. If I get less than 3200, I exit the loop, thus not unnecessarily calling the Twitter API (and increasing my chances of getting rate limited).

 

 

Putting Files at the Root of Blog Storage in Windows Azure

February 3 2010

Just learned today that by default you can't store files at the root in Windows Azure storage. So, what if you have http://foo.blob.core.windows.net which you've mapped to http://blob.foo.com and you want to put a file so that it resolves to to http://blob.foo.com/bar.png? Well you can create a special container called $root, which will map to the root.  If you do that, anything in the $root container will resolve as expected, so that http://blob.foo.com/bar.png would work.

If you are using Cloud Storage Studio, their UI supports this with the New Root Container option when creating containers.

 

Critical Hot Fix for Using Silverlight, WCF and Windows Azure

February 1 2010

I innocently added a Silverlight-enable WCF Service to my Azure application and then innocently generated a Service Reference for my Silverlight client. Everything worked fine on my machine; nothing worked once I uploaded it to Azure.  After going down a lot of wrong turns in figuring out what was wrong, I was able to use Fiddler to discover the following response from the service:

The message with To 'http://.../Service.svc' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.

This led me to the following hot fix: http://code.msdn.microsoft.com/KB971842.  After installing the hot fix, in order to get things working, I had to both add the following to my serviceBehaviors behavior:

          <useRequestHeadersForMetadataAddress>
            <defaultPorts>
              <add scheme="http" port="81" />
              <add scheme="https" port="444" />
            </defaultPorts>
          </useRequestHeadersForMetadataAddress>

And then I also had to add the following attribute to my service:

[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]

I then regenerated my proxy and, hooray, everything worked. More on this and other issues when using WCF with Windows Azure is explained here: http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues 

 

 

The Twitter API: The Schrodinger's Cat of Web Service APIs

January 25 2010

I just started reading Professional Twitter Development: With Examples in .NET 3.5 (Wrox Programmer to Programmer) and came across this quote, which cracked me up:

The Twitter API is the Schrödinger’s cat of web service APIs. Until you call it, you never know if it's alive or dead. Sometimes the mere act of calling it is enough to kill it.
--Scott Koon,Witty

Hilarious. And true.

The Importance of Using CNames with Windows Azure

January 22 2010

I recently had to move an Azure service from one account to another.  Unfortunately, they could not migrate my account, which meant that I manually had to migrate it.  In the case of the service, I had created a cname {name}.mysite.com that pointed to the Azure DNS name ({name}.cloudapp.net).  Lucky me: I was able to migrate the service and then repoint the CName to the same DNS entry with no changes or problems.  But in the case of my blob storage ({name}.blob.core.windows.net) I hadn't created a Cname, which means I manually have to update any reference to anything in blob storage. 

Lesson learned: use CNames for everything in Azure in case you need to transfer accounts, ownership, etc.

VSAchievements
Visual Studio Achievements
Karsten Januszewski (207 Points)