Share via

Is there a way to check all the dependencies of a resource? Resource visualizer shows the dependencies within the same resource group but does not account for instances where a dependency is outside a resource group

Osoko, Emmanuel Ayodeji 0 Reputation points
2023-09-18T19:52:22.11+00:00

I have been trying unsuccessfully to create a script that can identify all the dependencies of a resource in a subscription. I'm not sure there's an api that can fetch those dependencies and even if I tried using Resource visualizer, it would only show me the dependent resources within the same resource group but there are situations where there are other dependent resources in other resource group and I can't see that. So essentially, I'm trying to avoid having to manually identify these dependencies or wait till Azure resource mover runs validations and tells me no. Is there a way to do this beforehand?

Not Monitored
{count} votes

1 answer

Sort by: Most helpful
  1. tbgangav-MSFT 10,431 Reputation points Moderator
    2023-09-20T16:48:06.7733333+00:00

    Hi @Osoko, Emmanuel Ayodeji ,

    As mentioned here, Resource Mover could be used to easily identify dependencies across resources you want to move. Did you try Invoke-AzResourceMoverPrepare Az PowerShell cmdlet or Initiate Move Az REST API along with ValidateOnly parameter? For more information with regards to it, take a look at this document and see if it helps.

    Other than Resource Mover, you may depend on Resources table in Azure Resource Graph to get the dependencies of a resource but the kusto query wouldn't be straight forward for all the resource types because the dependencies are typically shown under Properties field of Resources table but all the resource types wouldn't have same JSON structure under the Properties field. So, you might have to come up with various kusto queries for different resource types if you go with Azure Resource Graph approach.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.