Azure / Azure/bicep

"Parent" keyword should work with vars referencing a derived resource

Open
#3,594 1 comment 0 reactions 0 assignees View on GitHub
revisit
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
0.4.350 (632fa2d86e)

**Describe the bug**
A var reference to a parent should operate the same as a direct reference to that resource.

**To Reproduce**
This works:
```
resource managementSubscriptionMoveToMg 'Microsoft.Management/managementGroups/subscriptions@2021-04-01' = {
name: managementSubscription.id
parent: platformMgChildren[0]
}
```

This does not (replace direct reference to platformMgChildren[0] with var
![image](https://user-images.githubusercontent.com/15258962/125470162-536eb1ed-f305-458b-a4d1-bafe61f9de16.png)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two examples from the issue using Bicep 0.4.350, comparing a direct parent reference with a variable referencing the derived resource. The issue is done when the variable form works the same way as the direct reference for the management group resource.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.