Skip to content

Commit 31679ff

Browse files
Merge pull request #233057 from fhryo-msft/docs-editor/convert-append-and-page-blobs-1680311746
Update convert-append-and-page-blobs-to-block-blobs.md
2 parents bb9e021 + 786f75a commit 31679ff

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

articles/storage/blobs/convert-append-and-page-blobs-to-block-blobs.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ To convert blobs, copy them to a new location by using PowerShell, Azure CLI, or
5757
Copy-AzStorageBlob -SrcContainer $containerName -SrcBlob $srcblobName -Context $ctx -DestContainer $destcontainerName -DestBlob $destblobName -DestContext $ctx -DestBlobType Block -StandardBlobTier $destTier
5858
```
5959

60+
6. To copy a page blob snapshot to block blob, use the [Get-AzStorageBlob](/powershell/module/az.storage/get-azstorageblob) and [Copy-AzStorageBlob](/powershell/module/az.storage/copy-azstorageblob) command with `-DestBlobType` parameter as `Block`.
61+
62+
```powershell
63+
$containerName = '<source container name>'
64+
$srcPageBlobName = '<source page blob name>'
65+
$srcPageBlobSnapshotTime = '<snapshot time of source page blob>'
66+
$destContainerName = '<destination container name>'
67+
$destBlobName = '<destination block blob name>'
68+
$destTier = '<destination block blob tier>'
69+
70+
Get-AzStorageBlob -Container $containerName -Blob $srcPageBlobName -SnapshotTime $srcPageBlobSnapshotTime -Context $ctx | Copy-AzStorageBlob -DestContainer $destContainerName -DestBlob $destBlobName -DestBlobType block -StandardBlobTier $destTier -DestContext $ctx
71+
72+
```
73+
6074
> [!TIP]
6175
> The `-StandardBlobTier` parameter is optional. If you omit that parameter, then the destination blob infers its tier from the [default account access tier setting](access-tiers-overview.md#default-account-access-tier-setting). To change the tier after you've created a block blob, see [Change a blob's tier](access-tiers-online-manage.md#change-a-blobs-tier).
6276
@@ -88,6 +102,17 @@ To convert blobs, copy them to a new location by using PowerShell, Azure CLI, or
88102
az storage blob copy start --account-name $accountName --destination-blob $destBlobName --destination-container $destcontainerName --destination-blob-type BlockBlob --source-blob $srcblobName --source-container $containerName --tier $destTier
89103
```
90104

105+
4. To copy a page blob snapshot to block blob, use the [az storage blob copy start](/cli/azure/storage/blob/copy#az-storage-blob-copy-start) command and set the `--destination-blob-type` parameter to `blockBlob` along with source page blob snapshot uri.
106+
107+
```azurecli
108+
srcPageblobSnapshotUri = '<source page blob snapshot uri>'
109+
destcontainerName = '<destination container name>'
110+
destblobName = '<destination block blob name>'
111+
destTier = '<destination block blob tier>'
112+
113+
az storage blob copy start --account-name $accountName --destination-blob $destBlobName --destination-container $destcontainerName --destination-blob-type BlockBlob --source-uri $srcPageblobSnapshotUri --tier $destTier
114+
```
115+
91116
> [!TIP]
92117
> The `--tier` parameter is optional. If you omit that parameter, then the destination blob infers its tier from the [default account access tier setting](access-tiers-overview.md#default-account-access-tier-setting). To change the tier after you've created a block blob, see [Change a blob's tier](access-tiers-online-manage.md#change-a-blobs-tier).
93118
@@ -110,9 +135,10 @@ azcopy copy 'https://<storage-account-name>.<blob or dfs>.core.windows.net/<cont
110135
> The optional `--metadata` parameter overwrites any existing metadata. Therefore, if you specify metadata by using this parameter, then none of the original metadata from the source blob will be copied to the destination blob.
111136
112137
---
113-
114138
## See also
115139

116140
- [Hot, Cool, and Archive access tiers for blob data](access-tiers-overview.md)
117141
- [Set a blob's access tier](access-tiers-online-manage.md)
118142
- [Best practices for using blob access tiers](access-tiers-best-practices.md)
143+
144+

0 commit comments

Comments
 (0)