Hi.
I’m trying to validate the infrastructure being deployed into Azure. What i am looking to do is populate a JSON file with values and then pull the values in, and then check that what is listed in the JSON has been deployed.
So i am getting all resourcesGroups that have been deployed and then trying to check that against whats in my JSON file.
Describe 'Resource Groups' {
BeforeDiscovery {
$r = Get-Content .\DevTest.Parameters.json | ConvertFrom-Json -AsHashtable
$resourceGroup = $R.resourceGroups.Values
}
Context 'Checking Resource Group <item>' -Foreach $resourceGroup {
BeforeAll {
$deployResourceGroups = (Get-AzResourceGroup).ResourceGroupName
#Not sure what i shuould put here?
}
It "Checking resourceGroup exists" {
$resourceGroup | Should -Be $expectedResultName
}
}
}
But i can’t get this to work, so hoping someone can point be in the right direction?
Thanks