gpt4 book ai didi

azure - 通过 CLI 创建 Azure ExpressRoute 连接 : Error: ID was missing the expressRouteGateways element

转载 作者:行者123 更新时间:2023-12-03 03:29:59 25 4
gpt4 key购买 nike

我正在尝试使用 Azure CLI 创建 Azure ExpressRoute 连接,但是 API 所需的 ExpressRoute 网关 ID 与通过门户提供的 ExpressRoute 网关 ID 之间似乎存在差异:

门户提供的 ER gw ID 为:

"/subscriptions/319b5c03-xxxxxxxxxx/resourceGroups/hk-connectivity-eastasia/providers/Microsoft.Network/virtualNetworkGateways/hk-ergw-eastasia"

但是 azure cli 似乎想要:

"/subscriptions/319b5c03-xxxxxxxxxx/resourceGroups/hk-connectivity-eastasia/providers/Microsoft.Network/expressRouteGateways/hk-ergw-eastasia"

(或者至少包含“expressRouteGateways”的内容)

所以我们得到错误:

**az network express-route gateway connection create --gateway-name /subscriptions/REDACTED/resourceGroups/hk-connectivity-eastasia/providers/Microsoft.Network/virtualNetworkGateways/hk-ergw-eastasia --name hk-nprd-erc-000 --resource-group hk-connectivity-eastasia --circuit-name er-expressroute-ea-nprd-erc-hub00-net --peering AzurePrivatePeering


ERROR: (ResourceNotFound)

The Resource 'Microsoft.Network/expressRouteGateways/subscriptions'

under resource group 'hk-connectivity-eastasia' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

Code: ResourceNotFound

Message: The Resource 'Microsoft.Network/expressRouteGateways/subscriptions' under resource group 'hk-connectivity-eastasia' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
+ OUT=
+ printf 'connection creation result: \n'
connection creation result:

不过,我似乎无法将此视为已知错误或相关问题。

尝试#2:

命令行界面:

az network express-route gateway connection create \
--gateway-name hk-ergw-eastasia \
--name hk-nonprod-erconn-000 \
--peering /subscriptions/REDACTED/resourceGroups/hk-connectivity-eastasia/providers/Microsoft.Network/expressRouteCircuits/hk-nonprod/peerings/AzurePrivatePeering \
--resource-group hk-connectivity-eastasia

结果:

++ az network express-route gateway connection create --gateway-name hk-ergw-eastasia --name hk-nonprod-erconn-000 --peering /subscriptions/REDACTED/resourceGroups/hk-connectivity-eastasia/providers/Microsoft.Network/expressRouteCircuits/hk-nonprod/peerings/AzurePrivatePeering --resource-group hk-connectivity-eastasia
ERROR: (ResourceNotFound) The Resource 'Microsoft.Network/expressRouteGateways/hk-ergw-eastasia' under resource group 'hk-connectivity-eastasia' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.Network/expressRouteGateways/hk-ergw-eastasia' under resource group 'hk-connectivity-eastasia' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

故障排除说明:

  1. ER 回路已启动并运行
  2. BGP 路由正在 ISP 和本地之间交换
  3. 到连接到 ER 网关的中心 VNET 和分支 VNET 的 BGP 路由正在传播到本地
  4. 因此,BGP 对等互连没问题。

最佳答案

为了创建到网关连接的 azure 网络快速路由,请使用以下脚本。

您可以在门户中获取Azure 网关名称,如下所示。

Azure 门户 > 虚拟网络网关 > 选择您的网关

enter image description here

这是创建 Azure ExpressRoute 连接的脚本

az network express-route gateway connection create --gateway-name MyGateway --name MyExpressRouteConnection --peering /subscriptions/MySub/resourceGroups/MyResourceGroup/provi ders/Microsoft.Network/expressRouteCircuits/MyCircuit/peerings/AzurePrivatePeering --resource-group MyResourceGroup

引用:https://learn.microsoft.com/en-us/cli/azure/network/express-route/gateway/connection?view=azure-cli-latest#az-network-express-route-gateway-connection-create

关于azure - 通过 CLI 创建 Azure ExpressRoute 连接 : Error: ID was missing the expressRouteGateways element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74896504/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com