Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad request - Create Table in Azure Local Storage

When I try to create a table in Table Storage (using Azure Local Storage emulator) I get the error "The remote server returned an error: (400) Bad Request."

The name of the table is according the rules, so what can be happening?!

Role Configuration:

<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="StorageConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>

Create table method:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));

CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

CloudTable table = tableClient.GetTableReference("people");
table.CreateIfNotExists();
like image 428
Guilherme Ferreira Avatar asked Nov 20 '12 18:11

Guilherme Ferreira


People also ask

Is Azure Table deprecated?

Azure table storage is deprecated, but still in use by some organizations. Many organizations are still using Azure table storage because it is easy to use, and it has a lot of features. However, as Azure table storage becomes more difficult to use, organizations may want to look into alternatives, such as Cosmos DB.

What is the maximum amount of data that can be stored in a Azure table storage database?

An entity in Azure Storage can be up to 1MB in size. An entity in Azure Cosmos DB can be up to 2MB in size. Properties: A property is a name-value pair. Each entity can include up to 252 properties to store data.


1 Answers

What version of the SDK are you using? If you are mixing the Storage Client library 2.0 and the older SDK (pre 1.8) the emulator has a problem. I ran into this as well and made sure I was using the StorageClient 2.0 library and the Azure SDK 1.8:

http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/b1b66cc0-5143-41fb-b92e-b03d017ea3c1

Edit: There maybe ways to get it work with mixing the Storage API with Azure SDK, but this is an easy solution (workaround).

like image 138
Bart Czernicki Avatar answered Sep 21 '22 05:09

Bart Czernicki