You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/governance/resource-graph/shared-query-template.md
+28-45Lines changed: 28 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,50 +1,37 @@
1
1
---
2
-
title: 'Quickstart: Create a shared query with templates'
2
+
title: 'Quickstart: Create a shared query with ARM template'
3
3
description: In this quickstart, you use an Azure Resource Manager template (ARM template) to create a Resource Graph shared query that counts virtual machines by OS.
# Quickstart: Create a shared query by using an ARM template
9
10
10
-
Resource Graph queries can be saved as a _private query_ or a _shared query_. A private query is
11
-
saved to the individuals portal profile and isn't visible to others. A shared query is a Resource
12
-
Manager object that can be shared with others through permissions and role-based access. A shared
13
-
query provides common and consistent execution of resource discovery. This quickstart uses an Azure
14
-
Resource Manager template (ARM template) to create a shared query.
11
+
Resource Graph queries can be saved as a _private query_ or a _shared query_. A private query is saved to the individuals portal profile and isn't visible to others. A shared query is a Resource Manager object that can be shared with others through permissions and role-based access. A shared query provides common and consistent execution of resource discovery. This quickstart uses an Azure Resource Manager template (ARM template) to create a shared query.
If your environment meets the prerequisites and you're familiar with using ARM templates, select the
19
-
**Deploy to Azure** button. The template will open in the Azure portal.
15
+
If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template opens in the Azure portal.
20
16
21
17
:::image type="content" source="~/reusable-content/ce-skilling/azure/media/template-deployments/deploy-to-azure-button.svg" alt-text="Button to deploy the Resource Manager template to Azure." border="false" link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fdemos%2Fresourcegraph-sharedquery-countos%2Fazuredeploy.json":::
22
18
23
19
## Prerequisites
24
20
25
-
If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account
26
-
before you begin.
21
+
If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account before you begin.
27
22
28
23
## Review the template
29
24
30
-
In this quickstart, you create a shared query called _Count VMs by OS_. To try this query in SDK or
31
-
in portal with Resource Graph Explorer, see
32
-
[Samples - Count virtual machines by OS type](./samples/starter.md#count-virtual-machines-by-os-type).
25
+
In this quickstart, you create a shared query called _Count VMs by OS_. To try this query in SDK or in portal with Resource Graph Explorer, go to [Samples - Count virtual machines by OS type](./samples/starter.md#count-virtual-machines-by-os-type).
33
26
34
-
The template used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/resourcegraph-sharedquery-countos/).
27
+
The template used in this quickstart is from [Azure Quickstart Templates](/samples/azure/azure-quickstart-templates/resourcegraph-sharedquery-countos/).
The resource defined in the template is [Microsoft.ResourceGraph/queries](/azure/templates/microsoft.resourcegraph/queries).
41
32
42
33
## Deploy the template
43
34
44
-
> [!NOTE]
45
-
> Azure Resource Graph service is free. For more information, see
46
-
> [Overview of Azure Resource Graph](./overview.md).
47
-
48
35
1. Select the following image to sign in to the Azure portal and open the template:
49
36
50
37
:::image type="content" source="~/reusable-content/ce-skilling/azure/media/template-deployments/deploy-to-azure-button.svg" alt-text="Button to deploy the Resource Manager template to Azure." border="false" link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fdemos%2Fresourcegraph-sharedquery-countos%2Fazuredeploy.json":::
@@ -54,19 +41,19 @@ The resource defined in the template is:
54
41
| Name | Value |
55
42
|------|-------|
56
43
| Subscription | Select your Azure subscription. |
57
-
| Resource group | Select **Create new**, specify a name, and then select **OK**. |
58
-
| Location | Select a region. For example, **Central US**. |
59
-
| Query name | Leave the default value: **Count VMs by OS**. |
60
-
| Query code | Leave the default value: `Resources | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by tostring(properties.storageProfile.osDisk.osType)` |
61
-
| Query description | Leave the default value: **This shared query counts all virtual machine resources and summarizes by the OS type.**|
62
-
| I agree to the terms and conditions stated above | (Select) |
44
+
| Resource group | Select **Create new**, specify a name, and then select **OK**. Or select an existing resource group. |
45
+
| Location | Select a region. For example, **West US**. |
46
+
| Query name | Use the default value: **Count VMs by OS**. |
47
+
| Query code | Use the default value: `Resources | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by tostring(properties.storageProfile.osDisk.osType)` |
48
+
| Query description | Use the default value: **This shared query counts all virtual machine resources and summarizes by the OS type.**|
0 commit comments