azure-oss / storage-common
Shared primitives for Azure Storage PHP SDK packages
Package info
github.com/php-oss-for-azure/azure-storage-common-php
pkg:composer/azure-oss/storage-common
Requires
- php: ^8.2
- azure-oss/identity: ^1.0
- caseyamcl/guzzle_retry_middleware: ^2.10
- guzzlehttp/guzzle: ^7.8
README
Shared authentication, HTTP pipeline, API version, ETag, and SAS primitives used by the Azure Storage PHP SDK packages.
Important
This package is community-maintained and is not affiliated with, endorsed by, or supported by Microsoft.
Install
composer require azure-oss/storage-common
When to use this package
Most applications should install a top-level client package such as azure-oss/storage-blob or azure-oss/storage-queue.
Install azure-oss/storage-common directly when you need low-level storage building blocks such as:
StorageSharedKeyCredentialAccountSasBuilderApiVersionHttpClientOptions- shared middleware and connection string helpers
Quickstart
Generate an account SAS token:
<?php use AzureOss\Storage\Common\Auth\StorageSharedKeyCredential; use AzureOss\Storage\Common\Sas\AccountSasBuilder; $credential = new StorageSharedKeyCredential( getenv('AZURE_STORAGE_ACCOUNT_NAME'), getenv('AZURE_STORAGE_ACCOUNT_KEY'), ); $sas = AccountSasBuilder::new() ->setServices('b') ->setResourceTypes('sco') ->setPermissions('rl') ->setExpiresOn(new DateTimeImmutable('+1 hour')) ->build($credential); echo $sas;
Features
- Shared key authentication primitives for Azure Storage
- Middleware for request IDs, dates, API version headers, retries, and authorization
- Account SAS builders and related value objects
- Connection string and Storage URI helpers
- Shared
ApiVersionandETagvalue objects used across Storage packages
Documentation
You can read the documentation here.
Related packages
- azure-oss/storage — Meta package for the Storage SDKs
- azure-oss/identity — Microsoft Entra ID token authentication
- azure-oss/storage-blob — Blob Storage SDK
- azure-oss/storage-blob-flysystem — Flysystem adapter
- azure-oss/storage-blob-flysystem-bundle — Symfony Flysystem bundle
- azure-oss/storage-blob-laravel — Laravel filesystem driver
- azure-oss/storage-queue — Queue Storage SDK
- azure-oss/storage-queue-laravel — Laravel queue connector
- azure-oss/storage-file-share — File Share SDK
Maintenance
This package is part of the community-maintained PHP OSS for Azure project. It is an independent project and is not affiliated with or endorsed by Microsoft.
License
This project is released under the MIT License. See LICENSE for details.