Azure / Azure/bicep

AzFrontDoor and RulesEngine Dependencies

Open
#3,249 7 comments 3 reactions 1 assignee Claimed by @bmoore-msft View on GitHub
investigate provider bug provider improvement
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 2h
Merged PRs (30d)
79

Description

**Bicep version**
Bicep CLI version 0.4.63 (7ebed03284)

**Describe the bug**
Dependency loop.
Building new Azure Front Door and Rules Engine. The Routing Rule reference for the Rules Engine doesn't exist until the Azure Front Door is built, but building the Azure Front Door fails because the referenced Rules Engine doesn't exist yet.

**To Reproduce**
build Azure Front Door that has a routing rule reference to a rules engine that exists as a child resource of that same azure front door object you are attempting to build.

**Additional context**
Setting `dependsOn` on the `rulesEngine` resource and commenting out the reference in the `routingRules` allows you to build the Azure Front Door. Then I can uncomment the `rulesEngine` reference, apply again, and it will now find the AFD associate the new `rulesEngine`.

reference in the routing rules of AFD resource

```bicep
routingRules: [
{
name: appName
properties: {
rulesEngine: {
id: resourceId('Microsoft.Network/frontDoors/rulesEngines', fdName, rulesEngineName)
}
```

reference of the fdRulesEngine resource

```bicep
resource fdRulesEngine 'Microsoft.Network/frontDoors/rulesEngines@2020-05-01' = {
//note: rules-engine resource specific scenario where the parent (afd) resource name needs to be included in child name
name: '${fdName}/${rulesEngineName}'`
```

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.