Friday, December 23, 2011

Queue names restrictions on Azure Storage

We got the exception “One of the request inputs is out of range” using a queue to link web and worker roles on Azure. Of course my little prof-of-concept test with code copy-and-pasted from the Azure Tranning Kit ran ok, but the (almost) same code on my app did not. After some time I noticed that the exception was generated when I used upper-case letters on the queue name. Well, the rules for naming queues on Azure are here, but basically they are:

  1. Names can be made of letters, digits and the dash char (-).
  2. First and last chars must be letters ou digits. Consecutive dashes are not allowed.
  3. All letters must be lower case. (Come on, man. You have this kind of restriction and it’s not documented on the API help? Put it in the CloudQueueClient constructor, or in CloudQueueClient.GetQueueReference(), which receives the name of the queue, or at least in CloudQueue.CreateIfNotExists(), since this method creates the queue… :-P)
  4. The queue name length must be between 3 and 63 chars.

No comments:

Post a Comment