An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
Hello @Goto, Nanami/後藤 七海 ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
The Set-AzVirtualNetworkPeering cmdlet is used to configure a virtual network peering.
Reference : https://learn.microsoft.com/en-us/powershell/module/az.network/set-azvirtualnetworkpeering?view=azps-6.2.1
Get the virtual network peering you want to update information for :
$myVnet1TomyVnet2 = Get-AzVirtualNetworkPeering -VirtualNetworkName "myVnet1" -ResourceGroupName "myResourceGroup" -Name "myVnet1TomyVnet2"
Change value of AllowForwardedTraffic property :
$myVnet1ToMyVnet2.AllowForwardedTraffic = $True
Change AllowGatewayTransit property :
$myVnet1TomyVnet2.AllowGatewayTransit = $True
Change the UseRemoteGateways property :
$myVnet1TomyVnet2.UseRemoteGateways = $True
NOTE : By changing this property to $True, your peer's VNet gateway can be used. However, the peer VNet must have a gateway configured and AllowGatewayTransit must have a value of $True. This property cannot be used if a gateway has already been configured.
Update the peering with changes made :
Set-AzVirtualNetworkPeering -VirtualNetworkPeering $myVnet1ToMyVnet2
Kindly let us know if the above helps or you need further assistance on this issue.
----------------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.