How to Share Azure Resource Graph Queries as a Link
Published Jun 24 2020 03:32 AM 7,381 Views

Azure Resource Graph is a service in Azure that allows you to performant resource exploration with the ability to query at scale across a given set of subscriptions so that you can effectively govern your environment. You can get an overview of the resources in different subscriptions, and you can even generate charts. You can run these queries from Azure PowerShell or Azure CLI, or to get a view of these queries, you can use Azure Resource Graph Explorer in the Portal.


Azure Resource Graph Explorer ChartAzure Resource Graph Explorer Chart

As an example, I used Azure Resource Graph queries, to list the agent version of Azure Arc enabled servers.

To share these queries with others, you have a couple of options. You can share it directly within the Azure portal. 


Save Shared Azure Resource Graph QuerySave Shared Azure Resource Graph Query

Create an Azure Resource Graph Explorer Query Link


But thanks to David Coulter (Microsoft), I learned that you also can simple create URLs, including the Azure Resource Graph query. This is great if you simply create a link and will automatically copy the query to the Azure Resource Graph Explorer.


You can do this by using the following URL and append the URL encoded query to the URL.


Query URL:




Azure Resource Graph Query:



Resources| summarize count()




URL encoded Query:







To URL encode, you can use a website like Code Beautify or the following Visual Studio Code extension.


Complete Azure Resource Graph URL:




So if you click on the following link, it will automatically open the Azure Portal with the above Azure Resource Graph Query: 


Azure Resource Graph Explorer Query using a LinkAzure Resource Graph Explorer Query using a Link



Thanks again to David Coulter or the tip. I hope this gives you an overview of how you can share the Azure Resource Graph Query using a simple link. If you have any questions, feel free to leave a comment.

To learn more about how to create Azure Resource Graph Queries, check out Microsoft Docs: Starter Resource Graph query samples

Version history
Last update:
‎Jun 24 2020 05:34 AM
Updated by: