Skip to content

Commit ffbb276

Browse files
Misc blobs migration guide fixes (Azure#17601)
* Misc blobs migration guide fixes Fixed some reported ambiguities and rendering bugs. * Fixed variable name in sample project * build error Co-authored-by: jschrepp-MSFT <41338290+jschrepp-MSFT@users.noreply.github.com>
1 parent 368f65e commit ffbb276

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ v12
6666
A `TokenCredential` abstract class (different API surface than v11) exists in the Azure.Core package that all libraries of the new Azure SDK family depend on, and can be used to construct Storage clients. Implementations of this class can be found separately in the [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity) package. [`DefaultAzureCredential`](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity#defaultazurecredential) is a good starting point, with code as simple as the following:
6767

6868
```C# Snippet:SampleSnippetsBlobMigration_TokenCredential
69-
BlobServiceClient client = new BlobServiceClient(new Uri(accountUri), new DefaultAzureCredential());
69+
BlobServiceClient client = new BlobServiceClient(new Uri(serviceUri), new DefaultAzureCredential());
7070
```
7171

7272
You can view more [Identity samples](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity#examples) for how to authenticate with the Identity package.
@@ -196,7 +196,7 @@ The legacy SDK used a stateful model. There were container and blob objects that
196196

197197
The modern SDK has taken a client-based approach. There are no objects designed to be representations of storage resources, but instead clients that act as your mechanism to interact with your storage resources in the cloud. Clients hold no state of your resources.
198198

199-
The hierarchical structure of Azure Blob Storage can be understood by the following diagram:
199+
The hierarchical structure of Azure Blob Storage can be understood by the following diagram:
200200
![Blob Storage Hierarchy](https://docs.microsoft.com/en-us/azure/storage/blobs/media/storage-blobs-introduction/blob1.png)
201201

202202
In the interest of simplifying the API surface, v12 uses three top level clients to match this structure that can be used to interact with a majority of your resources: `BlobServiceClient`, `BlobContainerClient`, and `BlobClient`. Note that blob-type-specific operations can still be accessed by their specific clients, as in v11.
@@ -209,7 +209,7 @@ We recommend `BlobClient` as a starting place when migrating code that used v11'
209209

210210
#### Migrating from CloudBlobDirectory
211211

212-
Note the absence of a v12 equivalent for v11's `CloudBlobDirectory`. Directories were an SDK-only concept that did not exist in Azure Blob Storage, and which were not brought forwards into the modern Storage SDK. As shown by the diagram in [Client Structure](#client-structure)], containers only contain a flat list of blobs, but those blobs can be named and listed in ways that imply a folder-like structure. See our [Listing Blobs in a Container](#listing-blobs-in-a-container) migration samples later in this guide for more information.
212+
Note the absence of a v12 equivalent for v11's `CloudBlobDirectory`. Directories were an SDK-only concept that did not exist in Azure Blob Storage, and which were not brought forwards into the modern Storage SDK. As shown by the diagram in [Client Structure](#client-structure), containers only contain a flat list of blobs, but those blobs can be named and listed in ways that imply a folder-like structure. See our [Listing Blobs in a Container](#listing-blobs-in-a-container) migration samples later in this guide for more information.
213213

214214
For those whose workloads revolve around manipulating directories and heavily relied on the leagacy SDKs abstraction of this structure, consider the [pros and cons of enabling hierarchical namespace](https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-namespace) on your storage account, which would allow switching to the [Data Lake gen 2 SDK](https://docs.microsoft.com/dotnet/api/overview/azure/storage.files.datalake-readme), whose migration is not covered in this document.
215215

sdk/storage/Azure.Storage.Blobs/samples/Sample03_Migrations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public class Sample03_Migrations : SampleTest
2727
[Test]
2828
public void AuthWithTokenCredential()
2929
{
30-
string accountUri = this.StorageAccountBlobUri.ToString();
30+
string serviceUri = this.StorageAccountBlobUri.ToString();
3131

3232
#region Snippet:SampleSnippetsBlobMigration_TokenCredential
33-
BlobServiceClient client = new BlobServiceClient(new Uri(accountUri), new DefaultAzureCredential());
33+
BlobServiceClient client = new BlobServiceClient(new Uri(serviceUri), new DefaultAzureCredential());
3434
#endregion
3535

3636
client.GetProperties();

0 commit comments

Comments
 (0)