Skip to content

Commit 3cfec88

Browse files
Remove Try-It button from CLI code samples
1 parent 7f88b30 commit 3cfec88

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

articles/governance/resource-graph/concepts/work-with-data.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ of the data set instead.
6565
The following examples show how to skip the first _10_ records a query would result in, instead
6666
starting the returned result set with the 11th record:
6767

68-
```azurecli-interactive
68+
```azurecli
6969
az graph query -q "Resources | project name | order by name asc" --skip 10 --output table
7070
```
7171

@@ -87,7 +87,7 @@ consumer if there are more records not returned in the response. This condition
8787
identified when the **count** property is less than the **totalRecords** property. **totalRecords**
8888
defines how many records that match the query.
8989

90-
**resultTruncated** is **true** when there are less resources available than a query is requesting or when paging is disabled or when paging is not possible because:
90+
**resultTruncated** is **true** when there are less resources available than a query is requesting or when paging is disabled or when paging is not possible because:
9191

9292
- The query contains a `limit` or `sample`/`take` operator.
9393
- **All** output columns are either `dynamic` or `null` type.
@@ -97,7 +97,7 @@ When **resultTruncated** is **true**, the **$skipToken** property isn't set.
9797
The following examples show how to **skip** the first 3,000 records and return the **first** 1,000
9898
records after those records skipped with Azure CLI and Azure PowerShell:
9999

100-
```azurecli-interactive
100+
```azurecli
101101
az graph query -q "Resources | project id, name | order by id asc" --first 1000 --skip 3000
102102
```
103103

@@ -108,7 +108,7 @@ Search-AzGraph -Query "Resources | project id, name | order by id asc" -First 10
108108
> [!IMPORTANT]
109109
> The response won't include the **$skipToken** if:
110110
> - The query contains a `limit` or `sample`/`take` operator.
111-
> - **All** output columns are either `dynamic` or `null` type.
111+
> - **All** output columns are either `dynamic` or `null` type.
112112
113113
For an example, see
114114
[Next page query](/rest/api/azureresourcegraph/resourcegraph(2021-03-01)/resources/resources#next-page-query)

articles/governance/resource-graph/samples/advanced.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Resources
5555

5656
# [Azure CLI](#tab/azure-cli)
5757

58-
```azurecli-interactive
58+
```azurecli
5959
az graph query -q "Resources | distinct type, apiVersion | where isnotnull(apiVersion) | order by type asc"
6060
```
6161

@@ -92,7 +92,7 @@ Resources
9292

9393
# [Azure CLI](#tab/azure-cli)
9494

95-
```azurecli-interactive
95+
```azurecli
9696
az graph query -q "Resources | where type=~ 'microsoft.compute/virtualmachinescalesets' | where name contains 'contoso' | project subscriptionId, name, location, resourceGroup, Capacity = toint(sku.capacity), Tier = sku.name | order by Capacity desc"
9797
```
9898

@@ -127,7 +127,7 @@ Resources
127127

128128
# [Azure CLI](#tab/azure-cli)
129129

130-
```azurecli-interactive
130+
```azurecli
131131
az graph query -q "Resources | summarize resourceCount=count() by subscriptionId | join (ResourceContainers | where type=='microsoft.resources/subscriptions' | project SubName=name, subscriptionId) on subscriptionId| project-away subscriptionId, subscriptionId1"
132132
```
133133

@@ -160,7 +160,7 @@ Resources
160160

161161
# [Azure CLI](#tab/azure-cli)
162162

163-
```azurecli-interactive
163+
```azurecli
164164
az graph query -q "Resources | project tags | summarize buildschema(tags)"
165165
```
166166

@@ -206,7 +206,7 @@ Resources
206206

207207
# [Azure CLI](#tab/azure-cli)
208208

209-
```azurecli-interactive
209+
```azurecli
210210
az graph query -q "Resources | where type =~ 'microsoft.compute/virtualmachines' and name matches regex @'^Contoso(.*)[0-9]+\$' | project name | order by name asc"
211211
```
212212

@@ -244,7 +244,7 @@ Resources
244244

245245
# [Azure CLI](#tab/azure-cli)
246246

247-
```azurecli-interactive
247+
```azurecli
248248
az graph query -q "Resources | where type =~ 'microsoft.documentdb/databaseaccounts' | project id, name, writeLocations = (properties.writeLocations) | mv-expand writeLocations | project id, name, writeLocation = tostring(writeLocations.locationName) | where writeLocation in ('East US', 'West US') | summarize by id, name"
249249
```
250250

@@ -282,7 +282,7 @@ Resources
282282

283283
# [Azure CLI](#tab/azure-cli)
284284

285-
```azurecli-interactive
285+
```azurecli
286286
az graph query -q "Resources | join kind=leftouter (ResourceContainers | where type=='microsoft.resources/subscriptions' | project SubName=name, subscriptionId) on subscriptionId | where type == 'microsoft.keyvault/vaults' | project type, name, SubName"
287287
```
288288

@@ -321,7 +321,7 @@ on elasticPoolId
321321

322322
# [Azure CLI](#tab/azure-cli)
323323

324-
```azurecli-interactive
324+
```azurecli
325325
az graph query -q "Resources | where type =~ 'microsoft.sql/servers/databases' | project databaseId = id, databaseName = name, elasticPoolId = tolower(tostring(properties.elasticPoolId)) | join kind=leftouter ( Resources | where type =~ 'microsoft.sql/servers/elasticpools' | project elasticPoolId = tolower(id), elasticPoolName = name, elasticPoolState = properties.state) on elasticPoolId | project-away elasticPoolId1"
326326
```
327327

@@ -374,7 +374,7 @@ on publicIpId
374374

375375
# [Azure CLI](#tab/azure-cli)
376376

377-
```azurecli-interactive
377+
```azurecli
378378
az graph query -q "Resources | where type =~ 'microsoft.compute/virtualmachines' | extend nics=array_length(properties.networkProfile.networkInterfaces) | mv-expand nic=properties.networkProfile.networkInterfaces | where nics == 1 or nic.properties.primary =~ 'true' or isempty(nic) | project vmId = id, vmName = name, vmSize=tostring(properties.hardwareProfile.vmSize), nicId = tostring(nic.id) | join kind=leftouter ( Resources | where type =~ 'microsoft.network/networkinterfaces' | extend ipConfigsCount=array_length(properties.ipConfigurations) | mv-expand ipconfig=properties.ipConfigurations | where ipConfigsCount == 1 or ipconfig.properties.primary =~ 'true' | project nicId = id, publicIpId = tostring(ipconfig.properties.publicIPAddress.id)) on nicId | project-away nicId1 | summarize by vmId, vmName, vmSize, nicId, publicIpId | join kind=leftouter ( Resources | where type =~ 'microsoft.network/publicipaddresses' | project publicIpId = id, publicIpAddress = properties.ipAddress) on publicIpId | project-away publicIpId1"
379379
```
380380

@@ -428,7 +428,7 @@ Resources
428428

429429
# [Azure CLI](#tab/azure-cli)
430430

431-
```azurecli-interactive
431+
```azurecli
432432
az graph query -q "Resources | where type == 'microsoft.compute/virtualmachines' | extend JoinID = toupper(id), OSName = tostring(properties.osProfile.computerName), OSType = tostring(properties.storageProfile.osDisk.osType), VMSize = tostring(properties.hardwareProfile.vmSize) | join kind=leftouter( Resources | where type == 'microsoft.compute/virtualmachines/extensions' | extend VMId = toupper(substring(id, 0, indexof(id, '/extensions'))), ExtensionName = name ) on \$left.JoinID == \$right.VMId | summarize Extensions = make_list(ExtensionName) by id, OSName, OSType, VMSize | order by tolower(OSName) asc"
433433
```
434434

@@ -467,7 +467,7 @@ on subscriptionId, resourceGroup
467467

468468
# [Azure CLI](#tab/azure-cli)
469469

470-
```azurecli-interactive
470+
```azurecli
471471
az graph query -q "Resources | where type =~ 'microsoft.storage/storageaccounts' | join kind=inner ( ResourceContainers | where type =~ 'microsoft.resources/subscriptions/resourcegroups' | where tags['Key1'] =~ 'Value1' | project subscriptionId, resourceGroup) on subscriptionId, resourceGroup | project-away subscriptionId1, resourceGroup1"
472472
```
473473

@@ -507,7 +507,7 @@ on subscriptionId, resourceGroup
507507

508508
# [Azure CLI](#tab/azure-cli)
509509

510-
```azurecli-interactive
510+
```azurecli
511511
az graph query -q "Resources | where type =~ 'microsoft.storage/storageaccounts' | join kind=inner ( ResourceContainers | where type =~ 'microsoft.resources/subscriptions/resourcegroups' | mv-expand bagexpansion=array tags | where isnotempty(tags) | where tags[0] =~ 'key1' and tags[1] =~ 'value1' | project subscriptionId, resourceGroup) on subscriptionId, resourceGroup | project-away subscriptionId1, resourceGroup1"
512512
```
513513

@@ -540,7 +540,7 @@ ResourceContainers
540540

541541
# [Azure CLI](#tab/azure-cli)
542542

543-
```azurecli-interactive
543+
```azurecli
544544
az graph query -q "ResourceContainers | where type=='microsoft.resources/subscriptions/resourcegroups' | project name, type | limit 5 | union (Resources | project name, type | limit 5)"
545545
```
546546

@@ -572,13 +572,13 @@ Resources
572572
| project id, ipConfigurations = properties.ipConfigurations
573573
| mvexpand ipConfigurations
574574
| project id, subnetId = tostring(ipConfigurations.properties.subnet.id)
575-
| parse kind=regex subnetId with '/virtualNetworks/' virtualNetwork '/subnets/' subnet
575+
| parse kind=regex subnetId with '/virtualNetworks/' virtualNetwork '/subnets/' subnet
576576
| project id, virtualNetwork, subnet
577577
```
578578

579579
# [Azure CLI](#tab/azure-cli)
580580

581-
```azurecli-interactive
581+
```azurecli
582582
az graph query -q "Resources | where type =~ 'microsoft.network/networkinterfaces' | project id, ipConfigurations = properties.ipConfigurations | mvexpand ipConfigurations | project id, subnetId = tostring(ipConfigurations.properties.subnet.id) | parse kind=regex subnetId with '/virtualNetworks/' virtualNetwork '/subnets/' subnet | project id, virtualNetwork, subnet"
583583
```
584584

@@ -612,7 +612,7 @@ Resources
612612

613613
# [Azure CLI](#tab/azure-cli)
614614

615-
```azurecli-interactive
615+
```azurecli
616616
az graph query -q "Resources | where type == 'microsoft.compute/virtualmachines' | summarize count() by tostring(properties.extended.instanceView.powerState.code)"
617617
```
618618

articles/governance/resource-graph/samples/starter.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Resources
5252

5353
# [Azure CLI](#tab/azure-cli)
5454

55-
```azurecli-interactive
55+
```azurecli
5656
az graph query -q "Resources | summarize count()"
5757
```
5858

@@ -85,7 +85,7 @@ Resources
8585

8686
# [Azure CLI](#tab/azure-cli)
8787

88-
```azurecli-interactive
88+
```azurecli
8989
az graph query -q "Resources | where type =~ 'microsoft.keyvault/vaults' | count"
9090
```
9191

@@ -119,7 +119,7 @@ Resources
119119

120120
# [Azure CLI](#tab/azure-cli)
121121

122-
```azurecli-interactive
122+
```azurecli
123123
az graph query -q "Resources | project name, type, location | order by name asc"
124124
```
125125

@@ -154,7 +154,7 @@ Resources
154154

155155
# [Azure CLI](#tab/azure-cli)
156156

157-
```azurecli-interactive
157+
```azurecli
158158
az graph query -q "Resources | project name, location, type| where type =~ 'Microsoft.Compute/virtualMachines' | order by name desc"
159159
```
160160

@@ -189,7 +189,7 @@ Resources
189189

190190
# [Azure CLI](#tab/azure-cli)
191191

192-
```azurecli-interactive
192+
```azurecli
193193
az graph query -q "Resources | where type =~ 'Microsoft.Compute/virtualMachines' | project name, properties.storageProfile.osDisk.osType | top 5 by name desc"
194194
```
195195

@@ -226,7 +226,7 @@ Resources
226226

227227
# [Azure CLI](#tab/azure-cli)
228228

229-
```azurecli-interactive
229+
```azurecli
230230
az graph query -q "Resources | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by tostring(properties.storageProfile.osDisk.osType)"
231231
```
232232

@@ -259,7 +259,7 @@ Resources
259259

260260
# [Azure CLI](#tab/azure-cli)
261261

262-
```azurecli-interactive
262+
```azurecli
263263
az graph query -q "Resources | where type =~ 'Microsoft.Compute/virtualMachines' | extend os = properties.storageProfile.osDisk.osType | summarize count() by tostring(os)"
264264
```
265265

@@ -297,7 +297,7 @@ Resources
297297

298298
# [Azure CLI](#tab/azure-cli)
299299

300-
```azurecli-interactive
300+
```azurecli
301301
az graph query -q "Resources | where type contains 'storage' | distinct type"
302302
```
303303

@@ -333,7 +333,7 @@ Resources
333333

334334
# [Azure CLI](#tab/azure-cli)
335335

336-
```azurecli-interactive
336+
```azurecli
337337
az graph query -q "Resources | where type contains 'publicIPAddresses' and isnotempty(properties.ipAddress) | project properties.ipAddress | limit 100"
338338
```
339339

@@ -365,7 +365,7 @@ Resources
365365

366366
# [Azure CLI](#tab/azure-cli)
367367

368-
```azurecli-interactive
368+
```azurecli
369369
az graph query -q "Resources | where type contains 'publicIPAddresses' and isnotempty(properties.ipAddress) | summarize count () by subscriptionId"
370370
```
371371

@@ -399,7 +399,7 @@ Resources
399399

400400
# [Azure CLI](#tab/azure-cli)
401401

402-
```azurecli-interactive
402+
```azurecli
403403
az graph query -q "Resources | where tags.environment=~'internal' | project name"
404404
```
405405

@@ -430,7 +430,7 @@ Resources
430430

431431
# [Azure CLI](#tab/azure-cli)
432432

433-
```azurecli-interactive
433+
```azurecli
434434
az graph query -q "Resources | where tags.environment=~'internal' | project name, tags"
435435
```
436436

@@ -464,7 +464,7 @@ Resources
464464

465465
# [Azure CLI](#tab/azure-cli)
466466

467-
```azurecli-interactive
467+
```azurecli
468468
az graph query -q "Resources | where type =~ 'Microsoft.Storage/storageAccounts' | where tags['tag with a space']=='Custom value'"
469469
```
470470

@@ -517,7 +517,7 @@ ResourceContainers
517517

518518
# [Azure CLI](#tab/azure-cli)
519519

520-
```azurecli-interactive
520+
```azurecli
521521
az graph query -q "ResourceContainers | where isnotempty(tags) | project tags | mvexpand tags | extend tagKey = tostring(bag_keys(tags)[0]) | extend tagValue = tostring(tags[tagKey]) | union (resources | where notempty(tags) | project tags | mvexpand tags | extend tagKey = tostring(bag_keys(tags)[0]) | extend tagValue = tostring(tags[tagKey]) ) | distinct tagKey, tagValue | where tagKey !startswith "hidden-""
522522
```
523523

@@ -551,7 +551,7 @@ Resources
551551

552552
# [Azure CLI](#tab/azure-cli)
553553

554-
```azurecli-interactive
554+
```azurecli
555555
az graph query -q "Resources | where type =~ 'microsoft.network/networksecuritygroups' and isnull(properties.networkInterfaces) and isnull(properties.subnets) | project name, resourceGroup | sort by name asc"
556556
```
557557

0 commit comments

Comments
 (0)