You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Azure Graph Explorer获取指定资源类型的专用终结点信息?

使用Azure Graph Explorer获取专用终结点信息

可以通过Azure Graph Explorer实现该需求,只需编写对应的Kusto查询语句,即可提取并整理出你需要的字段数据。

示例查询代码

针对Event Hubs、Key Vault和MySQL Flexible Server这三类资源,查询语句如下:

resources
| where type in (
    "Microsoft.EventHub/namespaces",
    "Microsoft.KeyVault/vaults",
    "Microsoft.DBforMySQL/flexibleServers"
)
| project resourceId = id, resourceName = name, resourceType = type
| join kind=inner (
    resources
    | where type == "Microsoft.Network/privateEndpoints"
    | project privateEndpointName = name, privateEndpointIp = tostring(properties.ipAddresses[0]), subnetId = properties.subnet.id, privateLinkConnections = properties.privateLinkServiceConnections
    | mv-expand privateLinkConnections
    | project privateEndpointName, privateEndpointIp, subnetId, connectedResourceId = tostring(privateLinkConnections.properties.privateLinkServiceId)
) on $left.resourceId == $right.connectedResourceId
| extend subnetName = split(subnetId, '/')[-1]
| project 
    资源名称 = resourceName,
    连接至该资源的专用终结点 = privateEndpointName,
    专用终结点的IP地址 = privateEndpointIp,
    专用终结点所在的子网 = subnetName
| sort by resourceType asc

查询逻辑说明

  1. 首先筛选出目标类型的资源(Event Hubs、Key Vault、MySQL),提取资源ID和名称;
  2. 关联所有专用终结点资源,展开其私有链接连接属性,匹配到对应的目标资源ID;
  3. 从子网ID中提取子网名称(通过分割ID字符串取最后一段);
  4. 最终整理成你需要的四个字段,并按资源类型排序。

示例结果

执行查询后会返回类似以下格式的表格:

资源名称连接至该资源的专用终结点专用终结点的IP地址专用终结点所在的子网
my-eventhub-nspe-eventhub10.0.1.5subnet-pe
my-kv-vaultpe-keyvault10.0.1.6subnet-pe
my-mysql-serverpe-mysql10.0.1.7subnet-db

自定义调整

如果需要查询其他资源类型,只需修改第一个where type in (...)中的类型值即可,比如添加"Microsoft.Storage/storageAccounts"来查询存储账户的专用终结点。

内容的提问来源于stack exchange,提问作者Steve

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 19:13:20