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 diff --git a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep index 7711526c3c..aed7b98e04 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,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 diff --git a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md index b0f6a06e13..3acecee52c 100644 --- a/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md +++ b/arm/Microsoft.OperationalInsights/workspaces/savedSearches/readme.md @@ -33,7 +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). | -| `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. |