Azure / Azure/template-analyzer

[BUG] Nested template in ARM template gives wrong line number when referenced as Bicep module

Open
#307 1 comment 0 reactions 0 assignees View on GitHub
bug revisit
Dominant language
C#
Stars
143
Forks
47
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

When an ARM template with a nested template is referenced from a Bicep template as a module, any results from the nested ARM template will have incorrect line numbers.

### Expected behavior

Template-Analyzer should be able to give correct line numbers for results in nested ARM templates that are referenced from Bicep templates.

### Reproduction Steps

1. Create an ARM template that has a nested template, e.g. use one from tests like [SimpleNestedFail.json](https://github.com/Azure/template-analyzer/blob/development/src/Analyzer.Core.UnitTests/templates/SimpleNestedFail.json).
2. Create a Bicep module that references the ARM template with a nested template, e.g.
```
module armTemplate './{armTemplateFileName}' = {
name: 'nestedTemplate'
scope: resourceGroup('my-rg')
params: {}
}
```
3. Scan with template-analyzer and verify that line numbers for specific results in nested ARM template are incorrect.

### Environment

_No response_

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.