Skip to content

Commit 035727b

Browse files
committed
edits arg portal quickstart
1 parent 68da6d8 commit 035727b

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed
Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
---
2-
title: 'Quickstart: Run first Azure Resource Graph query in portal'
3-
description: In this quickstart, you run your first Azure Resource Graph Explorer query using Azure portal.
4-
ms.date: 03/29/2024
2+
title: 'Quickstart: Run Resource Graph query using Azure portal'
3+
description: In this quickstart, you run an Azure Resource Graph query in Azure portal using Azure Resource Graph Explorer.
4+
ms.date: 04/23/2024
55
ms.topic: quickstart
66
---
77

8-
# Quickstart: Run your first Resource Graph query using Azure Resource Graph Explorer
8+
# Quickstart: Run Resource Graph query using Azure portal
99

10-
The power of Azure Resource Graph is available directly in the Azure portal through Azure Resource Graph Explorer. Resource Graph Explorer allows you to query information about the Azure Resource Manager resource types and properties. Resource Graph Explorer also provides an interface for working with multiple queries, evaluating the results, and even converting the results of some queries into a chart that can be pinned to an Azure dashboard.
10+
This quickstart describes how to run an Azure Resource Graph query in the Azure portal using Azure Resource Graph Explorer. Resource Graph Explorer allows you to query information about the Azure Resource Manager resource types and properties. Resource Graph Explorer also provides an interface for working with multiple queries, evaluating the results, and even converting the results of some queries into a chart that can be pinned to an Azure dashboard.
1111

1212
## Prerequisites
1313

1414
If you don't have an Azure account, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
1515

16-
## Run your first Resource Graph query
16+
## Run a query
1717

18-
Run your first query from the Azure portal using Azure Resource Graph Explorer.
18+
Run a query from the Azure portal using Azure Resource Graph Explorer.
1919

2020
1. Sign in to the [Azure portal](https://portal.azure.com).
2121
1. Search for _resource graph_ and select **Resource Graph Explorer**.
2222

23-
:::image type="content" source="./media/first-query-portal/search-resource-graph.png" alt-text="Screenshot of the Azure portal to search for resource graph.":::
23+
:::image type="content" source="./media/first-query-portal/search-resource-graph.png" alt-text="Screenshot of the Azure portal to search for resource graph." lightbox="./media/first-query-portal/search-resource-graph.png":::
24+
25+
1. If you need to change the scope, select **Directory**. Then select the directory, management group, or subscription for the resources you want to query.
26+
27+
:::image type="content" source="./media/first-query-portal/query-scope.png" alt-text="Screenshot of the Azure Resource Graph Explorer to change the scope for directory, management group, or subscription." lightbox="./media/first-query-portal/query-scope.png":::
2428

2529
1. In the **Query 1** portion of the window, copy and paste the following query. Then select **Run query**.
2630

@@ -30,13 +34,13 @@ Run your first query from the Azure portal using Azure Resource Graph Explorer.
3034
| limit 5
3135
```
3236

33-
:::image type="content" source="./media/first-query-portal/run-query.png" alt-text="Screenshot of Azure Resource Graph Explorer that highlights run query, results, and messages.":::
37+
:::image type="content" source="./media/first-query-portal/run-query.png" alt-text="Screenshot of Azure Resource Graph Explorer that highlights run query, results, and messages." lightbox="./media/first-query-portal/run-query.png":::
3438

35-
This query example doesn't provide a sort modifier like `order by`. If you run this query multiple times, it's likely to yield a different set of resources per request.
39+
This query example doesn't provide a sort modifier like `order by`. If you run the query multiple times, it might yield a different set of resources for each request.
3640

3741
1. Review the query response in the **Results** tab and select the **Messages** tab to see details about the query, including the count of results and duration of the query. Errors, if any, are displayed in **Messages**.
3842

39-
1. Update the query to `order by` the **name** property. Then, select **Run query**
43+
1. Update the query to `order by` the `name` property. Then, select **Run query**
4044

4145
```kusto
4246
resources
@@ -45,9 +49,9 @@ Run your first query from the Azure portal using Azure Resource Graph Explorer.
4549
| order by name asc
4650
```
4751

48-
Like the first query, running this query multiple times is likely to yield a different set of resources per request. The order of the query commands is important. In this example, the `order by` comes after the `limit`. This command order first limits the query results and then orders them.
52+
Like the previous query, running this query multiple times might yield a different set of resources for each request. The order of the query commands is important. In this example, the `order by` comes after the `limit`. The query limits the results to five resources and then orders those results by name.
4953

50-
1. Update the query to `order by` the **name** property and then `limit` to the top five results. Then, select **Run query**.
54+
1. Update the query to `order by` the `name` property and then `limit` to the top five results. Then, select **Run query**.
5155

5256
```kusto
5357
resources
@@ -56,7 +60,7 @@ Run your first query from the Azure portal using Azure Resource Graph Explorer.
5660
| limit 5
5761
```
5862

59-
When the final query is run several times, and with no changes in your environment, the results are consistent and ordered by the **name** property, but still limited to the top five results.
63+
If this query is run several times with no changes to your environment, the results are consistent and ordered by the `name` property, but still limited to five results. The query orders the results by name and then limits the output to five resources.
6064

6165
### Schema browser
6266

@@ -72,19 +76,21 @@ authorizationresources
7276
| where properties['roleName'] == "INSERT_VALUE_HERE"
7377
```
7478

75-
:::image type="content" source="./media/first-query-portal/schema-browser.png" alt-text="Screenshot of Azure Resource Graph Explorer schema browser that highlights resource type and properties.":::
79+
:::image type="content" source="./media/first-query-portal/schema-browser.png" alt-text="Screenshot of Azure Resource Graph Explorer schema browser that highlights resource type and properties." lightbox="./media/first-query-portal/schema-browser.png":::
7680

7781
## Download query results as a CSV file
7882

7983
To download comma-separated values (CSV) results from the Azure portal, browse to the Azure Resource Graph Explorer and run a query. On the toolbar, select **Download as CSV** as shown in the following screenshot:
8084

81-
:::image type="content" source="./media/first-query-portal/download-csv.png" alt-text="Screenshot of Azure Resource Graph Explorer with Download as CSV highlighted.":::
85+
:::image type="content" source="./media/first-query-portal/download-csv.png" alt-text="Screenshot of Azure Resource Graph Explorer with Download as CSV highlighted." lightbox="./media/first-query-portal/download-csv.png":::
8286

8387
When you use the **Download as CSV** export functionality of Azure Resource Graph Explorer, the result set is limited to 55,000 records. This limitation is a platform limit that can't be overridden by filing an Azure support ticket.
8488

85-
## Create a chart from the Resource Graph query
89+
## Create a chart from query results
90+
91+
You can create charts from queries that output a count for the number of resources. Queries that output lists can't be made into a chart. If you try to create a chart from a list, a message like _the result set isn't compatible with a donut chart visualization_ is displayed in the **Charts** tab.
8692

87-
After running the previous query, if you select the **Charts** tab, you get a message that "the result set isn't compatible with a pie chart visualization." Queries that list results can't be made into a chart, but queries that provide counts of resources can.
93+
To create a chart from query results, do the following steps:
8894

8995
1. In the **Query 1** portion of the window, enter the following query and select **Run query**.
9096

@@ -98,18 +104,19 @@ After running the previous query, if you select the **Charts** tab, you get a me
98104

99105
1. Select the **Charts** tab. Change the type from _Select chart type..._ to either _Bar chart_ or _Donut chart_.
100106

101-
:::image type="content" source="./media/first-query-portal/query-chart.png" alt-text="Screenshot of Azure Resource Graph Explorer with charts drop-down menu highlighted.":::
107+
:::image type="content" source="./media/first-query-portal/query-chart.png" alt-text="Screenshot of Azure Resource Graph Explorer with charts drop-down menu highlighted." lightbox="./media/first-query-portal/query-chart.png":::
102108

103-
## Pin the query visualization to a dashboard
109+
## Pin query visualization to dashboard
104110

105111
When you have results from a query that can be visualized, that data visualization can be pinned to your Azure portal dashboard. After running the previous query, follow these steps:
106112

107-
1. Select **Save** and provide the name _VM by OS type_. Then select **Save** at the bottom of the right pane.
113+
1. Select **Save** and use the name _Virtual machine by OS type_ and type as _Private queries_. Then select **Save** at the bottom of the right pane.
108114
1. Select **Run query** to rerun the query you saved.
109115
1. On the **Charts** tab, select a data visualization. Then select **Pin to dashboard**.
110116
1. From **Pin to Dashboard** select the existing dashboard where you want the chart to appear.
117+
1. Select **Dashboard** from the _hamburger menu_ (three horizontal lines) on the top, left side of any portal page.
111118

112-
The query is now available on your dashboard with the title **VM by OS type**. If the query wasn't saved before it was pinned, the name is _Query 1_ instead.
119+
The query is now available on your dashboard with the title **Virtual machine by OS type**. If the query wasn't saved before it was pinned, the name is _Query 1_ instead.
113120

114121
The query and resulting data visualization run and update each time the dashboard loads, providing real time and dynamic insights to your Azure environment directly in your workflow.
115122

@@ -122,12 +129,20 @@ For more information about working with dashboards, see [Create a dashboard in t
122129
If you want to remove the sample Resource Graph dashboards from your Azure portal environment, do the following steps:
123130

124131
1. Select **Dashboard** from the _hamburger menu_ (three horizontal lines) on the top, left side of any portal page.
125-
1. On your dashboard, find the **VM by OS type** chart and select the ellipsis (`...`) to display the menu.
132+
1. On your dashboard, find the **Virtual machine by OS type** chart and select the ellipsis (`...`) to display the menu.
126133
1. Select **Remove from dashboard** select **Save** to confirm.
127134

135+
If you want to delete saved queries, like _Virtual machine by OS type_, do the following steps:
136+
137+
1. Go to Azure Resource Graph Explorer.
138+
1. Select **Open a query**.
139+
1. Select **Type** _Private queries_.
140+
1. From **Query name** select the rubbish bin icon to **Delete this query**.
141+
1. Select **Yes** to confirm the deletion.
142+
128143
## Next steps
129144

130-
In this quickstart, you used Azure Resource Graph Explorer to run your first query and looked at dashboard examples powered by Resource Graph. To learn more about the Resource Graph language, continue to the query language details page.
145+
In this quickstart, you used Azure Resource Graph Explorer to run a query and reviewed how to use charts and dashboards. To learn more, go to the query language details article.
131146

132147
> [!div class="nextstepaction"]
133148
> [Understanding the Azure Resource Graph query language](./concepts/query-language.md)
27.5 KB
Loading
-14.1 KB
Loading

0 commit comments

Comments
 (0)