Azure / Azure/azure-cli

Inconsistent default behaviour for VNet peering in portal and command line

Open
#26,066 1 comment 0 reactions 1 assignee Claimed by @necusjz View on GitHub
act-quality-productivity-squad Auto-Assign Azure CLI Team Network potential-pruning question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**
`az network vnet peering create`

**Is your feature request related to a problem? Please describe.**
Default behaviour of az cli to create VNet peering is block access for each VNet, while Azure Portal and Azure PowerShell allow access by default. We should have the same behaviour for default values in portal and command line. this is confusing and error prone.

> Portal
> ![image](https://user-images.githubusercontent.com/56948236/230525140-534e8b5e-64d3-4420-85de-ea4629aec0e5.png)
>

> PowerShell (It allows access for each VNet)
> ![image](https://user-images.githubusercontent.com/56948236/230525992-a3bd1cd1-4fde-4056-a84a-7d895cd77e9c.png)
> https://learn.microsoft.com/en-us/powershell/module/az.network/add-azvirtualnetworkpeering?view=azps-9.6.0
>

**Describe the solution you'd like**
Default value for parameter of `--allow-vnet-access` to be true.

**Describe alternatives you've considered**
Introduce warning message when customer doesn't pass `--allow-vnet-access` parameter that VMs between each VNet can't connect each other without this parameter.
https://learn.microsoft.com/en-us/cli/azure/network/vnet/peering?view=azure-cli-latest#az-network-vnet-peering-create

**Additional context**
Updating these default values will be breaking changes and may affect existing codes. Then adding warning message might be more feasible workaround than changing default behaviour.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.