Azure / Azure/template-analyzer

[BUG] GuardianErrorExitCodeException: templateanalyzer completed with an Error exit code: 21. Error: An error was encountered trying to analyze a template

Open
#341 10 comments 0 reactions 0 assignees View on GitHub
🔍 needs-triage bug
Dominant language
C#
Stars
143
Forks
47
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

Trying to setup defender for devops workflow for IaC repo. But workflow fails with error

Error: Error running tool 1 of 2: templateanalyzer
Error: Error running templateanalyzer job: 1 of 1
Error: GuardianErrorExitCodeException: templateanalyzer completed with an Error exit code: 21. Error: An error was encountered trying to analyze a template
Error: BreakException: Guardian detected one or more breaking results.
Error: Error: The process 'D:\a\_msdo\versions\microsoft.security.devops.cli\0.171.1\tools\guardian.cmd' failed with exit code 1

Template has two file main.bicep with all config and main.parameter.json for the parameters.
1 instance of: An exception occurred while analyzing template D:\a\til-iac\til-iac\bicep\products\energy-demand\main.json with parameters file D:\a\my project\main.parameters.json

### Expected behavior

Template Analyzer shouldnt fail

### Reproduction Steps

1. Create Project folder with Main.bicep template
2. Create parameter files with parameter. example
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"tags": {
"value": {
"APPID": "AP0000",
"Application Name": "name",
"Business Function": "Azure Resources",
"Application Owner": "name",
"Data Classification": "Internal Information",
"Regulatory Controlled Information": "N/A",
"Application Criticality": "N/A",
"TIS Portfolio Executive": "Name",
"Environment Type": "de",
"Business Criticality": "Level 4 - Deferrable",
"Primary Business Capability": "Data Services",
"Support Group": "Support Group",
"TIS Application Owner": "name"
}
}
}
}

### 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.