Kueri sampel inventaris Power Platform

Contoh kueri berikut berjalan terhadap tabel PowerPlatformResources dalam tabel Azure Resource Graph. Cakupannya meliputi penghitungan dan distribusi sumber daya, penemuan bidang, pencarian sumber daya, dan analisis penggunaan konektor. Untuk gambaran umum inventarit Power Platform, lihat Inventarit Power Platform. Untuk referensi skema dan bidang, lihat Referensi skema inventori Power Platform.

Cara menjalankan kueri ini

Anda dapat menjalankan salah satu kueri ini dari antarmuka Azure Resource Graph. Untuk instruksi langkah demi langkah, lihat panduan mulai cepat berikut ini:

Jumlah dan distribusi

Jumlah total semua sumber daya

PowerPlatformResources
| count

Jumlah total menurut jenis sumber daya

PowerPlatformResources
| summarize resourceCount = count() by type
| order by resourceCount

Jumlah berdasarkan lingkungan

PowerPlatformResources
| extend properties = parse_json(properties)
| extend environmentId = tostring(properties.environmentId)
| summarize resourceCount = count() by environmentId
| order by resourceCount desc

Hitungan menurut wilayah

PowerPlatformResources
| summarize resourceCount = count() by location
| order by resourceCount desc

Pemilik teratas menurut jumlah item

PowerPlatformResources
| extend properties = parse_json(properties)
| extend ownerId = tostring(properties.ownerId)
| summarize resourceCount = count() by ownerId
| order by resourceCount desc

Pencarian sumber daya

Menemukan agen tunggal di penyewa

PowerPlatformResources
| where type == "microsoft.copilotstudio/agents"
| where name == "[Enter the agent's ID]"

Tip

Anda dapat menemukan ID agen di URL Copilot Studio saat melihat agen, atau di kolom Nama tabel inventori.

Jumlah agen berdasarkan harness

Menampilkan rincian agen yang dibuat dengan harness GitHub Copilot, harness Copilot Chat, atau harness Standar.

Anda dapat melihat harness milik agen di kolom Harness di pusat admin Power Platform, di bagian Kelola>Copilot Studio. Kolom tersebut hanyalah kolom antarmuka pengguna. Harness belum dikembalikan sebagai metadata agen, sehingga kueri ini memperolehnya dari bidang yang dikembalikan inventaris: properties.isCLIAgent, properties.model, dan properties.createdIn. Ketika bidang properties.harness tersedia, Anda dapat melakukan kueri langsung padanya sebagai gantinya. Untuk definisi bidang, lihat skema inventaris Agen Microsoft Copilot Studio.

PowerPlatformResources
| where type == "microsoft.copilotstudio/agents"
| extend properties = parse_json(properties)
| extend
    isCLIAgent = tobool(properties.isCLIAgent),
    model = tostring(properties.model),
    createdIn = tostring(properties.createdIn)
| extend harness = case(
    isCLIAgent == true, "GitHub Copilot",
    model =~ "Microsoft 365 Copilot" or createdIn =~ "Microsoft 365 Copilot Agent Builder", "Copilot Chat",
    "Standard")
| summarize agentCount = count() by harness
| order by agentCount desc

Daftarkan agen beserta harness-nya

Mengembalikan satu baris untuk setiap agen beserta harness-nya agar Anda dapat menemukan dan mengambil tindakan terhadap masing-masing agen, alih-alih hanya menghitungnya. Hapus komentar pada baris where untuk hanya mengembalikan agen yang dibangun dengan harness GitHub Copilot.

PowerPlatformResources
| where type == "microsoft.copilotstudio/agents"
| extend properties = parse_json(properties)
| extend
    isCLIAgent = tobool(properties.isCLIAgent),
    model = tostring(properties.model),
    createdIn = tostring(properties.createdIn)
| extend harness = case(
    isCLIAgent == true, "GitHub Copilot",
    model =~ "Microsoft 365 Copilot" or createdIn =~ "Microsoft 365 Copilot Agent Builder", "Copilot Chat",
    "Standard")
//| where harness == "GitHub Copilot"
| project agentName = tostring(properties.displayName),
          agentId = name,
          harness,
          environmentId = tostring(properties.environmentId),
          ownerId = tostring(properties.ownerId),
          createdAt = todatetime(properties.createdAt)
| order by harness asc, createdAt desc

Item yang dibuat dalam 24 jam terakhir

PowerPlatformResources
| extend properties = parse_json(properties)
| extend createdAt = todatetime(properties.createdAt)
| where createdAt >= ago(24h)

Kueri konektor (pratinjau)

Kueri berikut menganalisis penggunaan konektor di seluruh jenis sumber daya yang dicakup oleh inventaris Konektor (pratinjau). Setiap kueri beroperasi pada larik properties.powerPlatformConnectors yang dihasilkan oleh aplikasi kanvas, aplikasi yang diarahkan model, alur cloud, alur agen, alur agen alur kerja, dan agen Copilot Studio.

Konektor teratas yang digunakan di seluruh sumber daya Power Platform

Mencantumkan konektor yang digunakan oleh sumber daya yang paling berbeda. Berguna untuk memahami konektor mana yang mendominasi adopsi di seluruh tenant.

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

Distribusi jumlah konektor per sumber daya

Memperlihatkan berapa banyak sumber daya yang menggunakan konektor 0, 1, 2, atau lebih. Berguna untuk mengidentifikasi faktor luar kompleksitas.

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

Menemukan semua sumber daya yang menggunakan konektor tertentu

Ganti shared_sharepointonline dengan konektor yang ingin Anda cari. Kueri ini berguna untuk analisis dampak ketika konektor memiliki masalah yang diketahui, tidak digunakan lagi, atau memerlukan lisensi baru.

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

Penggunaan konektor menurut lingkungan

Mencantumkan setiap konektor yang digunakan di setiap lingkungan, dengan jumlah sumber daya berbeda yang menggunakannya. Daftar ini berguna untuk memahami pola adopsi dan menginformasikan keputusan kebijakan 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