Table of Contents

Class AzureBlobStorageRestApiUtility

Namespace
Songhay
Assembly
SonghayCore.dll

Shared REST routines for Azure BLOB Storage.

public static class AzureBlobStorageRestApiUtility
Inheritance
AzureBlobStorageRestApiUtility
Inherited Members

Methods

DeleteBlobAsync(string, string, string)

DELETEs the BLOB of the specified ‘file’ name.

public static Task DeleteBlobAsync(string connectionString, string containerName, string fileName)

Parameters

connectionString string

Azure BLOB Storage connection string

containerName string

Azure BLOB Storage container name

fileName string

BLOB ‘file’ name

Returns

Task

Exceptions

HttpRequestException

DownloadBlobToStringAsync(string, string, string)

GETs the BLOB of the specified ‘file’ name.

public static Task<string> DownloadBlobToStringAsync(string connectionString, string containerName, string fileName)

Parameters

connectionString string

Azure BLOB Storage connection string

containerName string

Azure BLOB Storage container name

fileName string

BLOB ‘file’ name

Returns

Task<string>

Returns the string contents of the file.

Exceptions

HttpRequestException

GetCloudStorageMetadata(string)

Gets the conventional Azure BLOB Storage metadata from the specified connection string.

public static (string accountName, string accountKey, string apiVersion) GetCloudStorageMetadata(string connectionString)

Parameters

connectionString string

Azure BLOB Storage connection string

Returns

(string accountName, string accountKey, string apiVersion)

Returns conventional named tuple.

Exceptions

NullReferenceException
DataException

GetStorageUriBuilder(string, string)

Builds the URI for Azure BLOB Storage.

public static UriBuilder GetStorageUriBuilder(string accountName, string containerName)

Parameters

accountName string

Azure BLOB Storage account name

containerName string

Azure BLOB Storage container name

Returns

UriBuilder

Returns the UriBuilder

ListContainerAsync(string, string)

Lists the contents of the specified BLOB container.

public static Task<string> ListContainerAsync(string connectionString, string containerName)

Parameters

connectionString string

Azure BLOB Storage connection string

containerName string

Azure BLOB Storage container name

Returns

Task<string>

Returns the contents of the container as an XMLstring.

Exceptions

HttpRequestException

UploadBlobAsync(string, string, string, string)

PUTs the BLOB of the specified ‘file’ name.

public static Task UploadBlobAsync(string connectionString, string containerName, string fileName, string content)

Parameters

connectionString string

Azure BLOB Storage connection string

containerName string

Azure BLOB Storage container name

fileName string

BLOB ‘file’ name

content string

The string contents of the ‘file.’

Returns

Task

Exceptions

HttpRequestException