Azure / Azure/bicep

Cannot decompile arm template generated using a loop that creates a module array param

Open
#5,150 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue story: decompiler
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 2h
Merged PRs (30d)
79

Description

Here's two bicep files and its output ARM template

main.bicep
```bicep
param mainInput array

module mod 'foo.bicep' = {
name: 'test'
params: {
input: [for (item, index) in mainInput: mainInput[index]]
}
}
```

foo.bicep
```bicep
param input array
```

The resulting arm template cannot be decompiled because the value of the nested deployment's parameter does not have a `value`
![image](https://user-images.githubusercontent.com/3432839/141326886-1a916fc0-a57d-4ec1-923b-6a6787fde828.png)

Stacktrace of failure:
![image](https://user-images.githubusercontent.com/3432839/141326281-646cf635-a8e9-40e9-a2ab-0a6f0fc9d178.png)
![image](https://user-images.githubusercontent.com/3432839/141326202-51e18c59-d4e3-448c-a7bb-7cd07cb32f31.png)

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure using the main.bicep and foo.bicep examples, then compare their generated ARM template with the decompiler failure shown in the stack trace. Trace how the nested deployment parameter is read during decompilation. Done means this template decompiles successfully while preserving the module array parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, tooling
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.