From d1ae306f45a8add19a914f39f05f82744c2af235 Mon Sep 17 00:00:00 2001 From: v-amolpatil Date: Thu, 18 Jan 2024 17:40:33 +0530 Subject: [PATCH 1/2] Added property requiredDataConnectors in Template-Should-Not-Contain-Blanks.test.ps1 to ignore --- .../Template-Should-Not-Contain-Blanks.test.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arm-ttk/testcases/deploymentTemplate/Template-Should-Not-Contain-Blanks.test.ps1 b/arm-ttk/testcases/deploymentTemplate/Template-Should-Not-Contain-Blanks.test.ps1 index d518a8bc..e3de9c0e 100644 --- a/arm-ttk/testcases/deploymentTemplate/Template-Should-Not-Contain-Blanks.test.ps1 +++ b/arm-ttk/testcases/deploymentTemplate/Template-Should-Not-Contain-Blanks.test.ps1 @@ -32,7 +32,8 @@ param( 'clientId', # Microsoft.ContainerService/managedClusters.properties.servicePrincipalProfile 'allowedCallerIpAddresses', # Microsoft.Logic/workflows Access Control 'workerPools', # Microsoft.Web/hostingEnvironments - 'AzureMonitor' # Microsoft.Insights/VMDiagnosticsSettings + 'AzureMonitor', # Microsoft.Insights/VMDiagnosticsSettings + 'requiredDataConnectors' #Microsoft.SecurityInsights/AlertRuleTemplates ), # Some properties can be empty within a given resource. From 2330c8c0392ad67c1d632ff596eea13feddbf1c4 Mon Sep 17 00:00:00 2001 From: v-amolpatil Date: Thu, 18 Jan 2024 20:40:07 +0530 Subject: [PATCH 2/2] added test cases --- ...ataConnectors-empty-array-should-pass.json | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 unit-tests/Template-Should-Not-Contain-Blanks/Pass/requiredDataConnectors-empty-array-should-pass.json diff --git a/unit-tests/Template-Should-Not-Contain-Blanks/Pass/requiredDataConnectors-empty-array-should-pass.json b/unit-tests/Template-Should-Not-Contain-Blanks/Pass/requiredDataConnectors-empty-array-should-pass.json new file mode 100644 index 00000000..d2a3c557 --- /dev/null +++ b/unit-tests/Template-Should-Not-Contain-Blanks/Pass/requiredDataConnectors-empty-array-should-pass.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "resources": [ + { + "type": "Microsoft.OperationalInsights/workspaces/providers/contentTemplates", + "name": "TestAnalyticRule", + "properties": { + "mainTemplate": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.2", + "parameters": {}, + "variables": {}, + "resources": [ + { + "type": "Microsoft.SecurityInsights/AlertRuleTemplates", + "name": "TestAnalyticRuleName", + "apiVersion": "2022-04-01-preview", + "kind": "Scheduled", + "properties": { + "displayName": "Test Rule", + "enabled": false, + "query": "Test Query", + "requiredDataConnectors": [] + } + } + ] + } + } + } + ], + "outputs": {} +}