PHP Laravel 5 Queue Driver package to support Microsoft Azure Storage Queues
- PHP 7+ for Laravel 5.5+
- Laravel 5.5 (not tested on previous versions)
- Microsoft Azure Storage account and API key
- Queue container created through Azure Portal or via Azure CLI / PowerShell
You can find this library on Packagist.
Require this package in your composer.json
. The version numbers will follow Laravel.
"akayaman/azure-queue-laravel": "5.5.*"
composer require akayaman/azure-queue-laravel:5.5.*
If you are not using Laravel auto package discovery, add the ServiceProvider to your providers
array in config/app.php
:
'Squigg\AzureQueueLaravel\AzureQueueServiceProvider',
Add the following to the connections
array in config/queue.php
, and
fill out your own connection data from the Azure Management portal:
'azure' => [
'driver' => 'azure', // Leave this as-is
'protocol' => 'https', // https or http
'accountname' => env('AZURE_QUEUE_STORAGE_NAME'), // Azure storage account name
'key' => env('AZURE_QUEUE_KEY'), // Access key for storage account
'queue' => env('AZURE_QUEUE_NAME'), // Queue container name
'endpoint' => env('AZURE_QUEUE_ENDPOINT'), // Queue endpoint
'timeout' => 60 // Timeout (seconds) before a job is released back to the queue
],
Add environment variables into your .env
file to set the above configuration parameters if you prefer:
AZURE_QUEUE_STORAGE_NAME=xxx
AZURE_QUEUE_KEY=xxx
AZURE_QUEUE_NAME=xxx
AZURE_QUEUE_ENDPOINT=xxx
Update the default queue used by Laravel by setting the QUEUE_DRIVER
value in your .env
file to azure
.
QUEUE_DRIVER=azure
Use the normal Laravel Queue functionality as per the documentation.
Remember to update the default queue by setting the QUEUE_DRIVER
value in your .env
file to azure
.
Released under the MIT License. Based on Alex Bouma's Laravel 4 package, updated for Laravel 5.