Guy*_*she 4 azure azure-storage azure-queues
我试图用Azure创建一个新的存储队列,但它没有解释就一直崩溃,创建表工作正常,这是相关的代码:
private CloudTable userTable;
private CloudTable petTable;
private CloudQueue healingQueue;
public override bool OnStart()
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("connectionString"));
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
userTable = tableClient.GetTableReference("users");
userTable.CreateIfNotExists();
petTable = tableClient.GetTableReference("pets");
petTable.CreateIfNotExists();
// This is where I create the queue: //
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
healingQueue = queueClient.GetQueueReference("healQueue");
healingQueue.CreateIfNotExists(); // This line makes the code crash.
}
Run Code Online (Sandbox Code Playgroud)
代码崩溃符合healingQueue.CreateIfNotExists();
解释(400) bad request
表创建得很好所以我假设存储帐户没有问题,我能做什么的想法?
Gau*_*tri 21
问题出现在以下代码行中:
healingQueue = queueClient.GetQueueReference("healQueue");
Run Code Online (Sandbox Code Playgroud)
基本上,您收到此错误的原因是您为队列选择了无效的名称.尝试使用healqueue
(全部小写).
有关队列命名规则,请参阅此链接:https://msdn.microsoft.com/en-us/library/azure/dd179349.aspx.
归档时间: |
|
查看次数: |
1585 次 |
最近记录: |