Move a marketplace VM between subscriptions fails with offer ID was not found

James Sidwell Admin 1 Reputation point
2023-01-09T16:31:06.757+00:00

Using the sample script here https://learn.microsoft.com/en-us/azure/virtual-machines/azure-cli-change-subscription-marketplace to move a VM which has a plan associated with it. All of the steps work until it gets to the az vm create step.
The move fails with offer id was not found. I have confirmed that the offer is still available and correctly spelled (including uppercase/lowercase) with "az vm image list offers and az vm image list skus". Any idea why this might be failing? I'd like to get this to work as we want to use this method to provide a straight-forward way for some of our users to migrate their VMs over to new subscriptions.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,130 questions
Azure Resource Mover
Azure Resource Mover
An Azure service used for moving multiple resources between Azure regions.
200 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JimmySalian-2011 41,916 Reputation points
    2023-01-09T16:41:07.307+00:00

    Hi James,

    Can you provide the deployment or logs associated with this? So the note says "If the virtual machine plan is no longer available in the Marketplace, you can't use this procedure" are you sure that the offer is valid and available?.

    Try this command to check

    offer = Your offer in Marketplace  
    offer=$(az vm get-instance-view --resource-group $sourceResourceGroup \  
        --name $vmName --query 'storageProfile.imageReference.offer' --output tsv)  
    

    Hope this helps.
    JS

    ==
    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    0 comments No comments