in src/PSRule.Rules.Azure/Data/Template/TemplateVisitor.cs [859:902]
protected virtual void Template(TemplateContext context, string deploymentName, JObject template, bool isNested)
{
try
{
context.EnterDeployment(deploymentName, template, isNested);
// Process template sections
if (TryStringProperty(template, PROPERTY_SCHEMA, out var schema))
Schema(context, schema);
if (TryStringProperty(template, PROPERTY_CONTENT_VERSION, out var contentVersion))
ContentVersion(context, contentVersion);
// Handle custom type definitions
if (!isNested && TryObjectProperty(template, PROPERTY_DEFINITIONS, out var definitions))
Definitions(context, definitions);
// Handle compile time function variables
if (TryObjectProperty(template, PROPERTY_VARIABLES, out var variables))
FunctionVariables(context, variables);
if (TryArrayProperty(template, PROPERTY_FUNCTIONS, out var functions))
Functions(context, functions);
if (TryObjectProperty(template, PROPERTY_PARAMETERS, out var parameters))
Parameters(context, parameters);
if (TryObjectProperty(template, PROPERTY_VARIABLES, out variables))
Variables(context, variables);
if (TryObjectProperty(template, PROPERTY_RESOURCES, out var oResources))
Resources(context, oResources);
if (TryArrayProperty(template, PROPERTY_RESOURCES, out var aResources))
Resources(context, aResources);
if (TryObjectProperty(template, PROPERTY_OUTPUTS, out var outputs))
Outputs(context, outputs);
}
finally
{
context.ExitDeployment();
}
}