Create Queue (Azure Storage)
Create Queue operation creates a queue in a storage account.
You can construct the
Create Queue request as shown here. We recommend that you use HTTPS. Replace myaccount with the name of your storage account.
|Method||Request URI||HTTP version|
Emulated storage service request
When you make a request against the emulated storage service, specify the emulator hostname and Azure Queue Storage port as
127.0.0.1:10001, followed by the emulated storage account name:
|Method||Request URI||HTTP version|
For more information, see Use the Azurite emulator for local Azure Storage development.
You can specify additional parameters on the request URI, as shown here.
The required and optional request headers are described in the following table:
||Required. Specifies the authorization scheme, account name, and signature. For more information, see Authorize requests to Azure Storage.|
||Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authorize requests to Azure Storage.|
||Optional. Specifies the version of the operation to use for this request. For more information, see Versioning for Azure Storage services.|
||Optional. A name-value pair to associate with the queue as metadata.
Note: As of version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers.
||Optional. Provides a client-generated, opaque value with a 1-kibibyte (KiB) character limit that's recorded in the logs when logging is configured. We highly recommend that you use this header to correlate client-side activities with requests that the server receives. For more information, see Monitor Azure Queue Storage.|
The response includes an HTTP status code and a set of response headers.
A successful operation returns status code 201 (Created).
For information about status codes, see Status and error codes.
The response for this operation includes the headers that are described in the following table. The response might also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
||Uniquely identifies the request that was made, and you can use it to troubleshoot the request. For more information, see Troubleshoot API operations.|
||Indicates the Azure Queue Storage version that's used to execute the request. This header is returned for requests made against version 2009-09-19 and later.|
||A UTC date/time value that's generated by the service and that indicates the time when the response was initiated.|
||Can be used to troubleshoot requests and corresponding responses. The value of this header is equal to the value of the
Response Status: HTTP/1.1 201 Created Response Headers: Transfer-Encoding: chunked Date: Fri, 16 Sep 2011 01:20:22 GMT x-ms-version: 2011-08-18 Server: Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0
Only the account owner may call this operation.
You can specify user-defined metadata as name-value pairs on the queue when you create it.
If a queue with the specified name already exists, Azure Queue Storage checks the metadata that's associated with the existing queue. If the existing metadata is identical to the metadata that's specified on the
Create Queue request, status code 204 (No Content) is returned. If the existing metadata doesn't match the metadata provided with the
Create Queue request, the operation fails and status code 409 (Conflict) is returned. Clients can take advantage of this behavior to avoid an additional call to check to see whether a named queue already exists.
For guidance about valid queue names, see Name queues and metadata. If the specified queue name isn't a valid name, the
Create Queue operation returns status code 400 (Bad Request), along with additional error information, as shown in the following example:
HTTP/1.1 400 One of the request inputs is out of range. Connection: Keep-Alive Content-Length: 226 Via: 1.1 TK5-PRXY-22 Date: Wed, 02 May 2012 17:47:54 GMT Content-Type: application/xml Server: Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-id: fda2babe-ffbb-4f0e-a11b-2bfbd871ba9f x-ms-version: 2011-08-18 <?xml version="1.0" encoding="utf-8"?> <Error> <Code>OutOfRangeInput</Code> <Message>One of the request inputs is out of range. RequestId:fda2babe-ffbb-4f0e-a11b-2bfbd871ba9f Time:2012-05-02T17:47:55.4334169Z</Message> </Error>