PHPackages                             marmanik/laravel-azure-storage-queue - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. marmanik/laravel-azure-storage-queue

ActiveLibrary[Queues &amp; Workers](/categories/queues)

marmanik/laravel-azure-storage-queue
====================================

Azure Storage Queue driver for Laravel

v1.0.3(6d ago)04↓100%MITPHPPHP ^8.2

Since Mar 18Pushed 6d agoCompare

[ Source](https://github.com/marmanik/laravel-azure-storage-queue)[ Packagist](https://packagist.org/packages/marmanik/laravel-azure-storage-queue)[ Docs](https://github.com/marmanik/laravel-azure-storage-queue)[ RSS](/packages/marmanik-laravel-azure-storage-queue/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (9)Versions (5)Used By (0)

marmanik/laravel-azure-storage-queue
====================================

[](#marmaniklaravel-azure-storage-queue)

A Laravel queue driver backed by [Azure Storage Queues](https://learn.microsoft.com/en-us/azure/storage/queues/), built on the `microsoft/azure-storage-queue` SDK.

- Laravel 11 &amp; 12 · PHP 8.2+
- Zero SDK types leak past `AzureQueueClientAdapter` — tests mock the `AzureQueueClient` interface
- Automatic gzip compression for payloads that exceed 64 KiB after base64 encoding
- Azurite (local emulator) supported via a custom endpoint

---

Installation
------------

[](#installation)

```
composer require marmanik/laravel-azure-storage-queue
```

The service provider is auto-discovered via Laravel's package discovery.

---

Configuration
-------------

[](#configuration)

Add the connection to `config/queue.php`. No separate config file is needed.

```
// config/queue.php
'connections' => [

    'azure' => [
        'driver'       => 'azure-storage-queue',
        'account_name' => env('AZURE_STORAGE_ACCOUNT_NAME'),
        'account_key'  => env('AZURE_STORAGE_ACCOUNT_KEY'),
        'endpoint'     => env('AZURE_STORAGE_QUEUE_ENDPOINT'), // optional — see Azurite section
        'queue'        => env('AZURE_QUEUE_NAME', 'default'),
        'timeout'      => env('AZURE_QUEUE_TIMEOUT', 60),      // visibility timeout in seconds
    ],

],
```

Set the default connection if desired:

```
'default' => env('QUEUE_CONNECTION', 'azure'),
```

`.env` for production:

```
AZURE_STORAGE_ACCOUNT_NAME=mystorageaccount
AZURE_STORAGE_ACCOUNT_KEY=base64key==
AZURE_QUEUE_NAME=my-queue
AZURE_QUEUE_TIMEOUT=60
```

---

Creating the queue
------------------

[](#creating-the-queue)

Before dispatching jobs the queue must exist in Azure Storage. Use the bundled Artisan command:

```
php artisan azure-storage-queue:create-queue
# or specify a non-default connection
php artisan azure-storage-queue:create-queue --connection=azure
```

The command is idempotent — running it against an existing queue is safe.

---

Usage
-----

[](#usage)

### Dispatching jobs

[](#dispatching-jobs)

Nothing changes from standard Laravel queue usage:

```
dispatch(new App\Jobs\SendWelcomeEmail($user));

// Delay
dispatch(new App\Jobs\SendWelcomeEmail($user))->delay(now()->addMinutes(5));

// Specific queue
dispatch(new App\Jobs\SendWelcomeEmail($user))->onQueue('emails');
```

### Running a worker

[](#running-a-worker)

```
php artisan queue:work azure
php artisan queue:work azure --queue=emails
```

### Laravel Horizon

[](#laravel-horizon)

This driver is compatible with Horizon. Add the `azure` connection to `config/horizon.php` under `environments`:

```
'environments' => [
    'production' => [
        'supervisor-azure' => [
            'connection' => 'azure',
            'queue'      => ['default'],
            'balance'    => 'simple',
            'processes'  => 10,
            'tries'      => 3,
        ],
    ],
],
```

> **Note:** Azure Storage Queues do not support priority ordering between queues at the storage level. Horizon's balancing works correctly but FIFO is best-effort across multiple workers.

### Custom TTL per dispatch

[](#custom-ttl-per-dispatch)

Pass `ttl` (seconds) in the options array when using `pushRaw` directly:

```
Queue::connection('azure')->pushRaw($payload, 'default', ['ttl' => 3600]);
```

---

Azurite local development
-------------------------

[](#azurite-local-development)

[Azurite](https://github.com/Azure/Azurite) is the official Azure Storage emulator. The queue service runs on port **10001**.

### Start Azurite

[](#start-azurite)

```
# Docker
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite

# npm
npx azurite --silent
```

### .env for Azurite

[](#env-for-azurite)

```
AZURE_STORAGE_ACCOUNT_NAME=devstoreaccount1
AZURE_STORAGE_ACCOUNT_KEY=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
AZURE_STORAGE_QUEUE_ENDPOINT=http://127.0.0.1:10001/devstoreaccount1
AZURE_QUEUE_NAME=default
```

Create the queue:

```
php artisan azure-storage-queue:create-queue
```

---

How message encoding works
--------------------------

[](#how-message-encoding-works)

Payload size (after base64)Storage format≤ 64 KiB`base64(payload)`&gt; 64 KiB`gz:` + `base64(gzcompress(payload))`The `gz:` prefix is detected transparently on `pop()`. If the compressed payload still exceeds 64 KiB an `AzureQueueException` is thrown.

---

Architecture
------------

[](#architecture)

```
AzureStorageQueueServiceProvider   — registers the 'azure-storage-queue' driver
AzureStorageQueueConnector         — ConnectorInterface: builds the queue from config
AzureStorageQueue                  — extends Illuminate\Queue\Queue, implements Queue contract
AzureStorageQueueJob               — extends Illuminate\Queue\Jobs\Job, wraps QueueMessage DTO
AzureQueueClientAdapter            — implements AzureQueueClient, owns all SDK calls
  Contracts/AzureQueueClient       — interface; SDK never crosses this boundary
  Data/QueueMessage                — readonly DTO: messageId, popReceipt, body, dequeueCount
  Exceptions/AzureQueueException   — wraps ServiceException from the SDK
  Commands/CreateQueueCommand      — php artisan azure-storage-queue:create-queue

```

---

Limitations
-----------

[](#limitations)

ConstraintDetailMessage size64 KiB per message (Azure hard limit). Automatic gzip compression extends the effective limit.Max TTL7 days (604 800 seconds). Azure rejects higher values.`later()` delayAlso limited to 7 days (implemented as initial visibility timeout).FIFOAzure Storage Queues are best-effort FIFO. Strict ordering is not guaranteed under concurrent workers.Batch operations`bulk()` loops individual `push()` calls; no native batch API.---

Testing
-------

[](#testing)

```
composer test          # Pest
composer stan          # PHPStan level 8
composer format        # Pint
```

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

License
-------

[](#license)

MIT — see [LICENSE.md](LICENSE.md).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance99

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

6d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f92b39f6f2b1ad41432382e70a1a80394fc33137ebe7761c644af4f442ad86b?d=identicon)[MarmaNik](/maintainers/MarmaNik)

---

Top Contributors

[![marmanik](https://avatars.githubusercontent.com/u/5727095?v=4)](https://github.com/marmanik "marmanik (6 commits)")

---

Tags

laravelqueuestorageazuredriver

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/marmanik-laravel-azure-storage-queue/health.svg)

```
[![Health](https://phpackages.com/badges/marmanik-laravel-azure-storage-queue/health.svg)](https://phpackages.com/packages/marmanik-laravel-azure-storage-queue)
```

###  Alternatives

[squigg/azure-queue-laravel

Laravel Queue Driver for Microsoft Azure Storage Queue

43245.6k1](/packages/squigg-azure-queue-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
