Skip to content

Commit b4cf8e7

Browse files
Azure Docs: Azure Queue Storage (#602)
Co-authored-by: Brian Rinaldi <brian.rinaldi@gmail.com>
1 parent 4acabb1 commit b4cf8e7

1 file changed

Lines changed: 256 additions & 2 deletions

File tree

Lines changed: 256 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,265 @@
11
---
22
title: "Queue Storage"
3-
description: API coverage for Microsoft.QueueStorage in LocalStack for Azure.
3+
description: Get started with Azure Queue Storage on LocalStack
44
template: doc
55
---
66

77
import AzureFeatureCoverage from "../../../../components/feature-coverage/AzureFeatureCoverage";
88

9+
## Introduction
10+
11+
Azure Queue Storage is a messaging service for storing large numbers of messages that can be accessed from anywhere over HTTP or HTTPS.
12+
It is commonly used to decouple application components and build asynchronous processing workflows.
13+
Queue Storage is useful for buffering work items between producers and consumers. For more information, see [What is Azure Queue Storage?](https://learn.microsoft.com/en-us/azure/storage/queues/storage-queues-introduction)
14+
15+
LocalStack for Azure provides a local environment for building and testing applications that make use of Azure Queue Storage.
16+
The supported APIs are available on our [API Coverage section](#api-coverage), which provides information on the extent of Queue Storage's integration with LocalStack.
17+
18+
## Getting started
19+
20+
This guide is designed for users new to Queue Storage and assumes basic knowledge of the Azure CLI and our `azlocal` wrapper script.
21+
22+
Launch LocalStack using your preferred method. For more information, see [Introduction to LocalStack for Azure](/azure/getting-started/). Once the container is running, enable Azure CLI interception by running:
23+
24+
```bash
25+
azlocal start-interception
26+
```
27+
28+
:::note
29+
`azlocal start-interception` points the Azure CLI away from the public Azure management REST API and toward the LocalStack for Azure emulator API.
30+
To revert this configuration, run `azlocal stop-interception` so the CLI targets the official Azure management REST API again.
31+
:::
32+
33+
### Create a resource group
34+
35+
Create a resource group to contain your storage resources:
36+
37+
```bash
38+
az group create \
39+
--name rg-queue-demo \
40+
--location westeurope
41+
```
42+
43+
```bash title="Output"
44+
{
45+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-queue-demo",
46+
"location": "westeurope",
47+
"managedBy": null,
48+
"name": "rg-queue-demo",
49+
"properties": {
50+
"provisioningState": "Succeeded"
51+
},
52+
"tags": null,
53+
"type": "Microsoft.Resources/resourceGroups"
54+
}
55+
```
56+
57+
### Create a storage account
58+
59+
Create a storage account in the resource group:
60+
61+
```bash
62+
az storage account create \
63+
--name stqueuedemols \
64+
--resource-group rg-queue-demo \
65+
--location westeurope \
66+
--sku Standard_LRS
67+
```
68+
69+
```bash title="Output"
70+
{
71+
...
72+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-queue-demo/providers/Microsoft.Storage/storageAccounts/stqueuedemols",
73+
...
74+
"name": "stqueuedemols",
75+
...
76+
"placement": null,
77+
"primaryEndpoints": {
78+
"blob": "https://stqueuedemols.blob.core.azure.localhost.localstack.cloud:4566",
79+
...
80+
"queue": "https://stqueuedemols.queue.core.azure.localhost.localstack.cloud:4566",
81+
...
82+
},
83+
....
84+
}
85+
```
86+
87+
### Authentication
88+
89+
There are three ways to authenticate storage queue commands against the emulator:
90+
91+
#### Storage account key
92+
93+
Retrieve the account key and pass it with `--account-name` and `--account-key`:
94+
95+
```bash
96+
ACCOUNT_KEY=$(az storage account keys list \
97+
--account-name stqueuedemols \
98+
--resource-group rg-queue-demo \
99+
--query "[0].value" \
100+
--output tsv)
101+
102+
az storage queue list \
103+
--account-name stqueuedemols \
104+
--account-key "$ACCOUNT_KEY"
105+
```
106+
107+
#### Login credentials
108+
109+
Use `--auth-mode login` to authenticate with the current session credentials:
110+
111+
```bash
112+
az storage queue list \
113+
--account-name stqueuedemols \
114+
--auth-mode login
115+
```
116+
117+
#### Connection string
118+
119+
Bundle the account name and key into a single value:
120+
121+
```bash
122+
CONNECTION_STRING=$(az storage account show-connection-string \
123+
--name stqueuedemols \
124+
--resource-group rg-queue-demo \
125+
--query connectionString -o tsv)
126+
127+
az storage queue list \
128+
--connection-string "$CONNECTION_STRING"
129+
```
130+
131+
The remaining examples in this guide use connection strings for brevity.
132+
133+
### Create and inspect a queue
134+
135+
Create a queue:
136+
137+
```bash
138+
az storage queue create \
139+
--name app-queue \
140+
--connection-string "$CONNECTION_STRING"
141+
```
142+
143+
```bash title="Output"
144+
{
145+
"created": true
146+
}
147+
```
148+
149+
Verify the queue exists:
150+
151+
```bash
152+
az storage queue exists \
153+
--name app-queue \
154+
--connection-string "$CONNECTION_STRING"
155+
```
156+
157+
```bash title="Output"
158+
{
159+
"exists": true
160+
}
161+
```
162+
163+
List queues in the storage account:
164+
165+
```bash
166+
az storage queue list \
167+
--connection-string "$CONNECTION_STRING"
168+
```
169+
170+
```bash title="Output"
171+
[
172+
{
173+
"approximateMessageCount": null,
174+
"metadata": null,
175+
"name": "app-queue"
176+
}
177+
]
178+
```
179+
180+
### Put, peek, and get messages
181+
182+
Add a message to the queue:
183+
184+
```bash
185+
az storage message put \
186+
--queue-name app-queue \
187+
--content "hello-from-localstack" \
188+
--connection-string "$CONNECTION_STRING"
189+
```
190+
191+
```bash title="Output"
192+
{
193+
"content": "hello-from-localstack",
194+
...
195+
"id": "a253ff4a-7b9c-434e-9c33-deae3070193c",
196+
...
197+
}
198+
```
199+
200+
Peek at messages without consuming them:
201+
202+
```bash
203+
az storage message peek \
204+
--queue-name app-queue \
205+
--connection-string "$CONNECTION_STRING"
206+
```
207+
208+
```bash title="Output"
209+
[
210+
{
211+
"content": "hello-from-localstack",
212+
...
213+
"id": "a253ff4a-7b9c-434e-9c33-deae3070193c",
214+
"insertionTime": "2026-02-27T07:45:14+00:00",
215+
...
216+
}
217+
]
218+
```
219+
220+
Get (dequeue) a message from the queue, which makes it invisible to other consumers for the visibility timeout you set (when you omit `--visibility-timeout`, Azure Queue Storage uses a default of 30 seconds; see [Get Messages](https://learn.microsoft.com/en-us/rest/api/storageservices/get-messages)):
221+
222+
```bash
223+
az storage message get \
224+
--queue-name app-queue \
225+
--connection-string "$CONNECTION_STRING" \
226+
--output json
227+
```
228+
229+
```bash title="Output"
230+
[
231+
{
232+
"content": "hello-from-localstack",
233+
...
234+
"id": "a253ff4a-7b9c-434e-9c33-deae3070193c",
235+
"popReceipt": "...",
236+
...
237+
}
238+
]
239+
```
240+
241+
## Features
242+
243+
The Queue Storage emulator supports the following features:
244+
245+
- **Data plane REST API**: Queue CRUD, message operations (put, peek, get, delete), queue metadata, stored access policies, and SAS token generation.
246+
- **Control plane REST API**: Create and get queues, get and set queue service properties via Azure Resource Manager.
247+
- **Multiple authentication modes**: Storage account key, login credentials, and connection strings.
248+
249+
## Limitations
250+
251+
- **No data persistence across restarts**: Queue data is not persisted and is lost when the LocalStack emulator is stopped or restarted.
252+
- **Queue service properties**: `set_service_properties` is a no-op and `get_service_properties` returns empty defaults, unlike Azure where CORS, logging, and metrics settings are persisted and applied.
253+
- **Storage account keys**: Keys are emulator-generated rather than managed by Azure.
254+
- **Header validation**: Unsupported request headers or parameters are silently accepted instead of being rejected.
255+
- **API version enforcement**: The emulator does not validate the `x-ms-version` header; all API versions are accepted.
256+
257+
## Samples
258+
259+
The following sample demonstrates how to use Queue Storage with LocalStack for Azure:
260+
261+
- [Azure Functions Sample with LocalStack for Azure](https://github.com/localstack/localstack-azure-samples/tree/main/samples/function-app-storage-http/dotnet)
262+
9263
## API Coverage
10264

11-
<AzureFeatureCoverage service="Microsoft.QueueStorage" client:load />
265+
<AzureFeatureCoverage service="Microsoft.QueueStorage" client:load />

0 commit comments

Comments
 (0)