Truy vấn mẫu hàng tồn kho Power Platform

Các truy vấn mẫu sau đây chạy đối với bảng PowerPlatformResources trong Azure Resource Graph. Chúng bao gồm đếm và phân phối tài nguyên, khám phá trường, tra cứu tài nguyên và phân tích sử dụng trình kết nối. Để biết tổng quan về khoảng không quảng cáo Power Platform, hãy xem Khoảng không quảng cáo Power Platform. Để biết sơ đồ và tham chiếu trường, hãy xem tham chiếu lược đồ hàng tồn kho Power Platform.

Cách chạy các truy vấn này

Bạn có thể chạy bất kỳ truy vấn nào trong số này từ giao diện Azure Resource Graph. Để biết hướng dẫn từng bước, hãy xem hướng dẫn bắt đầu nhanh sau:

Số lượng và phân phối

Tổng số lượng tất cả các nguồn lực

PowerPlatformResources
| count

Tổng số lượng theo loại tài nguyên

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

Số lượng theo môi trường

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

Số lượng theo khu vực

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

Chủ sở hữu hàng đầu theo số lượng mặt hàng

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

Tra cứu tài nguyên

Tìm một tổng đài viên duy nhất trong đối tượng thuê

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

Mẹo

Bạn có thể tìm thấy ID của tổng đài viên trong URL Copilot Studio khi xem tổng đài viên hoặc trong cột Tên của bảng khoảng không quảng cáo.

Đếm số đại lý theo khai thác

Hiển thị phân tích về các tác nhân được tạo ra với Microsoft Copilot dụng, Copilot Chat dụng hoặc dây cấu hình Tiêu chuẩn.

Bạn có thể xem khai thác của một đại lý trong cột Harness trong trung tâm quản trị Power Platform, bên dưới Quản>lý Copilot Studio. Cột đó chỉ là cột giao diện người dùng. Khai thác chưa được trả về dưới dạng siêu dữ liệu đại lý, vì vậy truy vấn này bắt nguồn từ các trường thư mục trả về: properties.isCLIAgent, properties.modelvà properties.createdIn. Khi trường trở properties.harness nên sẵn dùng, bạn có thể truy vấn trực tiếp trường đó thay vào đó. Để biết định nghĩa trường, hãy xem Microsoft Copilot Studio mục Thư mục tác nhân.

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

Liệt kê các đại lý với dây c kèm của họ

Trả về một hàng cho mỗi đại lý với khai thác của nó, vì vậy bạn có thể tìm và hành động trên từng tác nhân thay vì chỉ đếm chúng. Không chú thích dòng để where trả lại chỉ các đại lý được xây dựng với Microsoft Copilot dụng.

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

Các mục được tạo trong 24 giờ qua

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

Power Pages vấn (bản xem trước)

Power Pages truy vấn sử dụng loại microsoft.powerpages/sites tài nguyên. Power Pages tồn kho chỉ sẵn dùng cho người quản trị toàn cầu, người quản trị Power Platform và người quản Dynamics 365 khác.

Liệt kê Power Pages site

Truy vấn này trả về hàng tồn kho trên toàn bộ đối tượng thuê Power Pages với môi trường, chủ sở hữu, ngày tạo và sửa đổi của chúng.

PowerPlatformResources
| where type =~ "microsoft.powerpages/sites"
| extend properties = parse_json(properties)
| project siteName = tostring(properties.displayName),
    siteId = name,
    environmentId = tostring(properties.environmentId),
    ownerId = tostring(properties.ownerId),
    createdOn = todatetime(properties.createdAt),
    lastModifiedOn = todatetime(properties.lastModifiedAt)
| order by siteName asc

Đếm Power Pages site theo môi trường

Truy vấn này hiển thị môi trường nào chứa nhiều Power Pages trang web nhất.

PowerPlatformResources
| where type =~ "microsoft.powerpages/sites"
| extend properties = parse_json(properties)
| extend environmentId = tostring(properties.environmentId)
| summarize siteCount = count() by environmentId
| order by siteCount desc

Đếm Power Pages site theo chủ sở hữu

Truy vấn này hiển thị các chủ sở hữu được liên kết với số lượng lớn nhất Power Pages để hỗ trợ đánh giá quyền sở hữu và lập kế hoạch liên tục kinh doanh.

PowerPlatformResources
| where type =~ "microsoft.powerpages/sites"
| extend properties = parse_json(properties)
| extend ownerId = tostring(properties.ownerId)
| summarize siteCount = count() by ownerId
| order by siteCount desc

Power Pages trang web có bật truy nhập ẩn danh

Truy vấn này tìm các trang có siêu dữ liệu kiểm kê cho biết rằng truy nhập ẩn danh được cho phép.

PowerPlatformResources
| where type =~ "microsoft.powerpages/sites"
| extend properties = parse_json(properties)
| extend anonymousAccessEnabled = tobool(properties.anonymousAccessAllowed)
| where anonymousAccessEnabled == true
| project siteName = tostring(properties.displayName),
    siteId = name,
    environmentId = tostring(properties.environmentId),
    websiteUrl = tostring(properties.siteUrl)
| order by siteName asc

Các site được tạo Power Pages gần đây

Truy vấn này trả về các trang đã tạo trong 30 ngày qua. Điều chỉnh khoảng thời gian nếu cần.

PowerPlatformResources
| where type =~ "microsoft.powerpages/sites"
| extend properties = parse_json(properties)
| extend createdOn = todatetime(properties.createdAt)
| where createdOn >= ago(30d)
| project siteName = tostring(properties.displayName),
    siteId = name,
    environmentId = tostring(properties.environmentId),
    ownerId = tostring(properties.ownerId),
    createdOn
| order by createdOn desc

Power Pages dùng tên miền riêng

Truy vấn này trả về các trang có siêu dữ liệu kiểm kê bao gồm URL trang tùy chỉnh.

PowerPlatformResources
| where type =~ "microsoft.powerpages/sites"
| extend properties = parse_json(properties)
| extend customDomain = tostring(properties.customSiteUrl)
| where isnotempty(customDomain)
| project siteName = tostring(properties.displayName),
    siteId = name,
    environmentId = tostring(properties.environmentId),
    websiteUrl = tostring(properties.siteUrl),
    customDomain
| order by siteName asc

Power Pages với các tài nguyên Khác của Power Platform

Truy vấn này tóm tắt số lượng tài nguyên theo loại và môi trường trên Power Platform, bao gồm Power Pages trang web. Các bản ghi không có ID môi trường sẽ bị loại trừ.

PowerPlatformResources
| extend properties = parse_json(properties)
| extend environmentId = tostring(properties.environmentId)
| where isnotempty(environmentId)
| summarize resourceCount = count() by environmentId, type
| order by environmentId asc, resourceCount desc

Truy vấn đường kết nối

Các truy vấn sau đây phân tích việc sử dụng bộ nối trên các loại tài nguyên được bảo vệ bởi thư mục Trình kết nối. properties.powerPlatformConnectors Mỗi truy vấn hoạt động trên mảng được phát ra bởi các ứng dụng bảng tùy biến, ứng dụng dựa trên mô hình, ứng dụng được tích hợp trong thời gian chạy được quản lý của Copilot, dòng đám mây, dòng tác nhân, dòng tác nhân dòng công việc, tác nhân Copilot Studio trên khai thác tiêu chuẩn hoặc Microsoft Copilot và các tác nhân được tạo trong Microsoft 365 Copilot Agent Builder. Các ứng dụng được tích Copilot thời gian chạy được quản lý sử dụng microsoft.powerapps/apps loại với loại microsoftApp con. Các truy vấn loại trừ các ứng dụng Bộ dựng Ứng dụng sử dụng cùng loại nhưng không phát ra dữ liệu đường kết nối.

Các trình kết nối hàng đầu được sử dụng trên các tài nguyên Power Platform

Liệt kê các trình kết nối được sử dụng bởi các tài nguyên riêng biệt nhất. Hữu ích để hiểu trình kết nối nào thống trị việc áp dụng trên đối tượng thuê.

PowerPlatformResources
| where type in (
    "microsoft.powerapps/canvasapps",
    "microsoft.powerapps/modeldrivenapps",
    "microsoft.powerapps/apps",
    "microsoft.powerautomate/cloudflows",
    "microsoft.powerautomate/agentflows",
    "microsoft.powerautomate/m365agentflows",
    "microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| where type != "microsoft.powerapps/apps" or tostring(properties.subType) == "microsoftApp"
| 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

Phân phối số lượng trình kết nối trên mỗi tài nguyên

Hiển thị số lượng tài nguyên sử dụng 0, 1, 2 hoặc nhiều trình kết nối. Hữu ích để phát hiện các ngoại lệ phức tạp.

PowerPlatformResources
| where type in (
    "microsoft.powerapps/canvasapps",
    "microsoft.powerapps/modeldrivenapps",
    "microsoft.powerapps/apps",
    "microsoft.powerautomate/cloudflows",
    "microsoft.powerautomate/agentflows",
    "microsoft.powerautomate/m365agentflows",
    "microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| where type != "microsoft.powerapps/apps" or tostring(properties.subType) == "microsoftApp"
| extend connectorCount = array_length(properties.powerPlatformConnectors)
| summarize ResourceCount = count() by toint(connectorCount)
| order by connectorCount asc

Tìm tất cả các tài nguyên sử dụng một trình kết nối cụ thể

Thay thế shared_sharepointonline bằng trình kết nối bạn muốn tìm kiếm. Truy vấn này hữu ích cho phân tích tác động khi trình kết nối có sự cố đã biết, không được dùng nữa hoặc yêu cầu cấp phép mới.

PowerPlatformResources
| where type in (
    "microsoft.powerapps/canvasapps",
    "microsoft.powerapps/modeldrivenapps",
    "microsoft.powerapps/apps",
    "microsoft.powerautomate/cloudflows",
    "microsoft.powerautomate/agentflows",
    "microsoft.powerautomate/m365agentflows",
    "microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| where type != "microsoft.powerapps/apps" or tostring(properties.subType) == "microsoftApp"
| 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

Sử dụng đầu nối theo môi trường

Liệt kê mọi trình kết nối được sử dụng trong mọi môi trường, với số lượng tài nguyên riêng biệt sử dụng nó. Danh sách này hữu ích để hiểu các mô hình áp dụng và cung cấp thông tin cho các quyết định chính sách DLP.

PowerPlatformResources
| where type in (
    "microsoft.powerapps/canvasapps",
    "microsoft.powerapps/modeldrivenapps",
    "microsoft.powerapps/apps",
    "microsoft.powerautomate/cloudflows",
    "microsoft.powerautomate/agentflows",
    "microsoft.powerautomate/m365agentflows",
    "microsoft.copilotstudio/agents")
| extend properties = parse_json(properties)
| where type != "microsoft.powerapps/apps" or tostring(properties.subType) == "microsoftApp"
| 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