Simple Lessons Learnt while playing with Azure Storage Types
I have been building an Windows Azure application in my spare time recently. During this process, I hit a few small hurdles. Fortunately, while attending the Brisbane BizSpark Startup Camp for Phone 7, also attending to help out the participants was Azure MVP Steve Nagy! Steve had a quick look through my app & very quickly helped resolve some of these issues – that now seem incredibly simple to me as well! I thought I would share them to perhaps save someone else the same trouble in future:
Lesson 1:
If you are going to attempt to use local development storage – ensure you have actually installed SQL 2005 or 2008 database! (You can download SQL 2008 R2 Express from here: https://www.microsoft.com/downloads/en/details.aspx?FamilyID=8b3695d9-415e-41f0-a079-25ab0412424b) As the local Development creates a local copy of the storage objects in SQL for you. Graham Elliott gave me this great link on getting your local Development storage set up: (https://msdn.microsoft.com/en-us/library/dd179339.aspx)
(Of course once you have your Development storage set up, don’t forget to set your DataConnectionString Settings to UseDevelopmentStorage=true)
Lesson 2:
Ensure your Key Fields do not include any disallowed characters:
Characters Disallowed in Key Fields
The following characters are not allowed in values for the PartitionKey and RowKey properties:
- The forward slash (/) character
- The backslash (\) character
- The number sign (#) character
- The question mark (?) character
(from https://msdn.microsoft.com/en-us/library/dd179338.aspx)
I had my RowKey as a http link – so as a work around, replaced any slash’s with a comma. Probably not the best solution long term, but it worked for my example.
Lesson 3:
Make sure your Queues meet the Queue Name Rules (mine had upper case letters!)
Queue Names
The queue name must be a valid DNS name, conforming to the following naming rules:
- A queue name must start with a letter or number, and may contain only letters, numbers, and the dash (-) character.
- The first and last letters in the queue name must be alphanumeric. The dash (-) character may not be the first or last letter.
- All letters in a queue name must be lowercase.
- A queue name must be from 3 through 63 characters long.
Once I had these three simple lessons addressed, the application kicked on fantastically!!
So reminder on the simple hurdles I have learnt from:
1. If you want to use the local development storage, ensure you have installed & configured a local installation of SQL 2005 or 2008.
2. Make sure your Row Key & Partition Key in Azure Tables do not contain any restricted characters
3. Make sure your queue names meet the Queue Name rules!