2012-11-20 189 views
5

當我嘗試在Table Storage中創建表(使用Azure本地存儲器模擬器)時,出現錯誤「遠程服務器返回錯誤:(400)錯誤的請求。錯誤的請求 - 在Azure本地存儲器中創建表

表的名字是根據規則,所以會發生什麼?!

角色配置:

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

創建表法:

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

CloudTableClient tableClient = storageAccount.CreateCloudTableClient(); 

CloudTable table = tableClient.GetTableReference("people"); 
table.CreateIfNotExists(); 

回答

6

什麼版本的SDK您使用的是?如果您正在混合Storage Client Library 2.0和舊版SDK(1.8之前版本),則仿真器有問題。我碰到了這個問題,以及並確保我所用的StorageClient 2.0庫,並在Azure SDK 1.8:

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

編輯:有可能的方式來得到它與混合Azure的SDK存儲API的工作,但這是一個簡單的解決方案(解決方法)。

4

如果表名無效(例如名稱中的下劃線),至少Azure SDK的回覆帶有相同的錯誤消息(400錯誤的請求)。

0

如果表名具有下劃線(_)。它引發同樣的異常。我得到同樣的錯誤,我刪除了下劃線,它完美地工作。

相關問題