Setting up the test harness

To test resources deployed using the ARM template, it is important that the template deployment generates the necessary outputs that can be read later for testing purposes. Since this activity has already been taken care of, it's time to read the outputs. The outputs from the ARM template can be read using Get-AzureRmResouceGroupDeployment and passing the name of the deployment, along with the resource group's name. The returned output from this cmdlet can be used to retrieve the outputs individually. This code should be placed within the BeforeAll function of Pester so that it can be executed before any of the test cases are executed.

The code shown next gets all the outputs for each resource and stores them into ...

Get Azure Resource Manager Templates Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.