Thank you for reaching out.
Cany you please let us know if you are using ARM to deploy the LB with 2 VMS?
As documented here you receive circular dependency error when resources depend on each other in a way that prevents the deployment from starting. A combination of interdependencies makes two or more resources wait for other resources that are also waiting. For example, resource1
depends on resource3
, resource2
depends on resource1
, and resource3
depends on resource2
. You can usually solve this problem by removing unnecessary dependencies.
To solve a circular dependency:
- In your template, find the resource identified in the circular dependency.
- For that resource, examine the
dependsOn
property and any uses of thereference
orresourceId
functions to see which resources it depends on. - Examine those resources to see which resources they depend on. Follow the dependencies until you notice a resource that depends on the original resource.
- For the resources involved in the circular dependency, carefully examine all uses of the
dependsOn
property to identify any dependencies that aren't needed. To troubleshoot the deployment, remove the circular dependencies. Rather than delete the code, you can use comments so that the code doesn't run during the next deployment. You can use single-line comments (//
) or multi-line comments (/* ... */
) in ARM templates or Bicep files. - Redeploy the template.
Hope this helps!