Carolyn Schroeder
Carolyn Schroeder

Reputation: 31

Problem with Microsoft.Azure.Storage.Common

I have been using WindowsAzure.Storage for some web apps. In the .NET Framework 4.8 it is marked as deprecated. I tried to replace it with Microsoft.Azure.Storage.Common and Microsoft.Azure.Storage.Blob which should have been sufficient for my purposes. Here is the code I have:

var account = GetCloudStorageAccount();
var blobClient = account.CreateCloudBlobClient();
var blobContainerName = containerName;
var container = blobClient.GetContainerReference(blobContainerName);
var blob = container.GetBlobReference(name);
blob.DownloadToStream(outputStream);

When I tried to run it with the new packages, I got

Exception Type: Microsoft.Azure.Storage.StorageException
Exception Message: BeginWrite is not supported
Exception Source: Microsoft.Azure.Storage.Common

Any solution?

Upvotes: 0

Views: 1032

Answers (1)

rickvdbosch
rickvdbosch

Reputation: 15619

Looks like you updated to a deprecated version. The Microsoft.Azure.Storage.Common and the Microsoft.Azure.Storage.Blob package

have been replaced by the following new Azure SDKs.

The latest libraries to interact with the Azure Storage service are:

It is recommended that you move to the new package.

Migrate to Azure.Storage.Blobs to use the most recent package to interact with Blobs in Azure.

Upvotes: 1

Related Questions