Search-AzGraph
Azure Resource Manager tarafından yönetilen kaynakları sorgular.
Syntax
Search-AzGraph
[-Query] <String>
[-Subscription <String[]>]
[-First <Int32>]
[-Skip <Int32>]
[-SkipToken <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Search-AzGraph
[-Query] <String>
-ManagementGroup <String[]>
[-AllowPartialScope]
[-First <Int32>]
[-Skip <Int32>]
[-SkipToken <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Search-AzGraph
[-Query] <String>
[-UseTenantScope]
[-AllowPartialScope]
[-First <Int32>]
[-Skip <Int32>]
[-SkipToken <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Sorgu söz dizimi hakkında daha fazla bilgiyi burada bulabilirsiniz: https://aka.ms/resource-graph/learntoquery
Örnekler
Örnek 1
Search-AzGraph "project id, name, type, location, tags" -First 3
id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.Compute/virtualMachineScaleSets/nt
name : nt
type : microsoft.compute/virtualmachinescalesets
location : eastus
tags : @{resourceType=Service Fabric; clusterName=gov-art-int-nt-a}
ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.Compute/virtualMachineScaleSets/nt
id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1
name : egtopic-1
type : microsoft.eventgrid/topics
location : westus2
tags :
ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1
Kaynak alanlarının bir alt kümesini isteyen basit kaynaklar sorgusu.
Örnek 2
Search-AzGraph "project id, name, type, location | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by location | top 3 by count_"
location count_
-------- ------
eastus 66
westcentralus 32
westus 26
Alan seçimi, filtreleme ve özetleme içeren kaynaklarda karmaşık bir sorgu.
Örnek 3
$response = Search-AzGraph -Query "project id, name, type, location" -First 2
Search-AzGraph -Query "project id, name, type, location" -SkipToken $response.SkipToken
id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkInterfaces/17ni
name : 17ni
type : microsoft.network/networkinterfaces
location : westeurope
ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkInterfaces/17ni
id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkSecurityGroups/17nsg
name : 17nsg
type : microsoft.network/networksecuritygroups
location : westeurope
ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkSecurityGroups/17nsg
Önceki sorgu sonuçlarından geçirilen atlama belirtecini içeren bir sorgu. Atlama belirtecini geri almak için sonuçlarda kimlik tutmanın zorunlu olduğunu lütfen unutmayın.
Örnek 4
Search-AzGraph -Query "project id, name, type, location, tags" -First 2 -ManagementGroup MyManagementGroupId -AllowPartialScope
id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.Compute/virtualMachineScaleSets/nt
name : nt
type : microsoft.compute/virtualmachinescalesets
location : eastus
tags : @{resourceType=Service Fabric; clusterName=gov-art-int-nt-a}
ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.Compute/virtualMachineScaleSets/nt
id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1
name : egtopic-1
type : microsoft.eventgrid/topics
location : westus2
tags :
ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1
MyManagementGroupId'nin altında N'den fazla abonelik varsa, sorgunun kısmi kapsam sonucuyla başarılı olmasını sağlayan yönetim grubu kapsamına alınmış bir sorgu. N, sunucu tarafından işlenebilen en fazla abonelik sayısıdır.
Parametreler
-AllowPartialScope
Altta yalnızca kısmi sayıda abonelik sunucu tarafından işlenebiliyorsa sorgunun başarılı olup olmadığını gösterir
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Azure ile iletişim için kullanılan kimlik bilgileri, hesap, kiracı ve abonelik.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-First
Döndürülecek en fazla nesne sayısı. İzin verilen değerler: 1-1000. Varsayılan değer 100'dür.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ManagementGroup
Sorgu çalıştırılacak yönetim grupları.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Query
sorguyu Kaynak Grafı.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Skip
İlk N nesnelerini yoksayar ve kalan nesneleri alır.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SkipToken
Varsa bir sonraki sonuç sayfasını almak için kullanılacak atlama belirteci.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Subscription
Sorgu çalıştırılacak abonelikler.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseTenantScope
Sorguyu geçerli kiracıdaki tüm kullanılabilir aboneliklerde çalıştırın.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Girişler
None
Çıkışlar
Azure PowerShell
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin