views:

20

answers:

2

Exception of type 'Microsoft.WindowsAzure.StorageClient.StorageClientException' was thrown.

Sometimes even if we have the fabric running and the role manager is up, we get an exception of this sort.

The code breaks at the line emailAddressClient.CreateTableIfNotExist("EmailAddress");

 public EmailAddressDataContext(CloudStorageAccount account) :
            base(account.TableEndpoint.AbsoluteUri, account.Credentials)
        {
            this.storageAccount = account;

            CloudTableClient emailAddressClient =
                new CloudTableClient(storageAccount.TableEndpoint.AbsoluteUri, storageAccount.Credentials);
            emailAddressClient.CreateTableIfNotExist("EmailAddress");
        }
A: 

Easy fix is to change "EmailAddress" to "Emailaddress". For some reasons it would not allow CamelCasing. So please make sure, you just have one capital letter in the name of the table that too at the beginning. Since the table names are case insensitive, you can also name it as 'emailaddress'

Chander Dhall
A: 

I give Windows Azure tables camel-cased names all the time without issues.

I wonder if by chance you already used this table name and recently deleted it? For a time after deletion (when the table is still being deleted asynchronously), you won't be able to recreate it. I believe 409 Conflict is the error code to expect in that case.

smarx
Nopes. I recreated the issue after deleting the table name using Storage explorer. Same issue and same answer. What version of SDK are you using? Anyways, this worked for me and i blogged it as the exception is misleading. i would mark it resolved.
Chander Dhall
Yes, but the question is whether or not the delete actually finished in time. If you look at the detail of the exception (easiest to do by just running Fiddler), my guess is you'll see what the real error is.
smarx
It is part of my blog post where the first exception happens, which when fixed leads to another exception. Delete actually finished as i said i used the storage explorer so how could it not return the table if it was not deleted. it shows it as deleted. however, i understand what the problem is - i forgot to put the link to the blogs where this problem came in as a succession to the other problem. Read this http://weblogs.asp.net/chanderdhall
Chander Dhall
The blog post claims camel casing is the issue. I keep pushing back because I don't want future readers of this question to be misled.Table deletion is asynchronous... it will show as deleted right away, but if you try to recreate it before the deletion is complete, you'll get a conflict.
smarx