Skip to content

Commit f3611e8

Browse files
authored
Merge pull request #223242 from normesta/cost-management
Access tiers best practices
2 parents fa05b9b + 4d61cd3 commit f3611e8

File tree

6 files changed

+203
-4
lines changed

6 files changed

+203
-4
lines changed

articles/storage/blobs/TOC.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,16 @@ items:
202202
href: ../common/storage-redundancy.md?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json
203203
- name: Customer-managed failover for disaster recovery
204204
href: ../common/storage-disaster-recovery-guidance.md?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json
205-
- name: Blob access tiers and lifecycle management
205+
- name: Access tiers and lifecycle management
206206
items:
207-
- name: Overview
207+
- name: Access tiers overview
208208
href: access-tiers-overview.md
209-
- name: Blob rehydration from Archive tier
210-
href: archive-rehydrate-overview.md
209+
- name: Access tiers best practices
210+
href: access-tiers-best-practices.md
211211
- name: Lifecycle management policies
212212
href: lifecycle-management-overview.md
213+
- name: Blob rehydration from archive tier
214+
href: archive-rehydrate-overview.md
213215
- name: Object replication
214216
href: object-replication-overview.md
215217
- name: Performance and scalability
@@ -342,6 +344,8 @@ items:
342344
href: blob-inventory-how-to.md
343345
- name: Calculate blob count and total size
344346
href: calculate-blob-count-size.md
347+
- name: Convert append and page blobs to block blobs
348+
href: convert-append-and-page-blobs-to-block-blobs.md
345349
- name: Authorize access to blob data
346350
items:
347351
- name: Authorization options for users
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Best practices for using blob access tiers
3+
titleSuffix: Azure Storage
4+
description: Learn about best practice guidelines that help you use access tiers to optimize performance and reduce costs.
5+
author: normesta
6+
7+
ms.author: normesta
8+
ms.date: 01/20/2023
9+
ms.service: storage
10+
ms.subservice: blobs
11+
ms.topic: conceptual
12+
---
13+
14+
# Best practices for using blob access tiers
15+
16+
This article provides best practice guidelines that help you use access tiers to optimize performance and reduce costs. To learn more about access tiers, see [Hot, cool, and archive access tiers for blob data](access-tiers-overview.md?tabs=azure-portal).
17+
18+
## Choose the most cost-efficient access tiers
19+
20+
You can reduce costs by placing blob data into the most cost-efficient access tiers. Choose from three tiers that are designed to optimize your costs around data use. For example, the hot tier has a higher storage cost but lower read cost. Therefore, if you plan to access data frequently, the hot tier might be the most cost-efficient choice. If you plan to read data less frequently, the cool or archive tier might make the most sense because it raises the cost of reading data while reducing the cost of storing data.
21+
22+
To identify the most optimal access tier, try to estimate what percentage of the data will be read on a monthly basis. The following chart shows the impact on monthly spending given various read percentages.
23+
24+
> [!div class="mx-imgBorder"]
25+
> ![Chart that shows a bar for each tier which represents the monthly cost based on percentage read pattern](./media/access-tiers-best-practices/read-pattern-access-tiers.png)
26+
27+
To model and analyze the cost of using cool versus archive storage, see [Archive versus cool](archive-cost-estimation.md#archive-versus-cool). You can apply similar modeling techniques to compare the cost of hot to cool or archive.
28+
29+
## Migrate data directly to the most cost-efficient access tiers
30+
31+
Choosing the most optimal tier up front can reduce costs. If you change the tier of a block blob that you've already uploaded, then you'll pay the cost of writing to the initial tier when you first upload the blob, and then pay the cost of writing to the desired tier. If you change tiers by using a lifecycle management policy, then that policy will require a day to take effect and a day to complete execution. You'll also incur the capacity cost of storing data in the initial tier prior to the tier change.
32+
33+
- For guidance about how to upload to a specific access tier, see [Set a blob's access tier](access-tiers-online-manage.md).
34+
35+
- For offline data movement to the desired tier, see [Azure Data Box](/products/databox/).
36+
37+
## Move data into the most cost-efficient access tiers
38+
39+
After data is uploaded, you should periodically analyze your containers and blobs to understand how they are stored, organized, and used in production. Then, use lifecycle management policies to move data to the most cost-efficient tiers. For example, data that has not been accessed for more than 30 days might be more cost efficient if placed into the cool tier. Consider archiving data that has not been accessed for over 180 days.
40+
41+
To gather telemetry, enable [blob inventory reports](blob-inventory.md) and enable [last access time tracking](lifecycle-management-policy-configure.md#optionally-enable-access-time-tracking). Analyze use patterns based on the last access time by using tools such as Azure Synapse or Azure Databricks. To learn about ways to analyze your data, see any of these articles:
42+
43+
- [Tutorial: Analyze blob inventory reports](storage-blob-inventory-report-analytics.md)
44+
45+
- [Calculate blob count and total size per container using Azure Storage inventory](calculate-blob-count-size.md)
46+
47+
- [How to calculate Container Level Statistics in Azure Blob Storage with Azure Databricks](https://techcommunity.microsoft.com/t5/azure-paas-blog/how-to-calculate-container-level-statistics-in-azure-blob/ba-p/3614650)
48+
49+
## Tier append and page blobs
50+
51+
Your analysis might reveal append or page blobs that are not actively used. For example, you might have log files (append blobs) that are no longer being read or written to, but you'd like to store them for compliance reasons. Similarly, you might want to back up disks or disk snapshots (page blobs). You can move these blobs into cooler tiers as well. However, you must first convert them to block blobs.
52+
53+
For information about how to convert append and page blobs to block blobs, see [Convert append blobs and page blobs to block blobs](convert-append-and-page-blobs-to-block-blobs.md).
54+
55+
## Pack small files before moving data to cooler tiers
56+
57+
Each read or write operation incurs a cost. To reduce the cost of reading and writing data, consider packing small files into larger ones by using file formats such as TAR or ZIP. Fewer files reduce the number of operations required to transfer data.
58+
59+
The following chart shows the relative impact of packing files for the cool tier. The read cost assumes a monthly read percentage of 30%.
60+
61+
> [!div class="mx-imgBorder"]
62+
> ![Chart that shows the impact on costs when you pack small files before uploading to the cool access tier.](./media/access-tiers-best-practices/packing-impact-cool.png)
63+
64+
The following chart shows the relative impact of packing files for the archive tier. The read cost assumes a monthly read percentage of 30%.
65+
66+
> [!div class="mx-imgBorder"]
67+
> ![Chart that shows the impact on costs when you pack small files before uploading to the archive access tier.](./media/access-tiers-best-practices/packing-impact-archive.png)
68+
69+
> [!TIP]
70+
> To facilitate search and read scenarios, consider creating an index that maps packed file paths with original file paths, and then storing these indexes as block blobs in the hot tier.
71+
72+
## Next steps
73+
74+
- [Set a blob's access tier](access-tiers-online-manage.md)
75+
- [Archive a blob](archive-blob.md)
76+
- [Optimize costs by automatically managing the data lifecycle](lifecycle-management-overview.md)
77+
- [Estimate the cost of archiving data](archive-cost-estimation.md)
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
title: Convert append and page blobs into block blobs (Azure Storage)
3+
titleSuffix: Azure Storage
4+
description: Learn how to convert an append blob or a page blob into a block blob in Azure Blob Storage.
5+
author: normesta
6+
7+
ms.service: storage
8+
ms.topic: how-to
9+
ms.date: 01/20/2023
10+
ms.author: normesta
11+
ms.reviewer: fryu
12+
ms.subservice: blobs
13+
ms.devlang: powershell, azurecli
14+
ms.custom: devx-track-azurepowershell, devx-track-azurecli
15+
---
16+
17+
# Convert append blobs and page blobs into block blobs
18+
19+
To convert blobs, copy them to a new location by using PowerShell, Azure CLI, or AzCopy. You'll use command parameters to ensure that the destination blob is a block blob. All metadata from the source blob is copied to the destination blob.
20+
21+
## Convert append and page blobs
22+
23+
### [PowerShell](#tab/azure-powershell)
24+
25+
1. Open a Windows PowerShell command window.
26+
27+
2. Sign in to your Azure subscription with the [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) command and follow the on-screen directions.
28+
29+
```powershell
30+
Connect-AzAccount
31+
```
32+
33+
3. If your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account which contains the append or page blobs.
34+
35+
```powershell
36+
$context = Get-AzSubscription -SubscriptionId '<subscription-id>'
37+
Set-AzContext $context
38+
```
39+
40+
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
41+
42+
4. Create the storage account context by using the [New-AzStorageContext](/powershell/module/az.storage/new-azstoragecontext) command. Include the `-UseConnectedAccount` parameter so that data operations will be performed using your Azure Active Directory (Azure AD) credentials.
43+
44+
```powershell
45+
$ctx = New-AzStorageContext -StorageAccountName '<storage account name>' -UseConnectedAccount
46+
```
47+
48+
5. Use the [Copy-AzStorageBlob](/powershell/module/az.storage/copy-azstorageblob) command and set the `-DestBlobType` parameter to `Block`.
49+
50+
```powershell
51+
$containerName = '<source container name>'
52+
$srcblobName = '<source append or page blob name>'
53+
$destcontainerName = '<destination container name>'
54+
$destblobName = '<destination block blob name>'
55+
$destTier = '<destination block blob tier>'
56+
57+
Copy-AzStorageBlob -SrcContainer $containerName -SrcBlob $srcblobName -Context $ctx -DestContainer $destcontainerName -DestBlob $destblobName -DestContext $ctx -DestBlobType Block -StandardBlobTier $destTier
58+
```
59+
60+
> [!TIP]
61+
> 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).
62+
63+
64+
### [Azure CLI](#tab/azure-cli)
65+
66+
1. First, open the [Azure Cloud Shell](../../cloud-shell/overview.md), or if you've [installed](/cli/azure/install-azure-cli) the Azure CLI locally, open a command console application such as Windows PowerShell.
67+
68+
> [!NOTE]
69+
> If you're using a locally installed version of the Azure CLI, ensure that you are using version 2.44.0 or later.
70+
71+
2. If your identity is associated with more than one subscription, then set your active subscription to subscription of storage account which contains the append or page blobs.
72+
73+
```azurecli-interactive
74+
az account set --subscription <subscription-id>
75+
```
76+
77+
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
78+
79+
3. 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`.
80+
81+
```azurecli
82+
containerName = '<source container name>'
83+
srcblobName = '<source append or page blob name>'
84+
destcontainerName = '<destination container name>'
85+
destblobName = '<destination block blob name>'
86+
destTier = '<destination block blob tier>'
87+
88+
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
89+
```
90+
91+
> [!TIP]
92+
> 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).
93+
94+
> [!WARNING]
95+
> 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.
96+
97+
98+
### [AzCopy](#tab/azcopy)
99+
100+
Use the [azcopy copy](../common/storage-ref-azcopy-copy.md) command. Specify the source and destination paths. Set the `blob-type` parameter to `BlockBlob`.
101+
102+
```azcopy
103+
azcopy copy 'https://<storage-account-name>.<blob or dfs>.core.windows.net/<container-name>/<append-or-page-blob-name>' 'https://<storage-account-name>.<blob or dfs>.core.windows.net/<container-name>/<name-of-new-block-blob>' --blob-type BlockBlob --block-blob-tier <destination-tier>
104+
```
105+
106+
> [!TIP]
107+
> The `--block-blob-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).
108+
109+
> [!WARNING]
110+
> 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.
111+
112+
---
113+
114+
## See also
115+
116+
- [Hot, Cool, and Archive access tiers for blob data](access-tiers-overview.md)
117+
- [Set a blob's access tier](access-tiers-online-manage.md)
118+
- [Best practices for using blob access tiers](access-tiers-best-practices.md)
102 KB
Loading
97.7 KB
Loading
128 KB
Loading

0 commit comments

Comments
 (0)