using Azure.Storage;
using Azure.Storage.Blobs;
using System;
namespace Hast.Vitis.Models;
public class AzureStorageConfiguration
{
///
/// Gets or sets the storage account name. See
/// here for instructions.
///
public string StorageAccountName { get; set; }
///
/// Gets or sets the key to access the account of .
///
public string StorageAccountKey { get; set; }
public string GenerateStorageConnectionString() =>
string.Join(
separator: ';',
"DefaultEndpointsProtocol=https",
$"AccountName={StorageAccountName}",
$"AccountKey={StorageAccountKey}",
"EndpointSuffix=core.windows.net");
public BlobContainerClient CreateBlobContainerClient(string blobContainerName) =>
new(
new Uri($"https://{StorageAccountName}.blob.core.windows.net/{blobContainerName}"),
new StorageSharedKeyCredential(StorageAccountName, StorageAccountKey));
}