Skip to main content

queue

Creates, updates, deletes, gets or lists a queue resource.

Overview

Namequeue
TypeResource
Idazure.storage_queue.queue

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
items_arrayThe list of signed identifiers. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_access_policyselectaccounttimeoutGets the access policy for the specified queue.
cleardeleteaccounttimeoutDeletes all messages from the specified queue.
get_propertiesexecaccounttimeoutReturns all user-defined metadata and system properties for the specified queue.
set_metadataexecaccounttimeout, x-ms-metaSets user-defined metadata for the specified queue.
set_access_policyexecaccount, items_timeoutSets the permissions for the specified queue.
receive_messagesexecaccountnumofmessages, visibilitytimeout, timeoutRetrieves one or more messages from the front of the queue.
send_messageexecaccount, messageTextvisibilitytimeout, messagettl, timeoutAdds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires.
peek_messagesexecaccountnumofmessages, timeoutRetrieves one or more messages from the front of the queue, but does not alter the visibility of the message.
update_messageexecmessage_id, popreceipt, visibilitytimeout, account, messageTexttimeoutUpdates the visibility timeout of a message. This operation can also be used to update the contents of a message.
delete_messageexecmessage_id, popreceipt, accounttimeoutDeletes the specified message.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
accountstringStorage account name. (default: )
message_idstringThe ID of the queue message. Required.
popreceiptstringAn opaque value required to delete the message. If deletion fails using this PopReceipt then the message has been dequeued by another client. Required.
visibilitytimeoutintegerSpecifies the new visibility timeout value, in seconds, relative to server time. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time. Required.
messagettlintegerSpecifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days. Default value is None.
numofmessagesintegerA nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation. Default value is None.
timeoutintegerThe timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations.. Default value is None.
visibilitytimeoutintegerSpecifies the new visibility timeout value, in seconds, relative to server time. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time. Default value is None.
x-ms-metastringThe metadata headers. Default value is None.

SELECT examples

Gets the access policy for the specified queue.

SELECT
items_
FROM azure.storage_queue.queue
WHERE account = '{{ account }}' -- required
AND timeout = '{{ timeout }}'
;

DELETE examples

Deletes all messages from the specified queue.

DELETE FROM azure.storage_queue.queue
WHERE account = '{{ account }}' --required
AND timeout = '{{ timeout }}'
;

Lifecycle Methods

Returns all user-defined metadata and system properties for the specified queue.

EXEC azure.storage_queue.queue.get_properties 
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
;