C# Code to write onto a Azure BlobStorage .Net 5.0

Job ID: 32023743

Budget: $10 – $30 USD

I´ve being forced to migrate to .net 5.0 (Nuget Azure.Storage.Blobs V12) and my code stopped working.
I only need the code to upload stream onto a BlobStorage.

//Once defined
public static string BlobConnectionString = "DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=Z..Z;EndpointSuffix=core.windows.net";
public static string containerName = "yyyy/zzzz/";

// And excecuted:
BlobServiceClient blobServiceClient = new BlobServiceClient(BlobConnectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(containerName);

How to upload a LogFile
var content = "Starting at " + DateTime.Now.ToShortDateString() + Environment.NewLine;
var blobClient = containerClient.GetBlobClient("LogFile.txt");

//I can´t execute this write on to the BlobStorage
await blobClient.UploadAsync(content, overwrite, cancellationToken);
Related categories: C# Programming Microsoft Azure .NET 5.0/6