次のサンプル クエリは、Azure Resource Graph の PowerPlatformResources テーブルに対して実行されます。 リソースのカウントと配布、フィールド検出、リソース参照、コネクタの使用状況分析について説明します。 Power Platform インベントリの概要については、「 Power Platform インベントリ」を参照してください。 スキーマとフィールドのリファレンスについては、「 Power Platform インベントリ スキーマリファレンス」を参照してください。
これらのクエリを実行する方法
これらのクエリは、Azure Resource Graph インターフェイスから実行できます。 詳細な手順については、次のクイック スタート ガイドを参照してください。
- Azure portal を使用して Resource Graph クエリを実行する
- Azure CLI を使用して Resource Graph クエリを実行する
- Azure PowerShell を使用して Resource Graph クエリを実行する
- REST API を使用して Azure Resource Graph クエリを実行する
カウントと分布
すべてのリソースの合計数
PowerPlatformResources
| count
リソースの種類別の合計数
PowerPlatformResources
| summarize resourceCount = count() by type
| order by resourceCount
環境別のカウント
PowerPlatformResources
| extend properties = parse_json(properties)
| extend environmentId = tostring(properties.environmentId)
| summarize resourceCount = count() by environmentId
| order by resourceCount desc
リージョン別のカウント
PowerPlatformResources
| summarize resourceCount = count() by location
| order by resourceCount desc
アイテム数別の上位の所有者
PowerPlatformResources
| extend properties = parse_json(properties)
| extend ownerId = tostring(properties.ownerId)
| summarize resourceCount = count() by ownerId
| order by resourceCount desc
リソース参照
テナント内の 1 つのエージェントを検索する
PowerPlatformResources
| where type == "microsoft.copilotstudio/agents"
| where name == "[Enter the agent's ID]"
Tip
エージェントの ID は、エージェントを表示するときに Copilot Studio の URL またはインベントリ テーブルの [名前] 列で確認できます。
過去 24 時間以内に作成されたアイテム
PowerPlatformResources
| extend properties = parse_json(properties)
| extend createdAt = todatetime(properties.createdAt)
| where createdAt >= ago(24h)
コネクタ クエリ (プレビュー)
次のクエリでは、コネクタ インベントリ (プレビュー) の対象となるリソースの種類全体でコネクタの使用状況を分析します。 各クエリは、キャンバス アプリ、モデル駆動型アプリ、クラウド フロー、エージェント フロー、ワークフロー エージェント フロー、Copilot Studio エージェントによって出力される properties.powerPlatformConnectors 配列で動作します。
Power Platform リソース全体で使用される上位のコネクタ
最も異なるリソースで使用されるコネクタを一覧表示します。 テナント全体でどのコネクタが導入を支配するかを理解するのに役立ちます。
PowerPlatformResources
| where type in (
"microsoft.powerapps/canvasapps",
"microsoft.powerapps/modeldrivenapps",
"microsoft.powerautomate/cloudflows",
"microsoft.powerautomate/agentflows",
"microsoft.powerautomate/m365agentflows",
"microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| mv-expand connector = properties.powerPlatformConnectors
| extend connectorId = tostring(connector.connectorId)
| where isnotempty(connectorId)
| summarize ResourceCount = dcount(name) by connectorId
| order by ResourceCount desc
| take 10
リソースあたりのコネクタ数の分布
0、1、2、または複数のコネクタを使用するリソースの数を示します。 複雑さの外れ値を見つける場合に便利です。
PowerPlatformResources
| where type in (
"microsoft.powerapps/canvasapps",
"microsoft.powerapps/modeldrivenapps",
"microsoft.powerautomate/cloudflows",
"microsoft.powerautomate/agentflows",
"microsoft.powerautomate/m365agentflows",
"microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| extend connectorCount = array_length(properties.powerPlatformConnectors)
| summarize ResourceCount = count() by toint(connectorCount)
| order by connectorCount asc
特定のコネクタを使用するすべてのリソースを検索する
shared_sharepointonlineを検索するコネクタに置き換えます。 このクエリは、コネクタに既知の問題がある場合、非推奨になった場合、または新しいライセンスが必要な場合に、影響分析に役立ちます。
PowerPlatformResources
| where type in (
"microsoft.powerapps/canvasapps",
"microsoft.powerapps/modeldrivenapps",
"microsoft.powerautomate/cloudflows",
"microsoft.powerautomate/agentflows",
"microsoft.powerautomate/m365agentflows",
"microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| mv-expand connector = properties.powerPlatformConnectors
| where tostring(connector.connectorId) == "shared_sharepointonline"
| project resourceName = tostring(properties.displayName),
resourceId = name,
resourceType = type,
environmentId = tostring(properties.environmentId),
operationsUsed = connector.operations
環境別のコネクタの使用状況
すべての環境で使用されるすべてのコネクタと、それを使用する個別のリソースの数を一覧表示します。 この一覧は、導入パターンを理解し、DLP ポリシーの決定を通知するのに役立ちます。
PowerPlatformResources
| where type in (
"microsoft.powerapps/canvasapps",
"microsoft.powerapps/modeldrivenapps",
"microsoft.powerautomate/cloudflows",
"microsoft.powerautomate/agentflows",
"microsoft.powerautomate/m365agentflows",
"microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| mv-expand connector = properties.powerPlatformConnectors
| extend connectorId = tostring(connector.connectorId)
| where isnotempty(connectorId)
| extend environmentId = tostring(properties.environmentId)
| summarize ResourceCount = dcount(name) by environmentId, connectorId
| order by environmentId asc, ResourceCount desc