From 9d8d1bdaebf4f49c298dd1e791c7f197a27000ad Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Sat, 22 Feb 2025 22:47:24 +0100 Subject: [PATCH] Small fix for nullkey --- .../pipelines/staticValidation/compliance/module.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/pipelines/staticValidation/compliance/module.tests.ps1 b/utilities/pipelines/staticValidation/compliance/module.tests.ps1 index 2e0bacdb5a..380fc3c200 100644 --- a/utilities/pipelines/staticValidation/compliance/module.tests.ps1 +++ b/utilities/pipelines/staticValidation/compliance/module.tests.ps1 @@ -816,7 +816,7 @@ Describe 'Module tests' -Tag 'Module' { $hasMatchingParameter = $templateFileContent.parameters.managedIdentities.'$ref' -match 'managedIdentit' $matchingTypeKey = $templateFileContent.definitions.Keys | Where-Object { $_ -match 'managedIdentit' } - $hasSystemAssignedInType = $templateFileContent.definitions.$matchingTypeKey.properties.keys -contains 'systemAssigned' + $hasSystemAssignedInType = $templateFileContent.definitions.($matchingTypeKey ?? '').properties.keys -contains 'systemAssigned' if ($hasMatchingParameter -and $hasSystemAssignedInType) { $templateFileContent.outputs.Keys | Should -Contain 'systemAssignedMIPrincipalId' -Because 'The AVM specs require a this output. For information please review the [AVM Specs](https://azure.github.io/Azure-Verified-Modules/specs/bcp/res/interfaces/#managed-identities).'