DevBezz
DevBezz

Reputation: 103

What is the difference between connection string and StorageCredentials for accessing Azure Blob Storage?

I'm looking into using Azure Blob Storage and, from looking at several tutorials, I get that one can access the blob storage through a connection string or using StorageCredentials.

Is there a best practice? Or do both serve a different purpose?

Cheers, B.

Upvotes: 3

Views: 1138

Answers (1)

RamaraoAdapa
RamaraoAdapa

Reputation: 3137

Both StorageCredentials and connection string are used to connect to Storage Account using Azure SDKs.

Both StorageCredentials and connection string serve the same purpose.

StorageCredentials class supports both SAS token and account name, account key

Even the connection string supports both SAS Token and account name, account key

For more information about StorageCredentials, please refer: StorageCredentials Class (Microsoft.Azure.Storage.Auth) - Azure for .NET Developers | Microsoft Docs

For more information about Connection String, please refer: Configure a connection string - Azure Storage | Microsoft Docs

Upvotes: -1

Related Questions