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/concepts/arg-get-list-api.md
+28-18Lines changed: 28 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,8 +162,8 @@ HTTP GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGro
162
162
163
163
## Known Limitations
164
164
165
-
1.**VMSS VM Health status** isn't supported by default. If you have a requirement, do let us know by emailing the Azure Resource Graph team.
166
-
2.**Supported Resources** - The ARG GET/LIST API supports resources part of ‘resources’ and ‘computeresources’ table. If you have a requirement for a specific resource type outside of these tables, do let us know by emailing team.
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
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
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
169
5.**Client Deserialization Concerns**
@@ -183,41 +183,51 @@ The following example is a .NET Code sample to call ARG GET/LIST API by creating
183
183
First, We create custom ArmClientOption with policy that adds the `useResourceGraph=True` flag per call:
Then, we create ArmClient using the custom ArmClientOptions:
195
191
196
192
```bicep
197
-
ArmClient client = new ArmClient(new DefaultAzureCredential(), null,
198
-
199
-
ArmClientOptions);
193
+
ArmClient resourceGraphClient = new ArmClient(new DefaultAzureCredential(), null, armClientOptions);
200
194
```
201
195
202
196
What if we want to create an ARMClient using a default subscription? We would set the ArmClient client value to:
203
197
204
198
```bicep
205
-
new ArmClient(new DefaultAzureCredential(), defaultSubId,
206
-
ArmClientOptions);
199
+
ArmClient resourceGraphClient = new ArmClient(new DefaultAzureCredential(), defaultSubId, armClientOptions);
200
+
```
201
+
202
+
Optionally, to create a default client that does not add the `useResourceGraph` flag, the client code chooses which client to use based on the specific scenario and needs. To do so, use the following:
203
+
204
+
```bicep
205
+
ArmClient defaultClient = new ArmClient(new DefaultAzureCredential(), null, new ArmClientOptions());
207
206
```
208
207
209
208
Then use this policy to add query parameters for every request through the client:
210
209
211
210
internal class ARG GET/LISTHttpPipelinePolicy : HttpPipelineSynchronousPolicy
212
211
213
212
```bicep
213
+
internal class ArgGetListHttpPipelinePolicy : HttpPipelineSynchronousPolicy
214
+
214
215
{
215
-
public override void OnSendingRequest(HttpMessage message)
216
-
{
217
-
// Adds the required query param to explicitly query ARG GET/LIST
0 commit comments