Azure Queue Storage
The Azure Storage queue SDKs with a path-style account URL: the account name is your identifier.
Endpoint and credentials
| Account URL | https://azure.powerqueue.link/<your-identifier> |
|---|---|
| Queue URL | https://azure.powerqueue.link/<your-identifier>/<queue> |
| Account name | your tenant identifier (the first segment of the URL path) |
| Account key | any base64 value, for example YW55dGhpbmc=; or no credential at all |
The account is in the path, as with the Azurite storage emulator, not in the host name. Signatures are not checked, so Shared Key, Shared Key Lite, SAS tokens and unsigned requests all work; the only rule is that a Shared Key header must name the same account as the URL. Azure AD (Entra ID) bearer tokens are not supported.
Where your code takes a connection string, give the queue endpoint explicitly, as for the Azurite emulator:
DefaultEndpointsProtocol=https;AccountName=<your-identifier>;AccountKey=YW55dGhpbmc=;QueueEndpoint=https://azure.powerqueue.link/<your-identifier>
Python (azure-storage-queue)
pip install azure-storage-queue:
from azure.storage.queue import QueueServiceClient
ACCOUNT = "<your-identifier>"
service = QueueServiceClient(
account_url=f"https://azure.powerqueue.link/{ACCOUNT}",
credential={"account_name": ACCOUNT, "account_key": "YW55dGhpbmc="},
)
queue = service.get_queue_client("jobs")
queue.send_message("hello", time_to_live=3600)
for message in queue.receive_messages(messages_per_page=32, visibility_timeout=30):
print(message.content)
queue.delete_message(message)
print([q.name for q in service.list_queues()])
JavaScript (@azure/storage-queue)
npm install @azure/storage-queue, then run as an ES module:
import { QueueClient, StorageSharedKeyCredential } from "@azure/storage-queue";
const account = "<your-identifier>";
const queue = new QueueClient(
`https://azure.powerqueue.link/${account}/jobs`,
new StorageSharedKeyCredential(account, "YW55dGhpbmc="),
);
await queue.sendMessage("hello");
const { receivedMessageItems } = await queue.receiveMessages({ numberOfMessages: 10 });
for (const message of receivedMessageItems) {
console.log(message.messageText);
await queue.deleteMessage(message.messageId, message.popReceipt);
}
C# (.NET, Azure.Storage.Queues)
dotnet add package Azure.Storage.Queues:
using Azure.Storage;
using Azure.Storage.Queues;
using Azure.Storage.Queues.Models;
var account = "<your-identifier>";
var queue = new QueueClient(
new Uri($"https://azure.powerqueue.link/{account}/jobs"),
new StorageSharedKeyCredential(account, "YW55dGhpbmc="));
await queue.SendMessageAsync("hello");
QueueMessage[] messages = await queue.ReceiveMessagesAsync(maxMessages: 10);
foreach (var message in messages)
{
Console.WriteLine(message.MessageText);
await queue.DeleteMessageAsync(message.MessageId, message.PopReceipt);
}
Supported operations
- Account: List Queues, Get and Set Queue Service Properties, Get Queue Service Stats.
- Queues: Create Queue, Delete Queue, Get and Set Queue Metadata (up to 8 KiB), Get and Set Queue ACL (up to 5 stored access policies).
- Messages: Put Message, Get Messages (up to 32 at once), Peek Messages, Delete Message, Update Message, Clear Messages.
- CORS preflight requests, and read-only access through the
<account>-secondaryname. - Any other method on a resource answers
405 UnsupportedHttpVerb.
Differences from Azure Queue Storage
- Path-style addressing only:
https://azure.powerqueue.link/<account>, neverhttps://<account>.queue.core.windows.net. - Put Message, Get Messages, Peek Messages and Clear Messages on a queue that does not exist create it instead of answering
404 QueueNotFound. Create Queue on a queue that came into being that way answers201 Created(not204), so the SDK does not raise "already exists"; it then keeps the queue past the idle deletion. - Message time to live defaults to 1 hour, the most allowed, rather than 7 days;
-1(never expire) is refused. Visibility timeouts are limited the same way. - Signatures, SAS permissions and ACLs are not enforced: the identifier is the only access control.
Messages from other interfaces
A body sent through another interface that is not valid text arrives base64-encoded, with nothing to mark it (Azure messages have no attributes): if a queue may carry binary, decode base64 yourself. A typed Service Bus body arrives as JSON text. Attributes, headers and properties sent through the other interfaces are not visible through Azure Queue Storage; they stay on the message for other readers. What you send is stored as text, so an SDK message encoding policy that base64-encodes delivers base64 text to the other interfaces.
The full rules, with examples: Using one queue from several interfaces.
Errors
| Situation | Error code | HTTP |
|---|---|---|
Account in the path is not a tenant identifier (or is empty, or devstoreaccount1) | AuthenticationFailed, with the identifier help text (Python: ClientAuthenticationError) | 403 |
| Shared Key header naming a different account from the URL | AuthenticationFailed | 403 |
| Too many new tenants from your address, or the service is full | ServerBusy | 503 |
| More than 100 requests a second (after a burst of 200) | ServerBusy (the SDKs retry with back-off) | 503 |
| Message text over 64 KiB | MessageTooLarge | 400 |
| A 101st queue, by Create Queue or by use | InsufficientAccountPermissions | 403 |
| Queue holding 1,000 messages, or a tenant holding 16 MiB of messages | InsufficientAccountPermissions | 403 |
| Queue metadata and access policies of a tenant's queues, with its other settings, growing past 1 MiB together | InsufficientAccountPermissions | 403 |
| Time to live or visibility timeout over 1 hour, or a time to live of -1 | OutOfRangeQueryParameterValue | 400 |