Azure / Azure/template-analyzer
An exception occurred while analyzing template.
- Dominant language
- C#
- Stars
- 143
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
We receive this error when we analyze bicep templates containing the metadata keyword. Removing the metadata keyword solves this problem, but we need this keyword for documentation and information purposes.
Information regarding this can be found in the reproduction steps.
We get the following errors:

### Expected behavior
Template files are analyzed with the metadata section.
### Reproduction Steps
Sample bicep
`metadata info = {
name: 'RBAC Module'
description: 'This module deploys a Role Based Access assignments'
version: '1.0.0'
author: 'Maik van der Gaag'
}
param principalId string
param roleDefinitionResourceId string
@description('This is the built-in Contributor role. See https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#contributor')
resource roleDefinition 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = {
scope: subscription()
name: roleDefinitionResourceId
}
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(resourceGroup().id, principalId, roleDefinition.id)
properties: {
roleDefinitionId: roleDefinition.id
principalId: principalId
principalType: 'ServicePrincipal'
}
scope: resourceGroup()
}`
When we analyze this with '.\TemplateAnalyzer.exe analyze-template D:\source\rbac.bicep -v'
### Environment
- Local and on Microsoft build agents
- .Net 6
Contributor guide
Assessment
This issue has not been assessed yet.