Skip to content

Commit a907306

Browse files
Merge pull request #225022 from tamram/tamram23-0125a
incorp public PRs for LCM, versioning
2 parents 4dece40 + c53f55c commit a907306

File tree

6 files changed

+71
-8
lines changed

6 files changed

+71
-8
lines changed

articles/storage/blobs/lifecycle-management-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Use Azure Storage lifecycle management policies to create automated
55
author: normesta
66

77
ms.author: normesta
8-
ms.date: 01/05/2023
8+
ms.date: 01/25/2023
99
ms.service: storage
1010
ms.subservice: common
1111
ms.topic: conceptual
@@ -138,7 +138,7 @@ Filters include:
138138
| Filter name | Filter type | Notes | Is Required |
139139
|-------------|-------------|-------|-------------|
140140
| blobTypes | An array of predefined enum values. | The current release supports `blockBlob` and `appendBlob`. Only delete is supported for `appendBlob`, set tier isn't supported. | Yes |
141-
| prefixMatch | An array of strings for prefixes to be matched. Each rule can define up to 10 case-sensitive prefixes. A prefix string must start with a container name. For example, if you want to match all blobs under `https://myaccount.blob.core.windows.net/sample-container/blob1/...` for a rule, the prefixMatch is `sample-container/blob1`. | If you don't define prefixMatch, the rule applies to all blobs within the storage account. | No |
141+
| prefixMatch | An array of strings for prefixes to be matched. Each rule can define up to 10 case-sensitive prefixes. A prefix string must start with a container name. For example, if you want to match all blobs under `https://myaccount.blob.core.windows.net/sample-container/blob1/...` for a rule, the prefixMatch is `sample-container/blob1`.<br /><br />To match the blob name exactly, include the trailing forward slash ('/'), *e.g.*, `sample-container/blob1/`. To match the name pattern, omit the trailing forward slash, *e.g.*, `sample-container/blob1`. | If you don't define prefixMatch, the rule applies to all blobs within the storage account. | No |
142142
| blobIndexMatch | An array of dictionary values consisting of blob index tag key and value conditions to be matched. Each rule can define up to 10 blob index tag condition. For example, if you want to match all blobs with `Project = Contoso` under `https://myaccount.blob.core.windows.net/` for a rule, the blobIndexMatch is `{"name": "Project","op": "==","value": "Contoso"}`. | If you don't define blobIndexMatch, the rule applies to all blobs within the storage account. | No |
143143

144144
To learn more about the blob index feature together with known issues and limitations, see [Manage and find data on Azure Blob Storage with blob index](storage-manage-find-blobs.md).
43.7 KB
Loading

articles/storage/blobs/object-replication-overview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: normesta
66

77
ms.service: storage
88
ms.topic: conceptual
9-
ms.date: 08/09/2022
9+
ms.date: 01/25/2023
1010
ms.author: normesta
1111
ms.subservice: blobs
1212
ms.custom: devx-track-azurepowershell
@@ -55,6 +55,8 @@ Object replication asynchronously copies block blobs in a container according to
5555

5656
Object replication requires that blob versioning is enabled on both the source and destination accounts. When a replicated blob in the source account is modified, a new version of the blob is created in the source account that reflects the previous state of the blob, before modification. The current version in the source account reflects the most recent updates. Both the current version and any previous versions are replicated to the destination account. For more information about how write operations affect blob versions, see [Versioning on write operations](versioning-overview.md#versioning-on-write-operations).
5757

58+
If your storage account has object replication policies in effect, you cannot disable blob versioning for that account. You must delete any object replication policies on the account before disabling blob versioning.
59+
5860
### Deleting a blob in the source account
5961

6062
When a blob in the source account is deleted, the current version of the blob becomes a previous version, and there's no longer a current version. All existing previous versions of the blob are preserved. This state is replicated to the destination account. For more information about how to delete operations affect blob versions, see [Versioning on delete operations](versioning-overview.md#versioning-on-delete-operations).

articles/storage/blobs/versioning-enable.md

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: normesta
77

88
ms.service: storage
99
ms.topic: how-to
10-
ms.date: 06/07/2021
10+
ms.date: 01/25/2023
1111
ms.author: normesta
1212
ms.subservice: blobs
1313
ms.custom: devx-track-azurepowershell
@@ -21,6 +21,8 @@ This article shows how to enable or disable blob versioning for the storage acco
2121

2222
## Enable blob versioning
2323

24+
You can enable blob versioning with the Azure portal, PowerShell, Azure CLI, or an Azure Resource Manager template.
25+
2426
# [Azure portal](#tab/portal)
2527

2628
To enable blob versioning for a storage account in the Azure portal:
@@ -29,7 +31,7 @@ To enable blob versioning for a storage account in the Azure portal:
2931
1. Under **Blob service**, choose **Data protection**.
3032
1. In the **Versioning** section, select **Enabled**.
3133

32-
:::image type="content" source="media/versioning-enable/portal-enable-versioning.png" alt-text="Screenshot showing how to enable blob versioning in Azure portal":::
34+
:::image type="content" source="media/versioning-enable/portal-enable-versioning.png" alt-text="Screenshot showing how to enable blob versioning in Azure portal":::
3335

3436
# [PowerShell](#tab/powershell)
3537

@@ -91,6 +93,63 @@ For more information about deploying resources with templates in the Azure porta
9193

9294
---
9395

96+
## List blob versions
97+
98+
To display a blob's versions, use the Azure portal, PowerShell, or Azure CLI. You can also list a blob's versions using one of the Blob Storage SDKs.
99+
100+
# [Azure portal](#tab/portal)
101+
102+
To list a blob's versions in the Azure portal:
103+
104+
1. Navigate to your storage account in the portal, then navigate to the container that contains your blob.
105+
1. Select the blob for which you want to list versions.
106+
1. Select the **Versions** tab to display the blob's versions.
107+
108+
:::image type="content" source="media/versioning-enable/portal-list-blob-versions.png" alt-text="Screenshot showing how to list blob versions in the Azure portal":::
109+
110+
# [PowerShell](#tab/powershell)
111+
112+
To list a blob's versions with PowerShell, call the [Get-AzStorageBlob](/powershell/module/az.storage/get-azstorageblob) command with the `-IncludeVersion` parameter:
113+
114+
```azurepowershell
115+
$account = Get-AzStorageAccount -ResourceGroupName <resource-group> -Name <storage-account>
116+
$ctx = $account.Context
117+
$container = "<container-name>"
118+
119+
$blobs = Get-AzStorageBlob -Container $container -Prefix "ab" -IncludeVersion -Context $ctx
120+
121+
foreach($blob in $blobs)
122+
{
123+
Write-Host $blob.Name
124+
Write-Host $blob.VersionId
125+
Write-Host $blob.IsLatestVersion
126+
}
127+
```
128+
129+
# [Azure CLI](#tab/azure-cli)
130+
131+
To list a blob's versions with Azure CLI, call the [az storage blob directory list](/cli/azure/storage/blob/directory#az-storage-blob-directory-list) command with the `--include v` parameter:
132+
133+
```azurecli
134+
storageAccount="<storage-account>"
135+
containerName="<container-name>"
136+
137+
az storage blob list \
138+
--container-name $containerName \
139+
--prefix "ab" \
140+
--query "[[].name, [].versionId]" \
141+
--account-name $storageAccount \
142+
--include v \
143+
--auth-mode login \
144+
--output tsv
145+
```
146+
147+
# [Template](#tab/template)
148+
149+
N/A
150+
151+
---
152+
94153
## Modify a blob to trigger a new version
95154

96155
The following code example shows how to trigger the creation of a new version with the Azure Storage client library for .NET, version [12.5.1](https://www.nuget.org/packages/Azure.Storage.Blobs/12.5.1) or later. Before running this example, make sure you have enabled versioning for your storage account.
@@ -99,7 +158,7 @@ The example creates a block blob, and then updates the blob's metadata. Updating
99158

100159
:::code language="csharp" source="~/azure-storage-snippets/blobs/howto/dotnet/dotnet-v12/CRUD.cs" id="Snippet_UpdateVersionedBlobMetadata":::
101160

102-
## List blob versions
161+
## List blob versions with .NET
103162

104163
To list blob versions or snapshots with the .NET v12 client library, specify the [BlobStates](/dotnet/api/azure.storage.blobs.models.blobstates) parameter with the **Version** field.
105164

articles/storage/blobs/versioning-overview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: normesta
77

88
ms.service: storage
99
ms.topic: conceptual
10-
ms.date: 01/20/2023
10+
ms.date: 01/25/2023
1111
ms.author: normesta
1212
ms.subservice: blobs
1313
ms.custom: devx-track-azurepowershell
@@ -122,6 +122,8 @@ After versioning is disabled, modifying the current version creates a blob that
122122

123123
You can read or delete versions using the version ID after versioning is disabled. You can also list a blob's versions after versioning is disabled.
124124

125+
Object replication relies on blob versioning. Before you can disable blob versioning, you must delete any object replication policies on the account. For more information about object replication, see [Object replication for block blobs](object-replication-overview.md).
126+
125127
The following diagram shows how modifying a blob after versioning is disabled creates a blob that is not versioned. Any existing versions associated with the blob persist.
126128

127129
:::image type="content" source="media/versioning-overview/modify-base-blob-versioning-disabled.png" alt-text="Diagram showing that modification of a current version after versioning is disabled creates a blob that is not a version.":::

articles/storage/common/storage-sas-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: jimmart-dev
77

88
ms.service: storage
99
ms.topic: conceptual
10-
ms.date: 10/25/2022
10+
ms.date: 01/25/2023
1111
ms.author: jammart
1212
ms.reviewer: dineshm
1313
ms.subservice: common

0 commit comments

Comments
 (0)