I have resources in a Resource Group in Azure and it wont let me move the resource because it is in a Resource Group that is not the hosting Resource Group even though it has been moved .
I have tried to run the command in Powershell az resource list but cant seem to see the hosting Resource Group of the resource.
Is there a command I can run in Powershell that will give the current Resource Group of the resource and the hosting Resource Group of the resource?
2
Answers
Based on the shared information, I have understood that you want to know the
We don’t have any direct cmdlets to pull this information.
You can make use of activity logs to see the resource move operation and pull the information of resources which were moved & respective target resource group names accordingly using the below cmdlet
Sample screenshot for your reference:
Note: Using
Get-AzActivityLog
cmdlet you can pull logs for only last 90days.Yes its the Get-AzureRmResource command:
Fortunately there’s an alternative to avoid specifying the "ResourceGroupName" which you’re trying to find and that’s specifying the ResourceType..
Also note the
-ExpandProperties
parameter in the documentation to include the resource properties.