In this article, we will be implementing a solution to archive a select azure VM snapshot to a select storage account for archiving using azure cloud shell. For implementation, we will be using Azure CLI commands.
Prerequisite:
VM Snapshot
A storage account is needed
User needs “Storage Blob Contributor Data” IAM Role Access on Archiving Storage Account to perform the following operation.
VM Archive Implementation:
Follow the below steps to archive Azure VM to Azure Storage Account:
Step 1: Open Bash in Cloud Shell
Step 2: Use the following for Logging into the tenant.
azcopy login --tenant-id=<tenent_id>
This command returns the login url and login code. Use that code to log in.
Step 3: Now, click on the URL and Paste the Code to log in.
Once you logged in close the tab and navigate back to cloud shell and follow the next steps.
Step 4: Use this command to store the snapshot copy to the storage account container.
azcopy copy "<snapshot_export_url>" \
"https://<storageaccount_name>.blob.core.windows.net/<container_name>/<snapshot_name>.vhd" \
--blob-type BlockBlob
Fill up the details in the command. Add <snapshot export url>, Add <storage account name>, Add Storage Account <container name>, Add <snapshot name>.
Step 5: Once done, go to the storage account container and change tier to Archive. That’s it!
Getting the Snapshot Export URL:
Follow the below steps to get the Snapshot export URL:
Step 1: Go to Snapshots from Azure Portal.
Step 2: Select the Snapshot which you want to archive.
Step 3: Navigate to Settings >> Access Snapshot export >> Click on Generate URL to generate a secure URL.
Lost in the complex landscape of DevOps? It's time to find your way! Enroll in our
DevOps Engineering Planning to Production Live Course and set out on an exhilarating expedition to conquer DevOps methodologies with precision and timeliness.
What We Offer:
Comprehensive DevOps Curriculum
Expert Guidance for Streamlined Learning
Hands-on Experience with Real-world Scenarios
Proven Track Record with 100,000+ Successful DevOps Enthusiasts
Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated :
30 Mar, 2023
Like Article
Save Article
Share your thoughts in the comments
Add Your Comment
Please Login to comment...