PHPackages                             deva7mad/laravel-azure-storage - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. deva7mad/laravel-azure-storage

ActiveLibrary[File &amp; Storage](/categories/file-storage)

deva7mad/laravel-azure-storage
==============================

Microsoft Azure Blob Storage integration for Laravel's Storage API

1.2.0(5y ago)022MITPHP

Since Nov 16Pushed 5y ago1 watchersCompare

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

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

laravel-azure-storage
=====================

[](#laravel-azure-storage)

[![Build Status](https://camo.githubusercontent.com/328e1f5f907f9ac404a83d6d095b40f5bd9252f7d54daba789890d75f98de793/68747470733a2f2f7472617669732d63692e6f72672f64657661376d61642f6c61726176656c2d617a7572652d73746f726167652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/deva7mad/laravel-azure-storage)[![Coverage Status](https://camo.githubusercontent.com/3135dea41488542fa77b5ed044f2649f75eb6c840fb970fef9ed4926ee66aa4c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f64657661376d61642f6c61726176656c2d617a7572652d73746f726167652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/deva7mad/laravel-azure-storage?branch=master)

Microsoft Azure Blob Storage integration for Laravel's Storage API.

This is a custom driver for [Laravel's File Storage API](https://laravel.com/docs/8.x/filesystem), which is itself built on top of [Flysystem](https://flysystem.thephpleague.com/v1/docs/). It uses Flysystem's own Azure blob storage adapter, and so can't easily add any more functionality than that has - indeed, adding that would be out of scope for the project.

Installation
============

[](#installation)

Install the package using composer:

```
composer require deva7mad/laravel-azure-storage
```

On Laravel versions before 5.5 you also need to add the service provider to `config/app.php` manually:

```
    Deva7mad\LaravelAzureStorage\AzureStorageServiceProvider::class,
```

Then add this to the `disks` section of `config/filesystems.php`:

```
        'azure' => [
            'driver'    => 'azure',
            'name'      => env('AZURE_STORAGE_NAME'),
            'key'       => env('AZURE_STORAGE_KEY'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
        ],
```

Finally, add the fields `AZURE_STORAGE_NAME`, `AZURE_STORAGE_KEY`, `AZURE_STORAGE_CONTAINER` and `AZURE_STORAGE_URL` to your `.env` file with the appropriate credentials. The `AZURE_STORAGE_URL` field is optional, this allows you to set a custom URL to be returned from `Storage::url()`, if using the `$root` container the URL will be returned without the container path. A `prefix` can be optionally used. If it's not set, the container root is used. Then you can set the `azure` driver as either your default or cloud driver and use it to fetch and retrieve files as usual.

For details on how to use this driver, refer to the [Laravel documentation on the file storage API](https://laravel.com/docs/7.x/filesystem).

Custom endpoints
================

[](#custom-endpoints)

The package supports using a custom endpoint, as in this example:

```
        'azure' => [
            'driver'    => 'azure',
            'name'      => env('AZURE_STORAGE_NAME'),
            'key'       => env('AZURE_STORAGE_KEY'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
            'endpoint'  => env('AZURE_STORAGE_ENDPOINT'),
        ],
```

Then you can specify a suitable value for `AZURE_STORAGE_ENDPOINT` in your `.env` file as normal.

SAS token authentication
========================

[](#sas-token-authentication)

With SAS token authentication the endpoint is required. The value has the following format: `https://[accountName].blob.core.windows.net`

```
        'azure' => [
            'driver'    => 'azure',
            'sasToken'  => env('AZURE_STORAGE_SAS_TOKEN'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
            'endpoint'  => env('AZURE_STORAGE_ENDPOINT'),
        ],
```

Caching
=======

[](#caching)

The package supports disk based caching as described in the [Laravel documentation](https://laravel.com/docs/filesystem#caching). This feature requires adding the package `league/flysystem-cached-adapter`:

```
composer require league/flysystem-cached-adapter:^1.1
```

To enable caching for the azure disk, add a `cache` directive to the disk's configuration options.

```
        'azure' => [
            'driver'    => 'azure',
            // Other Disk Options...
            'cache'     => [
                'store' => 'memcached',
                'expire' => 600,
                'prefix' => 'filecache',
            ]
        ],
```

Retries
=======

[](#retries)

The Azure Storage SDK ships a [middleware to retry](https://github.com/Azure/azure-storage-php#retrying-failures) failed requests. To enable the retry middewalre, add a `retry` directive to the disk's configuration options.

```
        'azure' => [
            'driver'    => 'azure',
            // Other Disk Options...
            'retry'     => [
                'tries' => 3,                   // number of retries, default: 3
                'interval' => 500,              // wait interval in ms, default: 1000ms
                'increase' => 'exponential'     // how to increase the wait interval, options: linear, exponential, default: linear
            ]
        ],
```

Support policy
==============

[](#support-policy)

This package is supported on the current Laravel LTS version, and any later versions. If you are using an older Laravel version, it may work, but I offer no guarantees, nor will I accept pull requests to add this support.

By extension, as the current Laravel LTS version required PHP 7.0 or greater, I don't test it against PHP &lt; 7, nor will I accept any pull requests to add this support.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

3

Last Release

2001d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/174756042?v=4)[a17mad](/maintainers/a17mad)[@A17MaD](https://github.com/A17MaD)

---

Top Contributors

[![deva7mad](https://avatars.githubusercontent.com/u/7467122?v=4)](https://github.com/deva7mad "deva7mad (7 commits)")

---

Tags

laravelstorageazure

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[steffjenl/laravel-azure-blob-storage

Microsoft Azure Blob Storage integration for Laravel's Storage API

11152.8k](/packages/steffjenl-laravel-azure-blob-storage)

PHPackages © 2026

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