You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/blobs/versioning-enable.md
+84-2Lines changed: 84 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ author: tamram
7
7
8
8
ms.service: storage
9
9
ms.topic: how-to
10
-
ms.date: 04/30/2020
10
+
ms.date: 05/05/2020
11
11
ms.author: tamram
12
12
ms.subservice: blobs
13
13
---
@@ -64,7 +64,89 @@ For more information about deploying resources with templates in the Azure porta
64
64
65
65
## Modify a blob to trigger a new version
66
66
67
-
.NET example here
67
+
The following code example shows how to trigger the creation of a new version with the Azure Storage client library for .NET version 12. Before running this example, make sure you have enabled versioning for your storage account.
68
+
69
+
The example creates a block blob, and then updates the blob's metadata. Updating the blob's metadata triggers the creation of a new version. The example retrieves the initial version and the current version, and shows that only the current version includes the metadata.
70
+
71
+
```csharp
72
+
public static async Task UpdateVersionedBlobMetadata(string containerName, string blobName)
73
+
{
74
+
// Create a new service client from the connection string.
75
+
BlobServiceClient blobServiceClient = new BlobServiceClient(ConnectionString);
Copy file name to clipboardExpand all lines: articles/storage/blobs/versioning-overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ author: tamram
7
7
8
8
ms.service: storage
9
9
ms.topic: conceptual
10
-
ms.date: 04/30/2020
10
+
ms.date: 05/05/2020
11
11
ms.author: tamram
12
12
ms.subservice: blobs
13
13
---
@@ -240,7 +240,7 @@ In scenario 1, the blob has a prior version. The blob has not been updated since
240
240
241
241
#### Scenario 2
242
242
243
-
In scenario 2, one block (block 3 in the diagram) in the blob has been updated. Even though the updated block contains the same data and the same ID, it is not the same as block 3 in the previous version. As a result, the account is charged for four blocks. ???here, the blob shown in #1 should have two versions - do we want to show that here?
243
+
In scenario 2, one block (block 3 in the diagram) in the blob has been updated. Even though the updated block contains the same data and the same ID, it is not the same as block 3 in the previous version. As a result, the account is charged for four blocks.
@@ -252,7 +252,7 @@ In scenario 3, the blob has been updated, but the version has not. Block 3 was r
252
252
253
253
#### Scenario 4
254
254
255
-
In scenario 4, the base blob has been completely updated and contains none of its original blocks. As a result, the account is charged for all eight unique blocks -- four in the base blob, and four in the previous version. This scenario can occur if you are using an update method such as [UploadFromFile][dotnet_UploadFromFile], [UploadText][dotnet_UploadText], [UploadFromStream][dotnet_UploadFromStream], or [UploadFromByteArray][dotnet_UploadFromByteArray], because these methods replace all of the contents of a blob.
255
+
In scenario 4, the base blob has been completely updated and contains none of its original blocks. As a result, the account is charged for all eight unique blocks — four in the base blob, and four in the previous version. This scenario can occur if you are writing to a blob with the Put Blob operation, because it replaces the entire contents of the base blob.
0 commit comments