Share via


BlobsStorage class

A class that implements the Storage interface using Azure Blob Storage. Provides persistence for bot state data using Azure's Blob Storage service.

Constructors

BlobsStorage(string, string, BlobsStorageOptions, string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential)

Creates a new instance of the BlobsStorage class.

Methods

delete(string[])

Deletes storage items from blob storage.

read(string[])

Reads storage items from blob storage.

write(StoreItems)

Writes storage items to blob storage.

Constructor Details

BlobsStorage(string, string, BlobsStorageOptions, string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential)

Creates a new instance of the BlobsStorage class.

new BlobsStorage(containerName: string, connectionString?: string, options?: BlobsStorageOptions, url?: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential)

Parameters

containerName

string

The name of the Blob container to use

connectionString

string

Optional, The Azure Storage connection string

options
BlobsStorageOptions

Optional configuration settings for the storage provider

url

string

Optional URL to the blob service (used instead of connectionString if provided)

credential

StorageSharedKeyCredential | AnonymousCredential | TokenCredential

Optional credential for authentication (used with url if provided)

Method Details

delete(string[])

Deletes storage items from blob storage.

function delete(keys: string[]): Promise<void>

Parameters

keys

string[]

Array of item keys to delete

Returns

Promise<void>

A promise that resolves when the delete operation is complete

read(string[])

Reads storage items from blob storage.

function read(keys: string[]): Promise<StoreItems>

Parameters

keys

string[]

Array of item keys to read

Returns

Promise<StoreItems>

A promise that resolves to a StoreItems object containing the retrieved items

write(StoreItems)

Writes storage items to blob storage.

function write(changes: StoreItems): Promise<void>

Parameters

changes
StoreItems

The items to write to storage

Returns

Promise<void>

A promise that resolves when the write operation is complete