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

如何查看Azure Route Server的当前路由偏好配置?

查看Azure Route Server路由偏好配置的PowerShell方法

目前Az PowerShell模块确实没有专门的cmdlet直接获取Azure Route Server的路由偏好配置,你可以通过以下两种方式查询:

  • 使用Get-AzResource读取资源属性
    Route Server本质属于虚拟中心(virtualHubs)资源类型,可通过该cmdlet提取路由偏好字段:

    # 替换为你的实际资源信息
    $routeServerName = "你的RouteServer名称"
    $resourceGroupName = "你的资源组名称"
    
    Get-AzResource -ResourceType "Microsoft.Network/virtualHubs" -Name $routeServerName -ResourceGroupName $resourceGroupName | 
        Select-Object -ExpandProperty Properties | 
        Select-Object routingPreference
    
  • 调用Azure REST API(通过Invoke-AzRestMethod)
    如果需要更完整的资源配置信息,可直接调用REST API查询:

    # 替换为你的实际订阅及资源信息
    $subscriptionId = "你的订阅ID"
    $routeServerName = "你的RouteServer名称"
    $resourceGroupName = "你的资源组名称"
    $apiVersion = "2023-09-01"
    
    $uri = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Network/virtualHubs/$routeServerName?api-version=$apiVersion"
    $response = Invoke-AzRestMethod -Method GET -Uri $uri
    
    # 解析返回的JSON内容,提取路由偏好
    ($response.Content | ConvertFrom-Json).properties.routingPreference
    

后续可以关注Az PowerShell模块的更新,官方可能会新增专门用于查询Route Server路由偏好的cmdlet。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.26 18:57:04