Member-only story
Export an Azure osDisk Snapshot to a Storage Account
Azure | CLI | AzureRM | Storage Account Explorer | ARM Template
I decided to write an update to date article on how to transfer the osDisk snapshot to a storage account. Most articles I saw online were outdated on the Azure CLI. So let's begin.
There are some prerequisites for this article.
- That you have an Azure Portal Account with the Azure CLI Installed.
- That you already have an osDisk snapshot that can be exported.
Step 1. Get the Account Key for the “Destination” Storage Account
az storage account keys list --resource-group <resource-group-nm> --account-name <destination-storage-account-name> --query '[0].value'
The query command will output the first key that can be used to validate the copy to the storage account.
Step 2. Setup a Shared Access Storage (SAS) URI
This step is the same process as running an export from the portal. This will generate a SAS URI that can be used to export the Snapshot into a VHD.
az snapshot grant-access --resource-group <azure-resource-group-nm> --name <name-of-pre-existing-snapshot> --duration-in-seconds 3600 --query…