error vnet peering across tenants using Cloud Shell
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
Hi there,
getting an error when using Cloud shell for vnet peering across tenants:
https://docs.microsoft.com/en-us/azure/virtual-network/create-peering-different-subscriptions#cli
Using desktop native CLI works just fine.
Cloud shell:
=======
az network vnet peering create \
> --name myVnetAToMyVnetB \
> --resource-group test \
> --vnet-name vnet-home \
> --remote-vnet-id "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MC_cloud-shell-storage-westeurope_thecluster_westeurope/providers/Microsoft.Network/virtualNetworks/aks-vnet-94615314" \
> --allow-vnet-access
Option '--remote-vnet-id' has been deprecated and will be removed in version '2.1.0'.
Subscription 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found. Check the spelling and casing and try again.
native CLI:
======
C:\Users\shays>az network vnet peering create --name myVnetAToMyVnetB --resource-group test --vnet-name vnet-home --remote-vnet-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MC_cloud-shell-storage-westeurope_thecluster_westeurope/providers/Microsoft.Network/virtualNetworks/aks-vnet-94615314 --allow-vnet-access
{
"allowForwardedTraffic": false,
"allowGatewayTransit": false,
"allowVirtualNetworkAccess": true,
"etag": "W/\"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"",
"id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test/providers/Microsoft.Network/virtualNetworks/vnet-home/virtualNetworkPeerings/myVnetAToMyVnetB",
"name": "myVnetAToMyVnetB",
"peeringState": "Initiated",
"provisioningState": "Succeeded",
"remoteAddressSpace": {
"addressPrefixes": [
"10.0.0.0/8"
]
},
"remoteVirtualNetwork": {
"id": "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MC_cloud-shell-storage-westeurope_thecluster_westeurope/providers/Microsoft.Network/virtualNetworks/aks-vnet-94615314",
"resourceGroup": "MC_cloud-shell-storage-westeurope_thecluster_westeurope"
},
"resourceGroup": "test",
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings",
"useRemoteGateways": false
}
Contributor guide
Assessment
This issue has not been assessed yet.