azure-oss/storage-common

Shared primitives for Azure Storage PHP SDK packages

Maintainers

Package info

github.com/php-oss-for-azure/azure-storage-common-php

pkg:composer/azure-oss/storage-common

Transparency log

Statistics

Installs: 416 791

Dependents: 3

Suggesters: 0

Stars: 0

2.1.1 2026-06-30 13:20 UTC

This package is auto-updated.

Last update: 2026-06-30 13:24:05 UTC


README

Latest Version on Packagist Packagist Downloads

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:

  • StorageSharedKeyCredential
  • AccountSasBuilder
  • ApiVersion
  • HttpClientOptions
  • 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 ApiVersion and ETag value objects used across Storage packages

Documentation

You can read the documentation here.

Related packages

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.