PHP Laravel 5 Queue Driver package to support Microsoft Azure Storage Queues
- PHP 5.6+, PHP7+ for Laravel 5.5+
- Laravel 5.2, 5.3, 5.4 and 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.
"squigg/azure-queue-laravel": "5.2.*"
composer require squigg/azure-queue-laravel:5.2.*
"squigg/azure-queue-laravel": "5.3.*"
composer require squigg/azure-queue-laravel:5.3.*
"squigg/azure-queue-laravel": "5.4.*"
composer require squigg/azure-queue-laravel:5.4.*
"squigg/azure-queue-laravel": "5.5.*"
composer require squigg/azure-queue-laravel:5.5.*
For versions 5.3 and older, add the following pear repository in your composer.json
file
required for the Microsoft Azure SDK (v5.4+ uses the new microsoft/azure-storage
package instead):
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
Update Composer dependencies
composer update
Add the ServiceProvider to your providers
array in config/app.php
:
'Squigg\AzureQueueLaravel\AzureQueueServiceProvider',
Add the following to the connection
array in config/queue.php
, set your default
connection to azure
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' => '', // Azure storage account name
'key' => '', // Access key for storage account
'queue' => '', // Queue container name
'timeout' => 60 // Timeout (seconds) before a job is released back to the queue
],
Update the default queue used by Laravel by setting the QUEUE_DRIVER
value in your .env
file to azure
.
You can add environment variables into your .env
file to set the above configuration parameters if you desire:
AZURE_QUEUE_STORAGE_NAME=xxx
AZURE_QUEUE_KEY=xxx
AZURE_QUEUE_NAME=xxx
And then update the config file like below:
'accountname' => env('AZURE_QUEUE_STORAGE_NAME'),
'key' => env('AZURE_QUEUE_KEY'),
'queue' => env('AZURE_QUEUE_NAME'),
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
.
2017-09-11 - V5.5 - Support Laravel 5.5 and PHP7+ only. Update Azure Storage API to 0.18 2017-09-11 - V5.4 - Update Azure Storage API to 0.15 (no breaking changes)
Released under the MIT License. Based on Alex Bouma's Laravel 4 package, updated for Laravel 5.