Bicep deployment: Resource is in Updating state and the last operation that updated/is updating the resource is PutVirtualNetworkOperation.

Pradeep Patlolla 1 Reputation point
2022-11-11T10:17:52.293+00:00

We are Creating 3 VNets(in same region) and trying to create peering between these. Bicep code is written in such a way that these VNETS/Peering are created in parallel. VNETS are getting created (alongwith subnets as described in the code),however peering is getting failed with the error ""Cannot proceed with operation because resource XXXXXXXX used by resource XXXXXXX is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is PutVirtualNetworkOperation."

We assume this is because for VNET1 the peering status is in "Updating" state and when peering is trying to happen because of this state its failing from other 2 VNETS. We tried with "dependson" but didnt help.

How to update the bicep code in such a way that deployment should wait for sometime (or) to check for a conditon where peering status is "initiated" (or) retry after sometime before actually the main.bicep file gets into failed state.Any other solutions to resolve our issue?

Thanks in advance.

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,775 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pradeep Patlolla 1 Reputation point
    2022-11-15T12:23:23.953+00:00

    Hi @GitaraniSharma-MSFT

    I was able to resolve the issue. Resolution was to remove the VNet peering resource from main.bicep and calling it as a module instead with dependency on VNet's. Hope it might help someone.

    Thanks,
    Pradeep Reddy Patlolla


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.