Voiced by Amazon Polly |
Overview
This guide provides a comprehensive walkthrough for converting the Azure Block Blob to Azure Page Blob in Azure and subsequently creating a managed disk from the Azure Page Blob. Understanding how to manipulate Azure Storage Blobs efficiently is essential for optimizing your storage and performance needs, especially in scenarios involving virtual machine disks and high-performance applications.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Introduction
In this guide, we will walk you through converting Azure Block Blob to Azure Page Blob in Azure and then creating a disk from the Azure Page Blob. Azure Storage Blobs are an essential part of Microsoft Azure’s storage offerings, and knowing how to manipulate them effectively can be crucial for optimizing your storage and performance needs.
Understanding the Basics
Before we dive into the step-by-step guide, it’s important to understand the difference between Block Blobs and Page Blobs:
- Azure Block Blobs: These are perfect for holding binary and text data, like media files and documents. They are optimized for sequential read and write operations.
- Azure Page Blobs: These are optimized for read and write for various tasks. They are ideal for scenarios like virtual machine disks requiring high performance and random access.
Step-by-Step Guide
Step 1: Generate SAS Token for Source Block Blob
A Shared Access Signature (SAS) token provides secure, delegated access to resources in your storage account. We will generate a SAS token for the source Block Blob.
Navigate to the Azure Portal
- Open the Azure portal.
- Locate the Storage Account:
- Go to “Storage accounts” and select the storage account that contains the Azure Block Blob.
Generate SAS Token
3. Navigate to the container that holds the block blob.
4. Select the block blob you wish to convert.
5. In the settings, select “Shared access signature”.
6. Set the necessary permissions (Read, Write, Create, Delete, List, Add) and expiry time.
7. Make a copy of the SAS token after choosing “Generate SAS”.
Step 2: Generate SAS Token for Destination Page Blob
We need to generate a SAS token for the destination Azure Page Blob. The steps are very similar to those for the source Azure Block Blob.
Navigate to the Azure Portal
- Open the Azure portal.
- Locate the Storage Account:
- Go to “Storage accounts” and select the storage account where you want to store the page blob.
Generate SAS Token
3. Navigate to the target container.
4. Click on “Shared access signature”.
5. Set the necessary permissions (Read, Write, Create, Delete, List, Add) and expiry time.
- Make a copy of the SAS token after choosing “Generate SAS”.
Step 3: Execute the AzCopy Command to Convert Block Blob to Page Blob
AzCopy is a command-line utility that copies data to and from Azure Storage. We will use AzCopy to convert the Azure Block Blob to Azure Page Blob.
Prepare the Command
Replace the placeholders with the actual values:
- <source-storage-account>: The source storage account name.
- <source-container>: The source container name.
- <source-blob>: The source blob name.
- <source-sas-token>: The source’s SAS token was created.
- <destination-storage-account>: The destination storage account name.
- <destination-container>: The destination container name.
- <destination-blob>: The destination blob name.
- <destination-sas-token>: For the destination, the SAS token.
1 |
azcopy copy "https://<source-storage-account>.blob.core.windows.net/<source-container>/<source-blob>?<source-sas-token>" "https://<destination-storage-account>.blob.core.windows.net/<destination-container>/<destination-blob>?<destination-sas-token>" --blob-type PageBlob |
Run the Command
Run the above command in the Azure Cloud Shell or your local terminal configured with Azure CLI.
1 |
azcopy copy "https://mystorageaccount.blob.core.windows.net/mycontainer/myblockblob?<source-sas-token>""https://mystorageaccount.blob.core.windows.net/mycontainer/mypageblob?<destination-sas-token>" --blob-type PageBlob |
Step 4: Verify the Conversion
After running the command, navigate to the destination container in the Azure portal and verify that the Azure Page Blob has been created.
Step 5: Create a Disk from the Azure Page Blob
Now that you have Azure Page Blob, you can create a disk. This is particularly useful for scenarios like virtual machine disks.
Navigate to Disks
- In the Azure interface, navigate to “Disks” and select “Create”.
Fill Disk Details
- Enter the following details:
- Subscription
- Resource Group
- Disk Name
- Region
Source Type
3. Select “Storage blob” and paste the SAS URL of the Azure Page Blob or browse the disk location in the container.
Finalize Creation
- Configure size and performance options.
- Click “Review + create”.
- Click “Create”.
Conclusion
This guide has walked you through the process step-by-step, from generating SAS tokens to verifying the conversion and creating a disk. With these skills, you’ll be better equipped to handle various storage scenarios in Azure, ensuring optimal performance and efficiency for your applications.
Drop a query if you have any questions regarding Azure Block Blobs and we will get back to you quickly.
Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.
- Reduced infrastructure costs
- Timely data-driven decisions
About CloudThat
CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner and many more.
To get started, go through our Consultancy page and Managed Services Package, CloudThat’s offerings.
FAQs
1. What is the main difference between Azure Block Blobs and Azure Page Blobs in Azure?
ANS: –
- Azure Block Blobs are optimized for storing text and binary data and are ideal for sequential read and write operations, making them suitable for documents and media files.
- Azure Page Blobs are used in applications that require high performance and random access, such as virtual machine disks.
2. Why must I generate a Shared Access Signature (SAS) token?
ANS: – Your storage account’s resources can be accessed securely and with delegation using a SAS token. It allows you to grant specific permissions (such as read, write, create, delete, list, and add) for a set duration without exposing your storage account keys.
WRITTEN BY Shaikh Mohammed Fariyaj Najam
Mohammed Fariyaj Shaikh works as a Research Associate at CloudThat. He has strong analytical thinking and problem-solving skills, knowledge of AWS Cloud Services, migration, infrastructure setup, and security, as well as the ability to adopt new technology and learn quickly.
Click to Comment