"Parent" keyword should work with vars referencing a derived resource
- 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

Contributor 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