Skip to content

Commit d7437f9

Browse files
committed
implementing first round of feedback
1 parent 30b5f50 commit d7437f9

File tree

2 files changed

+70
-32
lines changed

2 files changed

+70
-32
lines changed

articles/governance/resource-graph/concepts/arg-get-list-api.md

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ms.custom: devx-track-csharp
88

99
# Azure Resource Graph (ARG) GET/LIST API
1010

11-
The ARG GET/LIST API significantly reduces READ throttling by serving all incoming GET and LIST calls against ARG platform with smart routing controls in control plane. The API aligns with the existing request and response contracts of Azure control plane APIs while addressing throttling issues for customers.
11+
The ARG GET/LIST API significantly reduces READ throttling by serving all incoming GET and LIST calls against the ARG platform with smart routing controls in the control plane. The API aligns with the existing request and response contracts of Azure control plane APIs while addressing throttling issues for customers.
1212

13-
ARG GET/LIST provides a default quota of 4k /min /user /subscription on a moving window. This range isn't a hard limit; we can support more than this based on scenario requirement. The API provides a response header “x-ms-user-quota-remaining" indicating remaining quota and "x-ms-user-quota-resets-after" indicating the time for a full quota reset based on which you can understand your quota consumption.
13+
ARG GET/LIST provides a default quota of 4k per minute, user, and subscription, on a moving window. The API provides a response header “x-ms-user-quota-remaining" indicating remaining quota and "x-ms-user-quota-resets-after" indicating the time for a full quota reset based on which you can understand your quota consumption.
1414

1515
> [!NOTE]
16-
> Keep in mind that the Azure Resource Manager (ARM) quota applies to these calls. Read about the [Azure Resource Manager limits](../../../azure-resource-manager/management/request-limits-and-throttling.md#azure-resource-graph-throttling), which are the new limits that ARM follows for Azure Public cloud. 
16+
> Keep in mind that the Azure Resource Manager quota applies to these calls. Read about the [Azure Resource Manager limits](../../../azure-resource-manager/management/request-limits-and-throttling.md#azure-resource-graph-throttling), which are the new limits that ARM follows for Azure Public cloud. 
1717
1818
## Using the ARG GET/LIST API
1919

20-
To use the ARG GET/LIST API identify whether or not your scenario matches the conditions mentioned [here](./guidance-for-throttled-requests.md#arg-getlist-api), you can append the flag `&useResourceGraph=true` to your control plane API calls, and the request is routed to the ARG GET/LIST API backend.
20+
To use the ARG GET/LIST API, first identify whether or not your scenario matches the conditions mentioned in the guidance for throttled requests. You can then append the flag `&useResourceGraph=true` to your applicable GET/LIST API calls, and the request will be routed to the ARG backend for response.
2121

2222
Contact the ARG product group by sending an email to Azure Resource Graph team sharing a brief overview of your scenario and the ARG team will reach out to you with next steps. Callers must also design appropriate retry logic and implement fallback mechanisms to ensure smooth and reliable experience. This opt-in model was deliberately chosen to allow the Azure Resource Graph team to better understand customer usage patterns and make improvements as needed.
2323

@@ -31,35 +31,47 @@ This request is used for looking up a single resource by providing resource D.
3131

3232
**Traditional Point Get Request:**
3333

34+
```api
3435
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/{providerNamespace}/{resourceType}/{resourceName}?api-version={apiVersion}
36+
```
3537

3638
**ARG Point Get Request:**
3739

40+
```api
3841
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/{providerNamespace}/{resourceType}/{resourceName}?api-version={apiVersion}&**useResourceGraph=true**
42+
```
3943

4044
## Subscription Collection Get
4145

4246
This request is used for listing all resources under a single resource type in a subscription.
4347

4448
**Traditional Subscription Collection Get Request:**
4549

50+
```api
4651
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/{providerNamespace}/{resourceType}?api-version={apiVersion}
52+
```
4753

4854
**ARG Subscription Collection Get Request:**
4955

56+
```api
5057
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/{providerNamespace}/{resourceType}?api-version={apiVersion}&**useResourceGraph=true**
58+
```
5159

5260
## Resource Group Collection Get
5361

5462
This request is used for listing all resources under a single resource type in a resource group.
5563

5664
**Traditional Point Get Request:**
5765

66+
```api
5867
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/{providerNamespace}/{resourceType}?api-version={apiVersion}
68+
```
5969

6070
**ARG GET/LIST Point Get Request:**
6171

72+
```api
6273
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/{providerNamespace}/{resourceType}?api-version={apiVersion}&**useResourceGraph=true**
74+
```
6375

6476
## Some frequently used examples
6577

@@ -69,53 +81,68 @@ For this specific example, use the following requests to get a virtual machine w
6981

7082
#### ARG GET/LIST Request
7183

84+
```api
7285
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachines/{vm}?api-version=2024-07-01&$expand=instanceView&useResourceGraph=true
86+
```
7387

7488
#### ARG Query
7589

90+
```sql
7691
Resources
7792

7893
| where type =~ 'microsoft.compute/virtualmachines'
7994
| where id = ~ '/subscriptions/{subscriptionId}<br>/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachines/{vm}'
95+
```
8096

8197
#### CRP Request
8298

99+
```api
83100
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachines/{vm}?api-version=2024-07-01&$expand=instanceView
84-
101+
```
85102

86103
### List VMs under ResourceGroup
87104

88105
For this specific example, use the following requests to retrieve the list of virtual machines under the resource group.
89106

90107
#### ARG GET/LIST Request
91108

109+
```api
92110
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachines?api-version=2024-07-01&$expand=instanceView&useResourceGraph=true
111+
```
93112

94113
#### ARG Query
95114

115+
```sxl
96116
Resources
97117
98118
| where resourceGroup =~ ‘{resourceGroup}’
99119
100120
| where type =~ 'microsoft.compute/virtualmachines'
121+
```
101122

102123
### CRP Request
103124

125+
```api
104126
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachines?api-version=2024-07-01
127+
```
105128

106129
### List VMSS VM (Uniform) with InstanceView
107130

108131
#### ARG GET/LIST Request
109132

133+
```api
110134
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachinescalesets/{vmss}/virtualmachines?api-version=2024-07-01&$expand=instanceView&useResourceGraph=true
135+
```
111136

112137
#### ARG Query
113138

139+
```sql
114140
ComputeResources
115141

116142
| where type =~ 'microsoft.compute/virtualmachinescalesets/virtualmachines'
117143

118144
| where id startswith ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachinescalesets/{vmss}’
145+
```
119146

120147
### CRP Request
121148

@@ -127,60 +154,71 @@ For this specific example, use the following requests to retrieve the list of VM
127154

128155
### ARG GET/LIST Request
129156

130-
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachinescalesets/{vmss}/virtualmachines?api-version=2024-07-01&$filter=’virtualMachineScaleSet/id’ eq ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachinescalesets/{vmss}’&$expand=instanceView&useResourceGraph=true
157+
```api
158+
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachines?api-version=2024-07-01&$filter='virtualMachineScaleSet/id' eq '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachinescalesets/{vmss}'&$expand=instanceView&useResourceGraph=true
159+
```
131160

132161
### ARG Query
133162

163+
```sql
134164
Resources
135165

136166
| where type =~ ‘microsoft.compute/virtualmachines’
137167

138168
| where properties.virtualMachineScaleSet.id =~‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachinescalesets/{vmss}’
169+
```
139170

140171
### CRP Request
141172

173+
```api
142174
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachines?api-version=2024-07-01&$expand=instanceView&$filter=’virtualMachineScaleSet/id’ eq ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.compute/virtualmachinescalesets/{vmss}’
175+
```
143176

144177
### List storage accounts in subscription
145178

146179
For this specific example, use the following requests to retrieve the list of storage accounts in the subscription.
147180

148181
#### ARG GET/LIST request
149182

183+
```api
150184
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.storage/storageAccounts?api-version=2024-01-01&useResourceGraph=true
185+
```
151186

152187
#### ARG Query
153188

189+
```sql
154190
Resources
155191

156192
| where type =~ ‘microsoft.storage/storageAccounts’
193+
```
157194

158195
#### SRP request
159196

197+
```api
160198
HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/microsoft.storage/storageAccounts?api-version=2024-01-01
161-
199+
```
162200

163201
## Known Limitations
164202

165-
1. **VMSS VM Health status** isn't supported by default. If you have a requirement, do let us know by emailing the ARG team.
166-
2. **Supported Resources** - The ARG GET/LIST API supports all resource types as part of the resources and computeresources table. If you have a requirement for a specific resource type outside of these tables, do let us know by emailing the ARG team.
167-
3. **Single API Version Support** - ARG GET/LIST today only supports a single API version for each resource type, which is generally the latest non-preview version of the type that exists in the Azure REST API spec. The `api-version` parameter in the request URL is ignored by the ARG GET/LIST today. ARG GET/LIST returns `apiVersion` field in resource payloads in responses; this is the version that ARG GET/LIST indexed the resource in. Callers can apply this field to understand the apiVersion to use, if its relevant for their scenario.
168-
4. **Client Support** - Azure REST API: Supported | Azure SDK: Supported [sample .NET code](#sample-sdk-code)| PowerShell: Currently not supported | Azure CLI: Currently not supported | Azure portal: Currently not supported
169-
5. **Client Deserialization Concerns**
203+
1. **VMSS VM health status** is not currently supported. If you require this data, you can share your scenario and propose the feature addition on our [feedback forums](https://feedback.azure.com/d365community/forum/675ae472-f324-ec11-b6e6-000d3a4f0da0).
204+
2. **Supported resources** - The ARG GET/LIST API supports all resource types as part of the `resources` and `computeresources` table. If you require a resource type which is not part of these tables, you can share your scenario and propose the feature addition on our [feedback forums](https://feedback.azure.com/d365community/forum/675ae472-f324-ec11-b6e6-000d3a4f0da0).
205+
3. **Single API version support** - ARG GET/LIST today only supports a single API version for each resource type, which is generally the latest non-preview version of the type that exists in the Azure REST API spec. The ARG GET/LIST functionality returns the `apiVersion` field in the resource payload of the response which indicates the version of the resource type that was used when retrieving the resource details. Callers can apply this field to understand the API version to use, if its relevant for their scenario.
206+
4. **Client support** - Azure REST API: Supported | Azure SDK: Supported [sample .NET code](#sample-sdk-code)| PowerShell: Currently not supported | Azure CLI: Currently not supported | Azure portal: Currently not supported
207+
5. **Client deserialization concerns**
170208
- If a client uses REST API to issue GET calls, there should generally be no concerns regarding deserialization due to API version differences.
171209
- If a client uses Azure SDK to issue GET calls, due to relaxed deserialization setting across all languages, the deserialization issue shouldn't be a concern, unless there are contract breaking changes among different versions for the target resource type.
172-
6. **Unprocessable Resource Request**
173-
- There are rare scenarios where ARG GET/LIST isn't able to index a resource correctly, other than the existence of the resource. To not sacrifice data quality, ARG GET/LIST refuses serving GET calls for these resources and return an error code of HTTP 422.
174-
- Clients of ARG GET/LIST should treat HTTP 422 as a permanent error. Clients should retry by falling back to the resource provider (by removing useResourceGraph=true flag). Since the error is applicable specifically to ARG GET/LIST, fallback to resource providers should result in an E2E success.
175-
7. **Consistency**
176-
- As an index of Azure resources, ARG GET/LIST ingests the latest updates within seconds. ARG GET/LIST therefore provides a strict bounded staleness consistency level for all resources. This differs from the strong consistency model of Resource Providers.
210+
6. **Unprocessable resource request**
211+
- There are rare scenarios where ARG GET/LIST isn't able to index a resource correctly, other than the existence of the resource. To not sacrifice data quality, ARG GET/LIST refuses serving GET calls for these resources and returns an error code of HTTP 422.
212+
- Clients of ARG GET/LIST should treat HTTP 422 as a permanent error. Clients should retry by falling back to the resource provider (by removing `useResourceGraph=true` flag). Since the error is applicable specifically to ARG GET/LIST, fallback to resource providers should result in an E2E success.
213+
7. **Supported consistency level**
214+
- When using ARG GET or LIST, the data you receive reflects recent changes with a slight delay—typically just a few seconds—rather than real-time updates. This is known as 'bounded staleness' and ensures fast, scalable queries while still providing a consistent and up-to-date view of your Azure resources. Unlike direct calls to Resource Providers, which guarantee real-time accuracy (strong consistency), ARG is optimized for performance with predictable, near-real-time data.
177215
- In resource Point Get responses, ARG GET/LIST provides a response header x-ms-arg-snapshot-timestamp that indicates the timestamp when the returned resource snapshot was indexed. The value of the header is UTC time in ISO8601 format. (An example, "x-ms-arg-snapshot-timestamp" : "2023-01-20T18:55:59.5610084Z").
178216

179217
### Sample SDK code
180218

181219
The following example is a .NET Code sample to call ARG GET/LIST API by creating an ARMClient with policy that adds the flag `useResourceGraph=true` to each call:
182220

183-
First, We create custom ArmClientOption with policy that adds the `useResourceGraph=True` flag per call:
221+
First, we create custom ArmClientOption with policy that adds the `useResourceGraph=True` flag per call:
184222

185223
```bicep
186224
var armClientOptions = new ArmClientOptions();
@@ -244,22 +282,22 @@ There are a few ways that you can identify when a request the ARG GET/LIST: 
244282

245283
2. How do you know which API version was used by ARG GET/LIST?
246284

247-
This value is returned in apiVersion field in resource response today. 
285+
This value is returned in `apiVersion` field in resource response today. 
248286

249287
3. What happens if a caller calls ARG GET/LIST API with `useResourceGraph=true` flag for a resource not supported by ARG GET/LIST?  
250288

251-
Any unsupported/unroutable requests result in `useResourceGraph=true` ignored and the call is automatically routed to the resource provider. The user doesn't have to take any action.  
289+
Any unsupported/unroutable requests result in `useResourceGraph=true` ignored, and the call is automatically routed to the resource provider. The user doesn't have to take any action.  
252290

253291
4. What permissions are required for querying ARG GET/LIST APIs?
254292

255-
No special permissions are required for ARG GET/LIST APIs; ARG GET/LIST APIs are equivalent to native Resource provider based GET APIs and therefore, standard RBAC applies. Callers need to have at least READ permissions to resources/scopes they're trying to access. 
293+
No special permissions are required for ARG GET/LIST APIs; ARG GET/LIST APIs are equivalent to native resource provider based GET APIs and therefore, standard RBAC applies. Callers need to have at least READ permissions to resources/scopes they're trying to access. 
256294

257295
5. What is the rollback strategy, if we find issues while using ARG GET/LIST APIs?  
258296

259-
If onboarded through the flag `useResourceGraph=true`, the caller may choose to remove the flag (or) set the value to `useResourceGraph=false`, and the call is automatically routed to be Resource Provider. 
297+
If onboarded through the flag `useResourceGraph=true`, the caller may choose to remove the flag (or) set the value to `useResourceGraph=false`, and the call is automatically routed to the Resource Provider. 
260298

261299
6. What if you're getting a 404 Not Found when trying to get a resource from ARG GET/LIST that was recently created?
262300

263301
This is a common scenario with many services where customers create resources and immediately issue a GET in 1-2 seconds part of another WRITE workflow. For example, customers create a new resource and right after trying to create a metric alert that monitors it. The resource might not have been indexed by ARG GET/LIST yet. There are two ways to work around this situation:
264302
- Retry on ARG GET/LIST a few times until it returns status code 200. 
265-
- Retry without ARG GET/LIST flag to fall back on the resource provider. True 404 seconds doesn't hit the RP since ARM returns the error directly, whereas a false 404 should be served by the resource providers to get actual data.
303+
- Retry without ARG GET/LIST flag to fall back on the resource provider. True status code 404 doesn't hit the resource provider since ARM returns the error directly, whereas a false 404 should be served by the resource providers to get actual data.

0 commit comments

Comments
 (0)