azure-oss/storage-blob-symfony
Composer 安装命令:
composer require azure-oss/storage-blob-symfony
包简介
Symfony bundle bridge for the Azure-OSS Flysystem adapter (league/flysystem-bundle 3.7+).
README 文档
README
Community-driven PHP SDKs for Azure, because Microsoft won't.
In November 2023, Microsoft officially archived their Azure SDK for PHP and stopped maintaining PHP integrations for most Azure services. No migration path, no replacement — just a repository marked read-only.
We picked up where they left off.
This package is the Symfony bridge for azure-oss/storage-blob-flysystem. It registers a azure_oss adapter shortcut with league/flysystem-bundle so storages can be declared directly in config/packages/flysystem.yaml.
Our other packages:
- azure-oss/storage – Azure Blob Storage SDK
- azure-oss/storage-blob-flysystem – Flysystem adapter
- azure-oss/storage-blob-laravel – Laravel filesystem driver
- azure-oss/storage-queue – Azure Storage Queue SDK
- azure-oss/storage-queue-laravel – Laravel Queue connector
Requirements
- PHP 8.2+
league/flysystem-bundle3.7 or newer (the version that introduced the pluggableAdapterDefinitionBuilderInterface).
Install
composer require azure-oss/storage-blob-symfony
If you have Symfony Flex installed it will register AzureOss\Storage\BlobFlysystemSymfony\AzureStorageBlobFlysystemBundle for you. Otherwise add it to config/bundles.php:
return [ // ... AzureOss\Storage\BlobSymfony\AzureStorageBlobFlysystemBundle::class => ['all' => true], ];
Quickstart
Declare a BlobServiceClient service and reference it from a flysystem storage that uses the azure_oss adapter:
# config/services.yaml services: azure_blob_service_client: class: AzureOss\Storage\Blob\BlobServiceClient factory: ['AzureOss\Storage\Blob\BlobServiceClient', 'fromConnectionString'] arguments: - '%env(AZURE_STORAGE_CONNECTION_STRING)%'
# config/packages/flysystem.yaml flysystem: storages: default.storage: azure_oss: client: azure_blob_service_client container: '%env(AZURE_STORAGE_CONTAINER)%' # Optional: # prefix: 'optional/path/prefix' # mime_type_detector: 'my.custom.mime_type_detector' # visibility_handling: throw # or 'ignore' # public_container: false visibility: public
You can now autowire the storage anywhere:
use League\Flysystem\FilesystemOperator; final class MyService { public function __construct( private readonly FilesystemOperator $defaultStorage, ) { } }
Configuration reference
| Option | Required | Default | Description |
|---|---|---|---|
client |
yes | – | Service id of a configured AzureOss\Storage\Blob\BlobServiceClient. You choose the auth — connection string, SAS token, Entra ID / managed identity. |
container |
yes | – | Azure Blob Storage container name. |
prefix |
no | '' |
Path prefix prepended to every blob name. |
mime_type_detector |
no | null |
Service id of a League\MimeTypeDetection\MimeTypeDetector. Defaults to the adapter's FinfoMimeTypeDetector. |
visibility_handling |
no | throw |
What to do when setVisibility() is called (Azure has no per-blob ACL). throw or ignore. |
public_container |
no | false |
Whether the underlying container is set to public access. Affects URL generation. |
Authentication
Authentication is delegated to whatever BlobServiceClient you supply via client. Besides connection strings the SDK supports SAS tokens and token-based credentials (Entra ID, managed identity, workload identity). See the azure-oss/storage documentation for the full set of authentication helpers.
License
This project is released under the MIT License. See LICENSE for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-25