David Thielen,
I just tried below piece of code in C#.net to upload a blob using azurite !
public static void UploadUsingAzurite()
{
try
{
string file_extension, filename_withExtension, connectionString;
Stream file;
//Copy the storage account connection string from Azure portal
connectionString = "AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;";
string fileToUpload = "C:\\azure\\data.txt";
string strContainerName = "test2";
// << reading the file as filestream from local machine >>
file = new FileStream(fileToUpload, FileMode.Open);
CloudStorageAccount mycloudStorageAccount = CloudStorageAccount.Parse(connectionString);
CloudBlobClient blobClient = mycloudStorageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference(strContainerName);
//checking the container exists or not
if (container.CreateIfNotExists())
{
container.SetPermissionsAsync(new BlobContainerPermissions
{
PublicAccess =
BlobContainerPublicAccessType.Blob
});
}
//reading file name & file extention
file_extension = Path.GetExtension(fileToUpload);
filename_withExtension = Path.GetFileName(fileToUpload);
CloudBlockBlob cloudBlockBlob = container.GetBlockBlobReference(filename_withExtension);
cloudBlockBlob.Properties.ContentType = file_extension;
cloudBlockBlob.Metadata.Add("RetentionDays", "1");
cloudBlockBlob.UploadFromStream(file); // << Uploading the file to the blob >>
Console.WriteLine("Upload Completed!");
}
catch(Exception ex)
{
Console.WriteLine($"{ex.Message}");
}
}
Below is the output:

Azuritecommand line debug messages:
