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

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

eaguad1337/laravel-azure-storage
================================

Microsoft Azure Blob Storage integration for Laravel's Storage API

01PHP

Since May 15Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

DEPRECATION NOTICE
------------------

[](#deprecation-notice)

This package is dependent on Flysystem's Azure Blob Storage integration. The creator of that has announced that because Microsoft are dropping support for their PHP storage client, he will also be dropping Azure support from Flysystem in 2024.

As a result, there is no viable path for me to continue to maintain this package past that point. In addition, I myself have never actually had the need to use this package and only maintained it for reasons of inertia. It's therefore deprecated as of March 2024.

There is a [project to maintain a fork of the original Microsoft PHP SDK](https://github.com/Azure-OSS/azure-storage-php). While this is not a drop-in replacement for this package as it does not at this time provide a replacement for the Flysystem driver or this abstraction on top of that, if you're planning to continue using Azure with Laravel, that is probably the best place to start.

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

[](#microsoft-azure-blob-storage-integration-for-laravels-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 Collapsar/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

15

—

LowBetter than 3% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/7289e5a1e062fa10844736bb1dda3b12e6d53754ab3e2eeae4bbd5ef39b13f4d?d=identicon)[eaguad](/maintainers/eaguad)

---

Top Contributors

[![matthewbdaly](https://avatars.githubusercontent.com/u/450801?v=4)](https://github.com/matthewbdaly "matthewbdaly (126 commits)")[![ingalless](https://avatars.githubusercontent.com/u/22981941?v=4)](https://github.com/ingalless "ingalless (4 commits)")[![matthewbdaly-mission](https://avatars.githubusercontent.com/u/126190146?v=4)](https://github.com/matthewbdaly-mission "matthewbdaly-mission (4 commits)")[![john-dent](https://avatars.githubusercontent.com/u/24832003?v=4)](https://github.com/john-dent "john-dent (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)")[![keatliang2005](https://avatars.githubusercontent.com/u/473990?v=4)](https://github.com/keatliang2005 "keatliang2005 (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)")[![eaguad1337](https://avatars.githubusercontent.com/u/19355144?v=4)](https://github.com/eaguad1337 "eaguad1337 (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)")[![hakan0xFF](https://avatars.githubusercontent.com/u/1721527?v=4)](https://github.com/hakan0xFF "hakan0xFF (1 commits)")

### Embed Badge

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

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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