PHPackages                             cwssrl/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. cwssrl/laravel-azure-storage

Abandoned → [azure-oss/storage-blob-laravel](/?search=azure-oss%2Fstorage-blob-laravel)ArchivedLibrary[File &amp; Storage](/categories/file-storage)

cwssrl/laravel-azure-storage
============================

Microsoft Azure Blob Storage integration for Laravel's Storage API

v1.2.0(2y ago)0716MITPHPCI failing

Since Jan 22Pushed 5mo agoCompare

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

READMEChangelogDependencies (13)Versions (2)Used By (0)

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

[](#laravel-azure-storage)

[![CircleCI](https://camo.githubusercontent.com/eaa0c16178b278ab5610cea7488eda18958fbb361facc55a9d1eed6414d0cd6c/68747470733a2f2f646c2e636972636c6563692e636f6d2f7374617475732d62616467652f696d672f67682f6d6174746865776264616c792f6c61726176656c2d617a7572652d73746f726167652f747265652f6d61737465722e7376673f7374796c653d737667)](https://dl.circleci.com/status-badge/redirect/gh/matthewbdaly/laravel-azure-storage/tree/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/9.x/filesystem), which is itself built on top of [Flysystem 3](https://flysystem.thephpleague.com/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 cwssrl/laravel-azure-storage
```

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

```
        'azure' => [ // NB This need not be set to "azure", because it's just the name of the connection - feel free to call it what you want, or even set up multiple blobs with different names
            'driver'    => 'azure', // As this is the name of the driver, this MUST be set to "azure"
            'name'      => env('AZURE_STORAGE_NAME'),
            'key'       => env('AZURE_STORAGE_KEY'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
            'url'       => env('AZURE_STORAGE_URL'),
            'prefix'    => null,
            'connection_string' => env('AZURE_STORAGE_CONNECTION_STRING') // optional, will override default endpoint builder
        ],
```

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/9.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,
            'connection_string' => 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'),
        ],
```

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
            ]
        ],
```

Unsupported features
====================

[](#unsupported-features)

As this package uses the Flysystem Azure integration, it shares the following limitations with that:

- Visibility setting or retrieving is not supported.
- Mimetypes are always resolved, where others do not.
- Directory creation is not supported in any way.

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.

Can you add support for storage backend X?
==========================================

[](#can-you-add-support-for-storage-backend-x)

No. This is *exclusively* for Azure Blob storage, and I am categorically not interested in expanding the scope of it to support other backends.

As long as Flysystem supports it, you can roll your own Laravel filesystem driver easily as described at  if you need to - this is the method I used to build this package.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance49

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.1% 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

Unknown

Total

1

Last Release

841d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f054791dd25f449ec129231dec3beb191c471e87bb5f8d5df14390ca4ca74a2?d=identicon)[cwssrl](/maintainers/cwssrl)

---

Top Contributors

[![matthewbdaly](https://avatars.githubusercontent.com/u/450801?v=4)](https://github.com/matthewbdaly "matthewbdaly (125 commits)")[![chack1172](https://avatars.githubusercontent.com/u/12584098?v=4)](https://github.com/chack1172 "chack1172 (7 commits)")[![john-dent](https://avatars.githubusercontent.com/u/24832003?v=4)](https://github.com/john-dent "john-dent (4 commits)")[![matthewbdaly-mission](https://avatars.githubusercontent.com/u/126190146?v=4)](https://github.com/matthewbdaly-mission "matthewbdaly-mission (4 commits)")[![ingalless](https://avatars.githubusercontent.com/u/22981941?v=4)](https://github.com/ingalless "ingalless (4 commits)")[![BernhardtD](https://avatars.githubusercontent.com/u/16192489?v=4)](https://github.com/BernhardtD "BernhardtD (3 commits)")[![martinopp](https://avatars.githubusercontent.com/u/19613719?v=4)](https://github.com/martinopp "martinopp (2 commits)")[![rymanalu](https://avatars.githubusercontent.com/u/6141573?v=4)](https://github.com/rymanalu "rymanalu (2 commits)")[![hakan0xFF](https://avatars.githubusercontent.com/u/1721527?v=4)](https://github.com/hakan0xFF "hakan0xFF (1 commits)")[![ElieSauveterre](https://avatars.githubusercontent.com/u/3525301?v=4)](https://github.com/ElieSauveterre "ElieSauveterre (1 commits)")[![eldor](https://avatars.githubusercontent.com/u/283184?v=4)](https://github.com/eldor "eldor (1 commits)")[![mihaliak](https://avatars.githubusercontent.com/u/3680162?v=4)](https://github.com/mihaliak "mihaliak (1 commits)")[![nklido](https://avatars.githubusercontent.com/u/38701996?v=4)](https://github.com/nklido "nklido (1 commits)")[![zaalbarxx](https://avatars.githubusercontent.com/u/3301242?v=4)](https://github.com/zaalbarxx "zaalbarxx (1 commits)")[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (1 commits)")[![SolveSoul](https://avatars.githubusercontent.com/u/6033289?v=4)](https://github.com/SolveSoul "SolveSoul (1 commits)")[![keatliang2005](https://avatars.githubusercontent.com/u/473990?v=4)](https://github.com/keatliang2005 "keatliang2005 (1 commits)")

---

Tags

laravelstorageazureblob

###  Code Quality

TestsPest

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[microsoft/azure-storage-blob

This project provides a set of PHP client libraries that make it easy to access Microsoft Azure Storage Blob APIs.

5516.0M60](/packages/microsoft-azure-storage-blob)[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)
