Jagjit Singh
Jagjit Singh

Reputation: 751

Getting error when copying custom image from one region to another in Azure

I am working on copying a Custom Image from norteurope region to eastus in Azure, so I can create Virtual Machines in eastus region based on the copied Custom Image. I am using following Azure CLI command:

az image copy `
--source-object-name "playground-windows-vm-image-1" `
--source-resource-group 'playground-demo-rg' `
--target-location 'eastus' `
--target-resource-group 'layground-demo-rg2' `
--cleanup

The Azure CLI copy command is throwing an error and giving me following error message:

enter image description here

I am using Azure CLI and mainly did following steps:

  1. I created a new Resource Group with name playground-demo-rg2 in eastus
  2. Installed Image Copy Extension in order to copy from northeurope to eastus
  3. Copying an existing Custom Image(playground-windows-vm-image-1) from Source Resource Group(playground-demo-rg) to Target Resource Group(playground-demo-rg2)

I have uploaded the full PS script which threw the above error upon execution:

https://github.com/jagjitsingh700/AzureVirtualMachines/blob/master/CopyingCustomImageToRegion.ps1

Upvotes: 1

Views: 537

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28224

It's a known issue and I also face this error. A new open issue is Github here.

As a workaround, you could use Shared Image Gallery in Azure. Using a Shared Image Gallery you can share your images to different users, service principals, or AD groups within your organization. Shared images can be replicated to multiple regions, for quicker scaling of your deployments.

Or copy Managed Images with Powershell. Additionally, you could refer to this blog to Copy an Azure VM From Region A to Region B.

Upvotes: 1

Related Questions