gpt4 book ai didi

azure - "az network vnet peering create"结果为 "BadRequestError: Cannot parse the request."

转载 作者:行者123 更新时间:2023-12-03 03:54:04 24 4
gpt4 key购买 nike

我正在尝试使用 CLI 对等两个 Azure vnet,因此我遵循了教程 Connect virtual networks with virtual network peering using the Azure CLI 。但结果始终是“BadRequestError:无法解析请求”

# Get the id for myVirtualNetwork1.
vNet1Id=$(az network vnet show \
--resource-group myResourceGroup \
--name myVirtualNetwork1 \
--query id --out tsv)

# Get the id for myVirtualNetwork2.
vNet2Id=$(az network vnet show \
--resource-group myResourceGroup \
--name myVirtualNetwork2 \
--query id \
--out tsv)

az network vnet peering create \
--name myVirtualNetwork1-myVirtualNetwork2 \
--resource-group myResourceGroup \
--vnet-name myVirtualNetwork1 \
--remote-vnet $vNet2Id \
--allow-vnet-access

--> BadRequestError:无法解析请求。

有人有什么想法吗?

最佳答案

这是我在 Azure CLI 中使用的脚本:

az group create --name myResourceGroup --location eastus
az network vnet create \
--name myVirtualNetwork1 \
--resource-group myResourceGroup \
--address-prefixes 10.0.0.0/16 \
--subnet-name Subnet1 \
--subnet-prefix 10.0.0.0/24
az network vnet create \
--name myVirtualNetwork2 \
--resource-group myResourceGroup \
--address-prefixes 10.1.0.0/16 \
--subnet-name Subnet1 \
--subnet-prefix 10.1.0.0/24
# Get the id for myVirtualNetwork1.
vNet1Id=$(az network vnet show \
--resource-group myResourceGroup \
--name myVirtualNetwork1 \
--query id --out tsv)

# Get the id for myVirtualNetwork2.
vNet2Id=$(az network vnet show \
--resource-group myResourceGroup \
--name myVirtualNetwork2 \
--query id \
--out tsv)
az network vnet peering create \
--name myVirtualNetwork1-myVirtualNetwork2 \
--resource-group myResourceGroup \
--vnet-name myVirtualNetwork1 \
--remote-vnet $vNet2Id \
--allow-vnet-access \
--out tsv

enter image description here

关于azure - "az network vnet peering create"结果为 "BadRequestError: Cannot parse the request.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65330470/

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