Azure / Azure/azure-powershell

Sync-AzVirtualNetworkPeering does not syncing peerings

Open
#24,168 4 comments 1 reaction 0 assignees View on GitHub
act-quality-productivity-squad bug customer-reported Network - Virtual Network Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

Sync-AzVirtualNetworkPeering ends with success but the status for peering is still RemoteNotInSync
Owner permissions on both Hub and Spoke subscriptions.
Same happening using REST API and az cli [ az network vnet peering sync ]

### Issue script & Debug output

```PowerShell
Body:
{
"name": "xxx",
"id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/virtualNetworks/vnet-xxx-prod-westeurope/virtualNetworkPeerings/xxx",
"etag": "W/\"47108532-4444-4aff-baal-bc21fb62534c\"",
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "0fc7cb15-cccc-4444-2381-b2a48e07dbe4",
"peeringState": "Connected",
"peeringSyncLevel": "RemoteNotInSync",
"remoteVirtualNetwork": {
"id": "/subscriptions/xxx/resourceGroups/rg-xxx-network-westeurope/providers/Microsoft.Network/virtualNetworks/vnet-xxx-westeurope"
},
"allowVirtualNetworkAccess": true,
"allowForwardedTraffic": true,
"allowGatewayTransit": false,
"useRemoteGateways": false,
"doNotVerifyRemoteGateways": false,
"peerCompleteVnets": true,
"remoteAddressSpace": {
"addressPrefixes": [
"10.xx.xx.xx/28"
]
},
"remoteVirtualNetworkAddressSpace": {
"addressPrefixes": [
"10.xx.xx.xx/28"
]
},
"routeServiceVips": {}
},
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings"
}

DEBUG: 1:43:52 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 1:43:52 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Network:7.4.0; CommandName: Sync-AzVirtualNetworkPeering; PSVersion: 7.4.1; IsSuccess: True; Duration: 00:00:11.5268240
DEBUG: 1:43:52 PM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 1:43:52 PM - SyncAzureVirtualNetworkPeeringCommand end processing.
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS CBL-Mariner/Linux
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.15.1 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script 7.1.1 Az.Compute {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}
Script 7.4.0 Az.Network {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBackendHttpSetting, Add-AzApplicationGat…
Script 6.15.0 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script 6.1.1 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Close-AzStorageFileHandle…}
Script 1.1.3 Az.Tools.Predictor {Disable-AzPredictor, Enable-AzPredictor, Open-AzPredictorSurvey, Send-AzPredictorRating}
Script 0.0.0.10 AzureAD.Standard.Preview {Add-AzureADApplicationOwner, Add-AzureADDeviceRegisteredOwner, Add-AzureADDeviceRegisteredUser, Add-AzureADDirectoryRoleMember…}
Script 0.9.3 AzurePSDrive
```

### Error output

```PowerShell
There is no error. Run is successful but the peering's are still not synchronized.
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Sync-AzVirtualNetworkPeering with the issue script and compare the resulting peeringSyncLevel with the REST API and az network vnet peering sync behavior. The issue is resolved when a successful sync leaves the peering synchronized, or the command clearly reports the underlying failure or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.