Registry / storage / adonis-drive-azure-storage

adonis-drive-azure-storage

JSON →
library5.1.0jsnpmunverified

Azure Blob Storage driver for AdonisJS Drive, version 5.1.0. This package integrates Azure Blob Storage as a filesystem driver for the AdonisJS Drive abstraction, allowing seamless file uploads, downloads, and management using Azure's cloud storage. It supports container configuration, connection strings, and SAS tokens. Updated regularly alongside AdonisJS releases, it is the go-to solution for AdonisJS applications needing Azure storage. Compared to other drivers, it offers first-class TypeScript support and follows AdonisJS conventions.

npm install adonis-drive-azure-storage
INSTALL
IMPORT
SIG · ADONIS-DRIVE-AZURE
A
adonis-drive-azure-storage
storagejavascriptv5.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

azureStorageDriver
import { azureStorageDriver } from 'adonis-drive-azure-storage'
const { azureStorageDriver } = require('adonis-drive-azure-storage')
Package is ESM-only; CommonJS require is not supported.
AzureStorageDriverConfig
import type { AzureStorageDriverConfig } from 'adonis-drive-azure-storage'
Type import for TypeScript users to configure the driver.
default export
import AzureDrive from 'adonis-drive-azure-storage'
const AzureDrive = require('adonis-drive-azure-storage')
Default export is the Azure storage driver class; exported as default since v5.

Configures AdonisJS Drive to use Azure Blob Storage with environment variables for credentials.

import { defineConfig } from '@adonisjs/drive' import { azureStorageDriver } from 'adonis-drive-azure-storage' export default defineConfig({ disks: { azure: { driver: azureStorageDriver({ containerName: process.env.AZURE_CONTAINER ?? '', connectionString: process.env.AZURE_CONNECTION_STRING ?? '', sasToken: process.env.AZURE_SAS_TOKEN ?? '', }), }, }, }) // Usage in a controller or service: import Drive from '@adonisjs/drive/services/main' const file = await Drive.use('azure').put('path/to/file.txt', 'file content')
Debug
Known issues
breakingAdonisJS core breaking changes in v6 affecting Drive drivers, refer to official migration guide.
fix
Update adonis-drive-azure-storage to latest major version; see https://docs.adonisjs.com/guides/upgrade-guide
affects: >=6.0.0
deprecatedConnection string authentication is less secure; prefer managed identity or SAS tokens.
fix
Use Azure SDK authentication options such as DefaultAzureCredential.
affects: >=5.0.0
gotchaContainer name must be lowercase and cannot contain underscores.
fix
Use only lowercase letters, numbers, and hyphens in container name.
affects: >=2.0.0
Errors
Common errors & fixes
Error: SAS token is not provided
Missing or invalid SAS token in configuration.
fix
Provide a valid SAS token via environment variable AZURE_SAS_TOKEN.
Error: Container not found
The specified container does not exist in Azure Blob Storage.
fix
Create the container manually or enable automatic creation if supported.
TypeError: azureStorageDriver is not a function
Using CommonJS require instead of ESM import.
fix
Change to import { azureStorageDriver } from 'adonis-drive-azure-storage'
Upgrade
Version history
5.1.0latest on npm
Audit
Dependencies
@adonisjs/corerequiredPeer dependency required for Drive integration and AdonisJS framework
Agent activity
45 hits · last 30 days
node
36
OpenAI (training)
2
Resources
adonis-drive-azure-storage — npm install adonis-drive-azure-storage · libregistry