From 689f8fb54fc0c8ea96a2c0603661ccd7bfda4939 Mon Sep 17 00:00:00 2001 From: Kris Baranek <20225789+krbar@users.noreply.github.com> Date: Fri, 30 Aug 2024 02:00:32 +0200 Subject: [PATCH] Fixed optional properties --- avm/res/insights/data-collection-rule/main.bicep | 6 +++--- avm/res/insights/data-collection-rule/main.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/avm/res/insights/data-collection-rule/main.bicep b/avm/res/insights/data-collection-rule/main.bicep index 23b774b46c..e0d6c035e3 100644 --- a/avm/res/insights/data-collection-rule/main.bicep +++ b/avm/res/insights/data-collection-rule/main.bicep @@ -86,8 +86,8 @@ resource dataCollectionRule 'Microsoft.Insights/dataCollectionRules@2023-03-11' dataSources: dataCollectionRuleProperties.dataSources dataFlows: dataCollectionRuleProperties.dataFlows destinations: dataCollectionRuleProperties.destinations - dataCollectionEndpointId: dataCollectionRuleProperties.dataCollectionEndpointId - streamDeclarations: dataCollectionRuleProperties.streamDeclarations + dataCollectionEndpointId: dataCollectionRuleProperties.?dataCollectionEndpointId + streamDeclarations: dataCollectionRuleProperties.?streamDeclarations } : {}, dataCollectionRuleProperties.kind == 'AgentSettings' @@ -96,7 +96,7 @@ resource dataCollectionRule 'Microsoft.Insights/dataCollectionRules@2023-03-11' } : {}, { - description: dataCollectionRuleProperties.description + description: dataCollectionRuleProperties.?description } ) } diff --git a/avm/res/insights/data-collection-rule/main.json b/avm/res/insights/data-collection-rule/main.json index 25259b7800..0f4a877002 100644 --- a/avm/res/insights/data-collection-rule/main.json +++ b/avm/res/insights/data-collection-rule/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.29.47.4906", - "templateHash": "18086407482545174237" + "templateHash": "16127257398169774892" }, "name": "Data Collection Rules", "description": "This module deploys a Data Collection Rule.", @@ -388,7 +388,7 @@ "kind": "[parameters('dataCollectionRuleProperties').kind]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", - "properties": "[union(if(or(equals(parameters('dataCollectionRuleProperties').kind, 'Linux'), equals(parameters('dataCollectionRuleProperties').kind, 'Windows')), createObject('dataSources', parameters('dataCollectionRuleProperties').dataSources, 'dataFlows', parameters('dataCollectionRuleProperties').dataFlows, 'destinations', parameters('dataCollectionRuleProperties').destinations, 'dataCollectionEndpointId', parameters('dataCollectionRuleProperties').dataCollectionEndpointId, 'streamDeclarations', parameters('dataCollectionRuleProperties').streamDeclarations), createObject()), if(equals(parameters('dataCollectionRuleProperties').kind, 'AgentSettings'), createObject('agentSettings', parameters('dataCollectionRuleProperties').agentSettings), createObject()), createObject('description', parameters('dataCollectionRuleProperties').description))]" + "properties": "[union(if(or(equals(parameters('dataCollectionRuleProperties').kind, 'Linux'), equals(parameters('dataCollectionRuleProperties').kind, 'Windows')), createObject('dataSources', parameters('dataCollectionRuleProperties').dataSources, 'dataFlows', parameters('dataCollectionRuleProperties').dataFlows, 'destinations', parameters('dataCollectionRuleProperties').destinations, 'dataCollectionEndpointId', tryGet(parameters('dataCollectionRuleProperties'), 'dataCollectionEndpointId'), 'streamDeclarations', tryGet(parameters('dataCollectionRuleProperties'), 'streamDeclarations')), createObject()), if(equals(parameters('dataCollectionRuleProperties').kind, 'AgentSettings'), createObject('agentSettings', parameters('dataCollectionRuleProperties').agentSettings), createObject()), createObject('description', tryGet(parameters('dataCollectionRuleProperties'), 'description')))]" }, "dataCollectionRule_lock": { "condition": "[and(not(empty(coalesce(parameters('lock'), createObject()))), not(equals(tryGet(parameters('lock'), 'kind'), 'None')))]",