I am trying to simply create a new Storage Queue with Azure but it keeps crash without explanation, creating tables worked just fine, this is the relevant code:
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.
}
Code crashes in line healingQueue.CreateIfNotExists();
with the explanation of (400) bad request
Tables are created just fine so I assume there is no problem with the storage account, any ideas what I can do?
The problem is in the following line of code:
healingQueue = queueClient.GetQueueReference("healQueue");
Essentially the reason you're getting this error is because you are choosing an invalid name for a queue. Try using healqueue
(all lowercase).
Please see this link for Queue naming rules: https://msdn.microsoft.com/en-us/library/azure/dd179349.aspx.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With