I've a Virtual Machine with managed disks and a snapshot of that OS Disk, in the "westus" location, in a resource group. Now, I'm trying to create another OS disk from the snapshot, but this time, I'm providing the location as "westus2" for the target resource. The following command returns with "The entity was not found" error on azure CLI 2.0.

user@ubuntu:az disk create -g myresgrp -n newsnapdisk -l westus2 --source /subscriptions/xxxxxxxxxxx/resourceGroups/myresgrp/providers/Microsoft.Compute/snapshots/mysnapshot
The entity was not found.

The command works fine if the location is changed to "westus" instead of "westus2". I cannot find enough documentation about what this error means, but I've verified that resources and resourcegroups involved in the command actually exist.

What is causing this issue and how do I Overcome this problem?


Creating a disk from a Snapshot in different location does not support on Azure.

You should copy the snapshot to westus2 storage account, then you could create a snapshot in westus2 from the storage account. You could use the following scripts to do this.

##generate SAS URI for a managed snapsho
sas=$(az snapshot grant-access --resource-group $resourceGroupName --name $snapshotName --duration-in-seconds $sasExpiryDuration --query [accessSas] -o tsv)

##create storage account in westus2 and get the storage account key
##copy the snapshot to a storage account using SAS URI.
az storage blob copy start --destination-blob $destinationVHDFileName --destination-container $storageContainerName --account-name $storageAccountName --account-key $storageAccountKey --source-uri $sas

##wait for a moment after the copy finished
az snapshot create -g MyResourceGroup -n MySnapshot --source https://vhd1234.blob.core.windows.net/vhds/osdisk1234.vhd

Just an example below, it works for me.

sas=$(az snapshot grant-access --resource-group shui2 --name shui --duration-in-seconds $sasExpiryDuration --query [accessSas] -o tsv)
az storage blob copy start --destination-blob shuitest.vhd --destination-container vhds --account-name shui123 --account-key ****** --source-uri $sas
az snapshot create -g shui3 -n shui2 --source https://shui123.blob.core.windows.net/vhds/shuitest.vhd
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.