in src/Analyzer.Core/TemplateAnalyzer.cs [100:134]
public IEnumerable<IEvaluation> AnalyzeTemplate(string template, string templateFilePath, string parameters = null)
{
if (template == null) throw new ArgumentNullException(nameof(template));
if (templateFilePath == null) throw new ArgumentNullException(nameof(templateFilePath));
// If the template is Bicep, convert to JSON and get source map:
var isBicep = templateFilePath != null && templateFilePath.ToLower().EndsWith(".bicep", StringComparison.OrdinalIgnoreCase);
object bicepMetadata = null;
if (isBicep)
{
try
{
(template, bicepMetadata) = BicepTemplateProcessor.ConvertBicepToJson(templateFilePath);
}
catch (Exception e)
{
throw new TemplateAnalyzerException(BicepCompileErrorMessage, e);
}
}
var templateContext = new TemplateContext
{
OriginalTemplate = null,
ExpandedTemplate = null,
IsMainTemplate = true,
ResourceMappings = null,
TemplateIdentifier = templateFilePath,
IsBicep = isBicep,
BicepMetadata = bicepMetadata,
PathPrefix = "",
ParentContext = null
};
return AnalyzeAllIncludedTemplates(template, parameters, templateFilePath, templateContext, string.Empty);
}