The Delete Message operation deletes the specified message.
Request
The Delete Message request may be constructed as follows. HTTPS is recommended. Replace myaccount with the name of your storage account, myqueue with the name of your queue, and string-value with the value of the pop receipt that has been obtained for the message to be deleted:
| Method | Request URI | HTTP Version |
|---|---|---|
DELETE |
https://myaccount.queue.core.windows.net/myqueue/messages/messageid?popreceipt=string-value |
HTTP/1.1 |
Emulated Storage Service URI
When making a request against the emulated storage service, specify the emulator hostname and Queue service port as 127.0.0.1:10001, followed by the emulated storage account name:
| Method | Request URI | HTTP Version |
|---|---|---|
DELETE |
http://127.0.0.1:10001/devstoreaccount1/myqueue/messages/messageid?popreceipt=string-value |
HTTP/1.1 |
URI Parameters
The request URI supports the following parameters.
| Parameter | Description |
|---|---|
popreceipt |
Required. A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation. |
timeout |
Optional. The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations. |
Request Headers
The following table describes required and optional request headers.
| Request Header | Description |
|---|---|
Authorization |
Required. Specifies the authentication scheme, account name, and signature. For more information, see Authentication for the Azure Storage Services. |
Date or x-ms-date |
Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authentication for the Azure Storage Services. |
x-ms-version |
Optional. Specifies the version of the operation to use for this request. For more information, see Versioning for the Azure Storage Services. |
x-ms-client-request-id |
Optional. Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Using this header is highly recommended for correlating client-side activities with requests received by the server. For more information, see About Storage Analytics Logging and Azure Logging: Using Logs to Track Storage Requests. |
Request Body
None.
Response
The response includes an HTTP status code and a set of response headers.
Status Code
A successful operation returns status code 204 (No Content).
For information about status codes, see Status and Error Codes.
Response Headers
The response for this operation includes the following headers. The response also includes additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
| Request Header | Description |
|---|---|
x-ms-request-id |
This header uniquely identifies the request that was made and can be used for troubleshooting the request. For more information, see Troubleshooting API Operations. |
x-ms-version |
Indicates the version of the Queue service used to execute the request. This header is returned for requests made against version 2009-09-19 and later. |
Date |
A UTC date/time value generated by the service that indicates the time at which the response was initiated. |
Response Body
None.
Authorization
This operation can be performed by the account owner and by anyone with a shared access signature that has permission to perform this operation.
Remarks
When a message is successfully deleted, it is immediately marked for deletion and is no longer accessible to clients. The message is later removed from the queue during garbage collection.
After a client retrieves a message with the Get Messages operation, the client is expected to process and delete the message. To delete the message, you must have two items of data returned in the response body of the Get Messages operation:
The message ID, an opaque GUID value that identifies the message in the queue.
A valid pop receipt, an opaque value that indicates that the message has been retrieved.
The message ID is returned from the previous
Get Messagesoperation. The pop receipt is returned from the most recentGet MessagesorUpdate Messageoperation. In order for theDelete Messageoperation to succeed, the pop receipt specified on the request must match the pop receipt returned from theGet MessagesorUpdate Messageoperation.Pop receipts remain valid until one of the following events occurs:
The message has expired.
The message has been deleted using the last pop receipt received either from
Get MessagesorUpdate Message.The invisibility timeout has elapsed and the message has been dequeued by a
Get Messagesrequest. When the invisibility timeout elapses, the message becomes visible again. If it is retrieved by anotherGet Messagesrequest, the returned pop receipt can be used to delete or update the message.The message has been updated with a new visibility timeout. When the message is updated, a new pop receipt will be returned.
If a message with a matching pop receipt is not found, the service returns error code 404 (Not Found). This error will happen in the cases listed above where the pop receipt is no longer valid.
See Also
Authentication for the Azure Storage Services
Status and Error Codes
Queue Service Error Codes

