From 5fa88488323d851ca74306244a181abe75cc5375 Mon Sep 17 00:00:00 2001 From: SeSeicht Date: Thu, 19 May 2022 15:16:19 +0200 Subject: [PATCH 1/6] add etag to savedSearches --- arm/Microsoft.OperationalInsights/workspaces/deploy.bicep | 1 + .../workspaces/savedSearches/deploy.bicep | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep index 64236db979..2f2277613a 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep +++ b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep @@ -201,6 +201,7 @@ module logAnalyticsWorkspace_savedSearches 'savedSearches/deploy.bicep' = [for ( params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name name: '${savedSearch.name}${uniqueString(deployment().name)}' + etag: savedSearch.etag displayName: savedSearch.displayName category: savedSearch.category query: savedSearch.query diff --git a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep index 7711526c3c..3db506e0c9 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep +++ b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep @@ -25,6 +25,9 @@ param functionParameters string = '' @description('Optional. The version number of the query language.') param version int = 2 +@description('Optional. The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag') +param etag string = '*' + @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true @@ -47,7 +50,9 @@ resource workspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' existin resource savedSearch 'Microsoft.OperationalInsights/workspaces/savedSearches@2020-08-01' = { name: name parent: workspace + //etag: etag // According to API, the variable should be here, but it doesn't work here. properties: { + etag: etag tags: tags displayName: displayName category: category From 0ab138e38e86cf44938f845e522effde3e2ee7a9 Mon Sep 17 00:00:00 2001 From: SeSeicht Date: Thu, 19 May 2022 15:17:02 +0200 Subject: [PATCH 2/6] updating readme --- .../workspaces/savedSearches/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md index b0f6a06e13..e4dde274f5 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md +++ b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md @@ -33,6 +33,7 @@ This template deploys a saved search for a Log Analytics workspace. | Parameter Name | Type | Default Value | Description | | :-- | :-- | :-- | :-- | | `enableDefaultTelemetry` | bool | `True` | Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `etag` | string | `'*'` | The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag | | `functionAlias` | string | `''` | The function alias if query serves as a function.. | | `functionParameters` | string | `''` | The optional function parameters if query serves as a function. Value should be in the following format: "param-name1:type1 = default_value1, param-name2:type2 = default_value2". For more examples and proper syntax please refer to /azure/kusto/query/functions/user-defined-functions. | | `tags` | array | `[]` | Tags to configure in the resource. | From f507cec621b05110b43fddf61f5b04f80ec0607e Mon Sep 17 00:00:00 2001 From: SeSeicht Date: Thu, 19 May 2022 15:22:38 +0200 Subject: [PATCH 3/6] adding dot --- .../workspaces/savedSearches/deploy.bicep | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep index 3db506e0c9..7d1ff5d340 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep +++ b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep @@ -16,7 +16,7 @@ param query string @description('Optional. Tags to configure in the resource.') param tags array = [] -@description('Optional. The function alias if query serves as a function..') +@description('Optional. The function alias if query serves as a function.') param functionAlias string = '' @description('Optional. The optional function parameters if query serves as a function. Value should be in the following format: "param-name1:type1 = default_value1, param-name2:type2 = default_value2". For more examples and proper syntax please refer to /azure/kusto/query/functions/user-defined-functions.') @@ -25,7 +25,7 @@ param functionParameters string = '' @description('Optional. The version number of the query language.') param version int = 2 -@description('Optional. The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag') +@description('Optional. The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag'.) param etag string = '*' @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') From 98f7c5c8920a6add301027cd7b59ba3a2933099b Mon Sep 17 00:00:00 2001 From: SeSeicht Date: Thu, 19 May 2022 16:03:55 +0200 Subject: [PATCH 4/6] fixing dot --- .../workspaces/savedSearches/deploy.bicep | 2 +- .../workspaces/savedSearches/readme.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep index 7d1ff5d340..aed7b98e04 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep +++ b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep @@ -25,7 +25,7 @@ param functionParameters string = '' @description('Optional. The version number of the query language.') param version int = 2 -@description('Optional. The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag'.) +@description('Optional. The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag.') param etag string = '*' @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') diff --git a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md index e4dde274f5..3acecee52c 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md +++ b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md @@ -33,8 +33,8 @@ This template deploys a saved search for a Log Analytics workspace. | Parameter Name | Type | Default Value | Description | | :-- | :-- | :-- | :-- | | `enableDefaultTelemetry` | bool | `True` | Enable telemetry via the Customer Usage Attribution ID (GUID). | -| `etag` | string | `'*'` | The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag | -| `functionAlias` | string | `''` | The function alias if query serves as a function.. | +| `etag` | string | `'*'` | The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag. | +| `functionAlias` | string | `''` | The function alias if query serves as a function. | | `functionParameters` | string | `''` | The optional function parameters if query serves as a function. Value should be in the following format: "param-name1:type1 = default_value1, param-name2:type2 = default_value2". For more examples and proper syntax please refer to /azure/kusto/query/functions/user-defined-functions. | | `tags` | array | `[]` | Tags to configure in the resource. | | `version` | int | `2` | The version number of the query language. | From 561a03e2d035b99ffe9edcf32f3d66a3c6585fc5 Mon Sep 17 00:00:00 2001 From: SeSeicht Date: Thu, 19 May 2022 20:06:12 +0200 Subject: [PATCH 5/6] removing etag from parent deploy.bicep --- arm/Microsoft.OperationalInsights/workspaces/deploy.bicep | 1 - 1 file changed, 1 deletion(-) diff --git a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep index 2f2277613a..64236db979 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep +++ b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep @@ -201,7 +201,6 @@ module logAnalyticsWorkspace_savedSearches 'savedSearches/deploy.bicep' = [for ( params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name name: '${savedSearch.name}${uniqueString(deployment().name)}' - etag: savedSearch.etag displayName: savedSearch.displayName category: savedSearch.category query: savedSearch.query From 5bfa6189ecda4aba29bdb0b17acbddc44a071d31 Mon Sep 17 00:00:00 2001 From: SeSeicht Date: Thu, 19 May 2022 20:35:32 +0200 Subject: [PATCH 6/6] add etag in parent with condition --- arm/Microsoft.OperationalInsights/workspaces/deploy.bicep | 1 + 1 file changed, 1 insertion(+) diff --git a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep index 64236db979..7655b61b71 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep +++ b/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep @@ -201,6 +201,7 @@ module logAnalyticsWorkspace_savedSearches 'savedSearches/deploy.bicep' = [for ( params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name name: '${savedSearch.name}${uniqueString(deployment().name)}' + etag: contains(savedSearch, 'eTag') ? savedSearch.etag : '*' displayName: savedSearch.displayName category: savedSearch.category query: savedSearch.query