What is the difference between the Microsoft.Azure.Storage and WindowsAzure.Storage Nuget packages?
Asked Answered
M

2

48

I've always found this very confusing:

  • There is a WindowsAzure.Storage NuGet package authored by Microsoft which allows you to work with, for example, blob storage (creating blobs, etc.).
  • There are also Microsoft.Azure.Storage.* packages which accomplish the same thing, also authored by Microsoft.

If your project happens to have dependencies on both, you can have naming conflicts e.g. (The type 'CloudStorageAccount' exists in both 'Microsoft.Azure.Storage.Common, ... and 'Microsoft.WindowsAzure.Storage, ...).

Here are links to the two alternatives:

https://learn.microsoft.com/en-us/dotnet/api/overview/azure/storage?view=azure-dotnet

https://github.com/Azure/azure-storage-net/blob/master/README.md

What is the difference and when would I be motivated to use one over the other?

Mcilroy answered 8/11, 2018 at 19:36 Comment(1)
I'd like to extend the question to cover Azure.Storage.BlobsYorgo
B
52

WindowsAzure.Storage(latest is v9.3.2) is the legacy Storage SDK we always use and Microsoft.Azure.Storage.*(latest v9.4.0) is its new release, nuget available about one year.

Check the changelog of Storage .NET SDK. List part of those important differences/changes.

  1. Microsoft.Azure.Storage splits libraries to three parts, Blob, Queue and File, which means we can install separate package instead of the full edition.

  2. Microsoft.Azure.Storage doesn't support Table API, it is transferred to Microsoft.Azure.Cosmos.Table.

  3. Microsoft.Azure.Storage added NetStandard2.0 target support since 9.4.0-preview, which supports synchronous methods wrapped over the asynchronous APIs. WindowsAzure.Storage on NetStandard only has asynchronous APIs.

  4. Microsoft.Azure.Storage v9.4 package moves back to use Microsoft.WindowsAzure.Storage namespace temporarily to ease the transition for existing libraries.

Just make choices based on our requirement.

Bovine answered 9/11, 2018 at 1:55 Comment(4)
removing Tablestorage access from the newer package (basically blocking TS users from .NET Core) is hopefully gonna be fixed, right now it's still full framework onlyChauffeur
I don't understand the choice from Microsoft to keep the old WindowsAzure.Storage namespace in the new Microsoft.Azure.Storage library. Now I'm ending up with a namespace conflict because I also reference a 3rd party library that uses the old WindowsAzure.Storage. I'm trying to set an extern alias in my .NET Core project but it's not working. What a hell, so stupid choice MicrosoftSpinthariscope
@JérômeMEVEL Microsoft used the old namespaces in version 9 of Microsoft.Azure.Storage, in version 10 (released 2019-04-09: nuget.org/packages/Microsoft.Azure.Storage.Blob/10.0.0 ) the namespaces were changed to Microsoft.Azure.Storage.*). Just stick to version 10+ and you'll be fine.Bureaucratize
@Bureaucratize thanks, updating the library to latest version resolves the conflicts.Leningrad
M
40

There are now three levels:

  1. WindowsAzure.Storage - up to v9.3.3 - don't use this anymore.
  2. Microsoft.Azure.Storage - v9.4.0 to v11.1.7 - older
  3. Azure.Storage - v12.x - use this library.

All the Azure libraries are being consolidated into the Azure namespace, so the newer libraries all start with Azure (not Microsoft.Azure or WindowsAzure) and you should use those when available.

Mogilev answered 15/6, 2020 at 17:40 Comment(3)
It seems to only be partially correct: for example, Microsoft.Azure.Storage.DataMovement is the up-to-date namespace; there's no non-Microsoft.-prefix oneAili
I believe these are called Tracks 0, 1 and 2 based on what I learned from here: github.com/Azure/azure-sdk-for-net/issues/10842 - but I am not 100% sure.Maggard
Is Azure.Storage the same with its deprecated libraries?Lock

© 2022 - 2024 — McMap. All rights reserved.