The ARM Template Tool Kit is a new static code analyser for ARM templates created by Microsoft. It's an open-source PowerShell library that you can use to validate your templates against a series of test cases. These test cases are generic and designed to validate that your templates are following best practice, a little like the PowerShell PSScriptAnalyzer tool. The ARM TTK tests for things like:
Templates are using a valid schema
Locations are not hardcoded
Outputs don't contain secrets
ID's are derived from resource ID's
Templates do not contain blanks
For full details of the ARM TTK visit it's Git repository
trigger:nonepr:nonepool:vmImage:'windows-latest'stages:- stage:QualityCheckStagedisplayName:Quality Check Stagejobs: - job:ARMTTKJobdisplayName:Run Azure Resource Manager (ARM) Template Tool Kit (TTK) Testssteps: - task:RunARMTTKTests@1displayName:Run ARM TTK Testsinputs:templatelocation:'$(System.DefaultWorkingDirectory)\Infrastructure-Source-Code\ARMTTK-TestFiles'resultLocation:'$(System.DefaultWorkingDirectory)\Results'# includeTests: 'VM Images Should Use Latest Version,Resources Should Have Location'# skipTests: 'VM Images Should Use Latest Version,Resources Should Have Location'# mainTemplates: 'template1.json, template2.json'allTemplatesMain:truecliOutputResults:true - task:PublishTestResults@2displayName:Publish Test Resultsinputs:testResultsFormat:'NUnit'testResultsFiles:'$(System.DefaultWorkingDirectory)\Results\*-armttk.xml'condition:always()