Validate ARM Template
Validate the ARM template.
Introduction
It is important that we vaidate our ARM template before publishing. There are a number of specific best practice checks that will be performed on the template as part of the publishing process to meet the certification requirements for Azure Applications. Many of these are automated in the Azure Resource Manager Template Toolkit. If the ARM template does not conform it will fail certification.
Install the ARM template test toolkit
-
The tests require PowerShell. If you don’t have PowerShell installed, install PowerShell Core for your OS.
-
Download the latest zip ARM Temlate Toolkit file and extract it to a suitable folder
-
In PowerShell, navigate to the folder in the previous step
-
You may need to modify your execution policy for the script to work
-
Execute the following PowerShell command in the arm-ttk folder
Get-ChildItem *.ps1, *.psd1, *.ps1xml, *.psm1 -Recurse | Unblock-File
-
-
Import the module
-
Execute the following PowerShell command
Import-Module .\arm-ttk.psd1
-
-
For more details, see Use ARM template test toolkit
Run the tests
-
Execute the following PowerShell command to run the tests. It may be easier to make a copy of the ARM template a save it in the arm-ttk folder
Test-AzTemplate -TemplatePath \path\to\template_to_be_tested
-
Review the results and address any issues
Resources
- Commercial marketplace certification policies
- Azure Resource Manager Templates - Best Practices Guide
- MS Learn - Validate Azure resources by using the ARM Template Test Toolkit
Help us improve
Azure Citadel is a community site built on GitHub, please contribute and send a pull request
Make a change