Search code examples
azureazure-resource-managerazure-cdn

Can't move Azure CDN Endpoint from one resource group to another


I'm trying to move CDN endpoint resources from one subscription to another subscription but I'm getting the following error. I have the CDN profile and endpoint in same RG.

Identifier '/subscriptions/xxx/resourceGroups/internal/providers/Microsoft.Cdn/profiles/internal-cdn/endpoints/internal-cdn-endpoint' is not a top level resource.

Can you please provide some suggestions to move the resource?


Solution

  • Like the error say the CDNEndpoint it's below a CDN Profile, you can't move an CND EndPoint directly, you have to move the entire CDN Profile to the Target Resource Group.

    I make a quickly test and I was able to move the CDN profile with any problem, both with the move button of the portal and with the following powershell commands:

    $SourceAID = (Get-AzureRmResource –ResourceGroupName "ResouceGroupFROM" -ResourceName "CDNPROFILE-NAME").ResourceID  
    Move-AzureRmResource -DestinationResourceGroupName "ResouceGroupTARGET" -ResourceId $SourceAID 
    

    enter image description here