From 46042e7462faa57b2d2fef614706bc8584114a34 Mon Sep 17 00:00:00 2001 From: Kris Baranek <20225789+krbar@users.noreply.github.com> Date: Mon, 18 Nov 2024 06:23:42 +0100 Subject: [PATCH] feat: Add UDT to `avm/res/operational-insights/workspace` (#3774) ## Description Add User Defined Types to the Log Analytics Workspace module. Also fixes #3798 ## Pipeline Reference | Pipeline | | -------- | | [![avm.res.operational-insights.workspace](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.operational-insights.workspace.yml/badge.svg?branch=users%2Fkrbar%2FlawUDT)](https://github.com/krbar/bicep-registry-modules/actions/workflows/avm.res.operational-insights.workspace.yml) | ## Type of Change - [ ] Update to CI Environment or utilities (Non-module affecting changes) - [x] Azure Verified Module updates: - [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [x] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation ## Checklist - [x] I'm sure there are no other open Pull Requests for the same update/change - [x] I have run `Set-AVMModule` locally to generate the supporting module files. - [x] My corresponding pipelines / checks run clean and green without any errors or warnings --------- Co-authored-by: Alexander Sehr --- .../operational-insights/workspace/README.md | 884 ++++++++++++- .../workspace/data-export/README.md | 57 +- .../workspace/data-export/main.bicep | 23 +- .../workspace/data-export/main.json | 66 +- .../workspace/data-source/README.md | 14 +- .../workspace/data-source/main.bicep | 16 +- .../workspace/data-source/main.json | 25 +- .../workspace/linked-service/README.md | 2 - .../workspace/linked-service/main.bicep | 6 +- .../workspace/linked-service/main.json | 15 +- .../linked-storage-account/README.md | 8 +- .../linked-storage-account/main.bicep | 9 +- .../linked-storage-account/main.json | 36 +- .../operational-insights/workspace/main.bicep | 195 ++- .../operational-insights/workspace/main.json | 1112 +++++++++++++++-- .../workspace/saved-search/main.json | 9 +- .../storage-insight-config/README.md | 2 - .../storage-insight-config/main.bicep | 4 +- .../storage-insight-config/main.json | 20 +- .../workspace/table/README.md | 196 ++- .../workspace/table/main.bicep | 60 +- .../workspace/table/main.json | 190 ++- .../workspace/tests/e2e/adv/main.test.bicep | 20 +- .../workspace/tests/e2e/max/main.test.bicep | 20 +- .../tests/e2e/waf-aligned/main.test.bicep | 4 +- .../workspace/version.json | 4 +- 26 files changed, 2655 insertions(+), 342 deletions(-) diff --git a/avm/res/operational-insights/workspace/README.md b/avm/res/operational-insights/workspace/README.md index 5e62e5614e..c852991208 100644 --- a/avm/res/operational-insights/workspace/README.md +++ b/avm/res/operational-insights/workspace/README.md @@ -215,7 +215,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = linkedStorageAccounts: [ { name: 'Query' - resourceId: '' + storageAccountIds: [ + '' + ] } ] location: '' @@ -270,11 +272,11 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableBasic_CL' @@ -304,27 +306,27 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'EventTime' - type: 'DateTime' + type: 'dateTime' } { name: 'EventLevel' - type: 'String' + type: 'string' } { name: 'EventCode' - type: 'Int' + type: 'int' } { name: 'Message' - type: 'String' + type: 'string' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableAdvanced_CL' @@ -528,7 +530,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = "value": [ { "name": "Query", - "resourceId": "" + "storageAccountIds": [ + "" + ] } ] }, @@ -597,11 +601,11 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = "columns": [ { "name": "TimeGenerated", - "type": "DateTime" + "type": "dateTime" }, { "name": "RawData", - "type": "String" + "type": "string" } ], "name": "CustomTableBasic_CL" @@ -631,27 +635,27 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = "columns": [ { "name": "TimeGenerated", - "type": "DateTime" + "type": "dateTime" }, { "name": "EventTime", - "type": "DateTime" + "type": "dateTime" }, { "name": "EventLevel", - "type": "String" + "type": "string" }, { "name": "EventCode", - "type": "Int" + "type": "int" }, { "name": "Message", - "type": "String" + "type": "string" }, { "name": "RawData", - "type": "String" + "type": "string" } ], "name": "CustomTableAdvanced_CL" @@ -843,7 +847,9 @@ param linkedServices = [ param linkedStorageAccounts = [ { name: 'Query' - resourceId: '' + storageAccountIds: [ + '' + ] } ] param location = '' @@ -898,11 +904,11 @@ param tables = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableBasic_CL' @@ -932,27 +938,27 @@ param tables = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'EventTime' - type: 'DateTime' + type: 'dateTime' } { name: 'EventLevel' - type: 'String' + type: 'string' } { name: 'EventCode' - type: 'Int' + type: 'int' } { name: 'Message' - type: 'String' + type: 'string' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableAdvanced_CL' @@ -1187,7 +1193,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = linkedStorageAccounts: [ { name: 'Query' - resourceId: '' + storageAccountIds: [ + '' + ] } ] location: '' @@ -1274,11 +1282,11 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableBasic_CL' @@ -1308,27 +1316,27 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'EventTime' - type: 'DateTime' + type: 'dateTime' } { name: 'EventLevel' - type: 'String' + type: 'string' } { name: 'EventCode' - type: 'Int' + type: 'int' } { name: 'Message' - type: 'String' + type: 'string' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableAdvanced_CL' @@ -1510,7 +1518,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = "value": [ { "name": "Query", - "resourceId": "" + "storageAccountIds": [ + "" + ] } ] }, @@ -1617,11 +1627,11 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = "columns": [ { "name": "TimeGenerated", - "type": "DateTime" + "type": "dateTime" }, { "name": "RawData", - "type": "String" + "type": "string" } ], "name": "CustomTableBasic_CL" @@ -1651,27 +1661,27 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = "columns": [ { "name": "TimeGenerated", - "type": "DateTime" + "type": "dateTime" }, { "name": "EventTime", - "type": "DateTime" + "type": "dateTime" }, { "name": "EventLevel", - "type": "String" + "type": "string" }, { "name": "EventCode", - "type": "Int" + "type": "int" }, { "name": "Message", - "type": "String" + "type": "string" }, { "name": "RawData", - "type": "String" + "type": "string" } ], "name": "CustomTableAdvanced_CL" @@ -1843,7 +1853,9 @@ param linkedServices = [ param linkedStorageAccounts = [ { name: 'Query' - resourceId: '' + storageAccountIds: [ + '' + ] } ] param location = '' @@ -1930,11 +1942,11 @@ param tables = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableBasic_CL' @@ -1964,27 +1976,27 @@ param tables = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'EventTime' - type: 'DateTime' + type: 'dateTime' } { name: 'EventLevel' - type: 'String' + type: 'string' } { name: 'EventCode' - type: 'Int' + type: 'int' } { name: 'Message' - type: 'String' + type: 'string' } { name: 'RawData' - type: 'String' + type: 'string' } ] name: 'CustomTableAdvanced_CL' @@ -2134,7 +2146,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = linkedStorageAccounts: [ { name: 'Query' - resourceId: '' + storageAccountIds: [ + '' + ] } ] location: '' @@ -2308,7 +2322,9 @@ module workspace 'br/public:avm/res/operational-insights/workspace:' = "value": [ { "name": "Query", - "resourceId": "" + "storageAccountIds": [ + "" + ] } ] }, @@ -2482,7 +2498,9 @@ param linkedServices = [ param linkedStorageAccounts = [ { name: 'Query' - resourceId: '' + storageAccountIds: [ + '' + ] } ] param location = '' @@ -2568,7 +2586,27 @@ List of Storage Accounts to be linked. Required if 'forceCmkForQuery' is set to - Required: No - Type: array -- Default: `[]` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`name`](#parameter-linkedstorageaccountsname) | string | Name of the link. | +| [`storageAccountIds`](#parameter-linkedstorageaccountsstorageaccountids) | array | Linked storage accounts resources Ids. | + +### Parameter: `linkedStorageAccounts.name` + +Name of the link. + +- Required: Yes +- Type: string + +### Parameter: `linkedStorageAccounts.storageAccountIds` + +Linked storage accounts resources Ids. + +- Required: Yes +- Type: array ### Parameter: `dailyQuotaGb` @@ -2584,7 +2622,87 @@ LAW data export instances to be deployed. - Required: No - Type: array -- Default: `[]` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`name`](#parameter-dataexportsname) | string | Name of the data export. | +| [`tableNames`](#parameter-dataexportstablenames) | array | The list of table names to export. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`destination`](#parameter-dataexportsdestination) | object | The destination of the data export. | +| [`enable`](#parameter-dataexportsenable) | bool | Enable or disable the data export. | + +### Parameter: `dataExports.name` + +Name of the data export. + +- Required: Yes +- Type: string + +### Parameter: `dataExports.tableNames` + +The list of table names to export. + +- Required: Yes +- Type: array + +### Parameter: `dataExports.destination` + +The destination of the data export. + +- Required: No +- Type: object + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`resourceId`](#parameter-dataexportsdestinationresourceid) | string | The destination resource ID. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`metaData`](#parameter-dataexportsdestinationmetadata) | object | The destination metadata. | + +### Parameter: `dataExports.destination.resourceId` + +The destination resource ID. + +- Required: Yes +- Type: string + +### Parameter: `dataExports.destination.metaData` + +The destination metadata. + +- Required: No +- Type: object + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`eventHubName`](#parameter-dataexportsdestinationmetadataeventhubname) | string | Allows to define an Event Hub name. Not applicable when destination is Storage Account. | + +### Parameter: `dataExports.destination.metaData.eventHubName` + +Allows to define an Event Hub name. Not applicable when destination is Storage Account. + +- Required: No +- Type: string + +### Parameter: `dataExports.enable` + +Enable or disable the data export. + +- Required: No +- Type: bool ### Parameter: `dataRetention` @@ -2600,7 +2718,128 @@ LAW data sources to configure. - Required: No - Type: array -- Default: `[]` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`kind`](#parameter-datasourceskind) | string | The kind of data source. | +| [`name`](#parameter-datasourcesname) | string | Name of the data source. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`counterName`](#parameter-datasourcescountername) | string | Counter name to configure when kind is WindowsPerformanceCounter. | +| [`eventLogName`](#parameter-datasourceseventlogname) | string | The name of the event log to configure when kind is WindowsEvent. | +| [`eventTypes`](#parameter-datasourceseventtypes) | array | The event types to configure when kind is WindowsEvent. | +| [`instanceName`](#parameter-datasourcesinstancename) | string | Name of the instance to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. | +| [`intervalSeconds`](#parameter-datasourcesintervalseconds) | int | Interval in seconds to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. | +| [`linkedResourceId`](#parameter-datasourceslinkedresourceid) | string | The resource id of the resource that will be linked to the workspace. | +| [`objectName`](#parameter-datasourcesobjectname) | string | Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. | +| [`performanceCounters`](#parameter-datasourcesperformancecounters) | array | List of counters to configure when the kind is LinuxPerformanceObject. | +| [`state`](#parameter-datasourcesstate) | string | State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerformanceCollection. | +| [`syslogName`](#parameter-datasourcessyslogname) | string | System log to configure when kind is LinuxSyslog. | +| [`syslogSeverities`](#parameter-datasourcessyslogseverities) | array | Severities to configure when kind is LinuxSyslog. | +| [`tags`](#parameter-datasourcestags) | object | Tags to configure in the resource. | + +### Parameter: `dataSources.kind` + +The kind of data source. + +- Required: Yes +- Type: string + +### Parameter: `dataSources.name` + +Name of the data source. + +- Required: Yes +- Type: string + +### Parameter: `dataSources.counterName` + +Counter name to configure when kind is WindowsPerformanceCounter. + +- Required: No +- Type: string + +### Parameter: `dataSources.eventLogName` + +The name of the event log to configure when kind is WindowsEvent. + +- Required: No +- Type: string + +### Parameter: `dataSources.eventTypes` + +The event types to configure when kind is WindowsEvent. + +- Required: No +- Type: array + +### Parameter: `dataSources.instanceName` + +Name of the instance to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. + +- Required: No +- Type: string + +### Parameter: `dataSources.intervalSeconds` + +Interval in seconds to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. + +- Required: No +- Type: int + +### Parameter: `dataSources.linkedResourceId` + +The resource id of the resource that will be linked to the workspace. + +- Required: No +- Type: string + +### Parameter: `dataSources.objectName` + +Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. + +- Required: No +- Type: string + +### Parameter: `dataSources.performanceCounters` + +List of counters to configure when the kind is LinuxPerformanceObject. + +- Required: No +- Type: array + +### Parameter: `dataSources.state` + +State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerformanceCollection. + +- Required: No +- Type: string + +### Parameter: `dataSources.syslogName` + +System log to configure when kind is LinuxSyslog. + +- Required: No +- Type: string + +### Parameter: `dataSources.syslogSeverities` + +Severities to configure when kind is LinuxSyslog. + +- Required: No +- Type: array + +### Parameter: `dataSources.tags` + +Tags to configure in the resource. + +- Required: No +- Type: object ### Parameter: `diagnosticSettings` @@ -2840,7 +3079,40 @@ List of services to be linked. - Required: No - Type: array -- Default: `[]` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`name`](#parameter-linkedservicesname) | string | Name of the linked service. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`resourceId`](#parameter-linkedservicesresourceid) | string | The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access. | +| [`writeAccessResourceId`](#parameter-linkedserviceswriteaccessresourceid) | string | The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access. | + +### Parameter: `linkedServices.name` + +Name of the linked service. + +- Required: Yes +- Type: string + +### Parameter: `linkedServices.resourceId` + +The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access. + +- Required: No +- Type: string + +### Parameter: `linkedServices.writeAccessResourceId` + +The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access. + +- Required: No +- Type: string ### Parameter: `location` @@ -3067,7 +3339,88 @@ Kusto Query Language searches to save. - Required: No - Type: array -- Default: `[]` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`category`](#parameter-savedsearchescategory) | string | The category of the saved search. This helps the user to find a saved search faster. | +| [`displayName`](#parameter-savedsearchesdisplayname) | string | Display name for the search. | +| [`name`](#parameter-savedsearchesname) | string | Name of the saved search. | +| [`query`](#parameter-savedsearchesquery) | string | The query expression for the saved search. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`etag`](#parameter-savedsearchesetag) | string | The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag. | +| [`functionAlias`](#parameter-savedsearchesfunctionalias) | string | The function alias if query serves as a function. | +| [`functionParameters`](#parameter-savedsearchesfunctionparameters) | 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`](#parameter-savedsearchestags) | array | The tags attached to the saved search. | +| [`version`](#parameter-savedsearchesversion) | int | The version number of the query language. The current version is 2 and is the default. | + +### Parameter: `savedSearches.category` + +The category of the saved search. This helps the user to find a saved search faster. + +- Required: Yes +- Type: string + +### Parameter: `savedSearches.displayName` + +Display name for the search. + +- Required: Yes +- Type: string + +### Parameter: `savedSearches.name` + +Name of the saved search. + +- Required: Yes +- Type: string + +### Parameter: `savedSearches.query` + +The query expression for the saved search. + +- Required: Yes +- Type: string + +### Parameter: `savedSearches.etag` + +The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag. + +- Required: No +- Type: string + +### Parameter: `savedSearches.functionAlias` + +The function alias if query serves as a function. + +- Required: No +- Type: string + +### Parameter: `savedSearches.functionParameters` + +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. + +- Required: No +- Type: string + +### Parameter: `savedSearches.tags` + +The tags attached to the saved search. + +- Required: No +- Type: array + +### Parameter: `savedSearches.version` + +The version number of the query language. The current version is 2 and is the default. + +- Required: No +- Type: int ### Parameter: `skuCapacityReservationLevel` @@ -3104,15 +3457,414 @@ List of storage accounts to be read by the workspace. - Required: No - Type: array -- Default: `[]` -### Parameter: `tables` +**Required parameters** -LAW custom tables to be deployed. +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`storageAccountResourceId`](#parameter-storageinsightsconfigsstorageaccountresourceid) | string | Resource ID of the storage account to be linked. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`containers`](#parameter-storageinsightsconfigscontainers) | array | The names of the blob containers that the workspace should read. | +| [`tables`](#parameter-storageinsightsconfigstables) | array | List of tables to be read by the workspace. | + +### Parameter: `storageInsightsConfigs.storageAccountResourceId` + +Resource ID of the storage account to be linked. + +- Required: Yes +- Type: string + +### Parameter: `storageInsightsConfigs.containers` + +The names of the blob containers that the workspace should read. + +- Required: No +- Type: array + +### Parameter: `storageInsightsConfigs.tables` + +List of tables to be read by the workspace. + +- Required: No +- Type: array + +### Parameter: `tables` + +LAW custom tables to be deployed. + +- Required: No +- Type: array + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`name`](#parameter-tablesname) | string | The name of the table. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`plan`](#parameter-tablesplan) | string | The plan for the table. | +| [`restoredLogs`](#parameter-tablesrestoredlogs) | object | The restored logs for the table. | +| [`retentionInDays`](#parameter-tablesretentionindays) | int | The retention in days for the table. | +| [`roleAssignments`](#parameter-tablesroleassignments) | array | The role assignments for the table. | +| [`schema`](#parameter-tablesschema) | object | The schema for the table. | +| [`searchResults`](#parameter-tablessearchresults) | object | The search results for the table. | +| [`totalRetentionInDays`](#parameter-tablestotalretentionindays) | int | The total retention in days for the table. | + +### Parameter: `tables.name` + +The name of the table. + +- Required: Yes +- Type: string + +### Parameter: `tables.plan` + +The plan for the table. + +- Required: No +- Type: string + +### Parameter: `tables.restoredLogs` + +The restored logs for the table. + +- Required: No +- Type: object + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`endRestoreTime`](#parameter-tablesrestoredlogsendrestoretime) | string | The timestamp to end the restore by (UTC). | +| [`sourceTable`](#parameter-tablesrestoredlogssourcetable) | string | The table to restore data from. | +| [`startRestoreTime`](#parameter-tablesrestoredlogsstartrestoretime) | string | The timestamp to start the restore from (UTC). | + +### Parameter: `tables.restoredLogs.endRestoreTime` + +The timestamp to end the restore by (UTC). + +- Required: No +- Type: string + +### Parameter: `tables.restoredLogs.sourceTable` + +The table to restore data from. + +- Required: No +- Type: string + +### Parameter: `tables.restoredLogs.startRestoreTime` + +The timestamp to start the restore from (UTC). + +- Required: No +- Type: string + +### Parameter: `tables.retentionInDays` + +The retention in days for the table. + +- Required: No +- Type: int + +### Parameter: `tables.roleAssignments` + +The role assignments for the table. + +- Required: No +- Type: array +- Roles configurable by name: + - `'Contributor'` + - `'Log Analytics Contributor'` + - `'Log Analytics Reader'` + - `'Monitoring Contributor'` + - `'Monitoring Reader'` + - `'Owner'` + - `'Reader'` + - `'Role Based Access Control Administrator'` + - `'User Access Administrator'` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`principalId`](#parameter-tablesroleassignmentsprincipalid) | string | The principal ID of the principal (user/group/identity) to assign the role to. | +| [`roleDefinitionIdOrName`](#parameter-tablesroleassignmentsroledefinitionidorname) | string | The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`condition`](#parameter-tablesroleassignmentscondition) | string | The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container". | +| [`conditionVersion`](#parameter-tablesroleassignmentsconditionversion) | string | Version of the condition. | +| [`delegatedManagedIdentityResourceId`](#parameter-tablesroleassignmentsdelegatedmanagedidentityresourceid) | string | The Resource Id of the delegated managed identity resource. | +| [`description`](#parameter-tablesroleassignmentsdescription) | string | The description of the role assignment. | +| [`name`](#parameter-tablesroleassignmentsname) | string | The name (as GUID) of the role assignment. If not provided, a GUID will be generated. | +| [`principalType`](#parameter-tablesroleassignmentsprincipaltype) | string | The principal type of the assigned principal ID. | + +### Parameter: `tables.roleAssignments.principalId` + +The principal ID of the principal (user/group/identity) to assign the role to. + +- Required: Yes +- Type: string + +### Parameter: `tables.roleAssignments.roleDefinitionIdOrName` + +The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. + +- Required: Yes +- Type: string + +### Parameter: `tables.roleAssignments.condition` + +The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container". + +- Required: No +- Type: string + +### Parameter: `tables.roleAssignments.conditionVersion` + +Version of the condition. + +- Required: No +- Type: string +- Allowed: + ```Bicep + [ + '2.0' + ] + ``` + +### Parameter: `tables.roleAssignments.delegatedManagedIdentityResourceId` + +The Resource Id of the delegated managed identity resource. + +- Required: No +- Type: string + +### Parameter: `tables.roleAssignments.description` + +The description of the role assignment. + +- Required: No +- Type: string + +### Parameter: `tables.roleAssignments.name` + +The name (as GUID) of the role assignment. If not provided, a GUID will be generated. + +- Required: No +- Type: string + +### Parameter: `tables.roleAssignments.principalType` + +The principal type of the assigned principal ID. + +- Required: No +- Type: string +- Allowed: + ```Bicep + [ + 'Device' + 'ForeignGroup' + 'Group' + 'ServicePrincipal' + 'User' + ] + ``` + +### Parameter: `tables.schema` + +The schema for the table. - Required: No +- Type: object + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`columns`](#parameter-tablesschemacolumns) | array | A list of table custom columns. | +| [`name`](#parameter-tablesschemaname) | string | The table name. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`description`](#parameter-tablesschemadescription) | string | The table description. | +| [`displayName`](#parameter-tablesschemadisplayname) | string | The table display name. | + +### Parameter: `tables.schema.columns` + +A list of table custom columns. + +- Required: Yes - Type: array -- Default: `[]` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`name`](#parameter-tablesschemacolumnsname) | string | The column name. | +| [`type`](#parameter-tablesschemacolumnstype) | string | The column type. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`dataTypeHint`](#parameter-tablesschemacolumnsdatatypehint) | string | The column data type logical hint. | +| [`description`](#parameter-tablesschemacolumnsdescription) | string | The column description. | +| [`displayName`](#parameter-tablesschemacolumnsdisplayname) | string | Column display name. | + +### Parameter: `tables.schema.columns.name` + +The column name. + +- Required: Yes +- Type: string + +### Parameter: `tables.schema.columns.type` + +The column type. + +- Required: Yes +- Type: string +- Allowed: + ```Bicep + [ + 'boolean' + 'dateTime' + 'dynamic' + 'guid' + 'int' + 'long' + 'real' + 'string' + ] + ``` + +### Parameter: `tables.schema.columns.dataTypeHint` + +The column data type logical hint. + +- Required: No +- Type: string +- Allowed: + ```Bicep + [ + 'armPath' + 'guid' + 'ip' + 'uri' + ] + ``` + +### Parameter: `tables.schema.columns.description` + +The column description. + +- Required: No +- Type: string + +### Parameter: `tables.schema.columns.displayName` + +Column display name. + +- Required: No +- Type: string + +### Parameter: `tables.schema.name` + +The table name. + +- Required: Yes +- Type: string + +### Parameter: `tables.schema.description` + +The table description. + +- Required: No +- Type: string + +### Parameter: `tables.schema.displayName` + +The table display name. + +- Required: No +- Type: string + +### Parameter: `tables.searchResults` + +The search results for the table. + +- Required: No +- Type: object + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`query`](#parameter-tablessearchresultsquery) | string | The search job query. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`description`](#parameter-tablessearchresultsdescription) | string | The search description. | +| [`endSearchTime`](#parameter-tablessearchresultsendsearchtime) | string | The timestamp to end the search by (UTC). | +| [`limit`](#parameter-tablessearchresultslimit) | int | Limit the search job to return up to specified number of rows. | +| [`startSearchTime`](#parameter-tablessearchresultsstartsearchtime) | string | The timestamp to start the search from (UTC). | + +### Parameter: `tables.searchResults.query` + +The search job query. + +- Required: Yes +- Type: string + +### Parameter: `tables.searchResults.description` + +The search description. + +- Required: No +- Type: string + +### Parameter: `tables.searchResults.endSearchTime` + +The timestamp to end the search by (UTC). + +- Required: No +- Type: string + +### Parameter: `tables.searchResults.limit` + +Limit the search job to return up to specified number of rows. + +- Required: No +- Type: int + +### Parameter: `tables.searchResults.startSearchTime` + +The timestamp to start the search from (UTC). + +- Required: No +- Type: string + +### Parameter: `tables.totalRetentionInDays` + +The total retention in days for the table. + +- Required: No +- Type: int ### Parameter: `tags` diff --git a/avm/res/operational-insights/workspace/data-export/README.md b/avm/res/operational-insights/workspace/data-export/README.md index dfaf353e3c..c4bbb39e28 100644 --- a/avm/res/operational-insights/workspace/data-export/README.md +++ b/avm/res/operational-insights/workspace/data-export/README.md @@ -21,6 +21,7 @@ This module deploys a Log Analytics Workspace Data Export. | Parameter | Type | Description | | :-- | :-- | :-- | | [`name`](#parameter-name) | string | The data export rule name. | +| [`tableNames`](#parameter-tablenames) | array | An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']. | **Conditional parameters** @@ -34,7 +35,6 @@ This module deploys a Log Analytics Workspace Data Export. | :-- | :-- | :-- | | [`destination`](#parameter-destination) | object | Destination properties. | | [`enable`](#parameter-enable) | bool | Active when enabled. | -| [`tableNames`](#parameter-tablenames) | array | An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']. | ### Parameter: `name` @@ -43,6 +43,13 @@ The data export rule name. - Required: Yes - Type: string +### Parameter: `tableNames` + +An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']. + +- Required: Yes +- Type: array + ### Parameter: `workspaceName` The name of the parent workspaces. Required if the template is used in a standalone deployment. @@ -56,23 +63,53 @@ Destination properties. - Required: No - Type: object -- Default: `{}` -### Parameter: `enable` +**Required parameters** -Active when enabled. +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`resourceId`](#parameter-destinationresourceid) | string | The destination resource ID. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`metaData`](#parameter-destinationmetadata) | object | The destination metadata. | + +### Parameter: `destination.resourceId` + +The destination resource ID. + +- Required: Yes +- Type: string + +### Parameter: `destination.metaData` + +The destination metadata. - Required: No -- Type: bool -- Default: `False` +- Type: object -### Parameter: `tableNames` +**Optional parameters** -An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']. +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`eventHubName`](#parameter-destinationmetadataeventhubname) | string | Allows to define an Event Hub name. Not applicable when destination is Storage Account. | + +### Parameter: `destination.metaData.eventHubName` + +Allows to define an Event Hub name. Not applicable when destination is Storage Account. - Required: No -- Type: array -- Default: `[]` +- Type: string + +### Parameter: `enable` + +Active when enabled. + +- Required: No +- Type: bool +- Default: `False` ## Outputs diff --git a/avm/res/operational-insights/workspace/data-export/main.bicep b/avm/res/operational-insights/workspace/data-export/main.bicep index f0d631fd74..16e76d5f78 100644 --- a/avm/res/operational-insights/workspace/data-export/main.bicep +++ b/avm/res/operational-insights/workspace/data-export/main.bicep @@ -15,13 +15,14 @@ param name string param workspaceName string @description('Optional. Destination properties.') -param destination object = {} +param destination destinationType? @description('Optional. Active when enabled.') param enable bool = false -@description('Optional. An array of tables to export, for example: [\'Heartbeat\', \'SecurityEvent\'].') -param tableNames array = [] +@minLength(1) +@description('Required. An array of tables to export, for example: [\'Heartbeat\', \'SecurityEvent\'].') +param tableNames string[] // =============== // // Deployments // @@ -53,3 +54,19 @@ output resourceId string = dataExport.id @description('The name of the resource group the data export was created in.') output resourceGroupName string = resourceGroup().name + +// =============== // +// Definitions // +// =============== // + +@export() +@description('The data export destination properties.') +type destinationType = { + @description('Required. The destination resource ID.') + resourceId: string + @description('Optional. The destination metadata.') + metaData: { + @description('Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account.') + eventHubName: string? + }? +} diff --git a/avm/res/operational-insights/workspace/data-export/main.json b/avm/res/operational-insights/workspace/data-export/main.json index 50543665cd..e7827b942f 100644 --- a/avm/res/operational-insights/workspace/data-export/main.json +++ b/avm/res/operational-insights/workspace/data-export/main.json @@ -1,16 +1,50 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "6471227851268955186" + "version": "0.31.92.45157", + "templateHash": "8392467222383128491" }, "name": "Log Analytics Workspace Data Exports", "description": "This module deploys a Log Analytics Workspace Data Export.", "owner": "Azure/module-maintainers" }, + "definitions": { + "destinationType": { + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "metadata": { + "description": "Required. The destination resource ID." + } + }, + "metaData": { + "type": "object", + "properties": { + "eventHubName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account." + } + } + }, + "nullable": true, + "metadata": { + "description": "Optional. The destination metadata." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The data export destination properties." + } + } + }, "parameters": { "name": { "type": "string", @@ -27,8 +61,8 @@ } }, "destination": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/destinationType", + "nullable": true, "metadata": { "description": "Optional. Destination properties." } @@ -42,14 +76,23 @@ }, "tableNames": { "type": "array", - "defaultValue": [], + "items": { + "type": "string" + }, + "minLength": 1, "metadata": { - "description": "Optional. An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']." + "description": "Required. An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']." } } }, - "resources": [ - { + "resources": { + "workspace": { + "existing": true, + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2022-10-01", + "name": "[parameters('workspaceName')]" + }, + "dataExport": { "type": "Microsoft.OperationalInsights/workspaces/dataExports", "apiVersion": "2020-08-01", "name": "[format('{0}/{1}', parameters('workspaceName'), parameters('name'))]", @@ -57,9 +100,12 @@ "destination": "[parameters('destination')]", "enable": "[parameters('enable')]", "tableNames": "[parameters('tableNames')]" - } + }, + "dependsOn": [ + "workspace" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/avm/res/operational-insights/workspace/data-source/README.md b/avm/res/operational-insights/workspace/data-source/README.md index cc2fa72ccb..752f4583a9 100644 --- a/avm/res/operational-insights/workspace/data-source/README.md +++ b/avm/res/operational-insights/workspace/data-source/README.md @@ -20,7 +20,7 @@ This module deploys a Log Analytics Workspace Data Source. | Parameter | Type | Description | | :-- | :-- | :-- | -| [`name`](#parameter-name) | string | Name of the solution. | +| [`name`](#parameter-name) | string | Name of the data source. | **Conditional parameters** @@ -37,7 +37,7 @@ This module deploys a Log Analytics Workspace Data Source. | [`eventTypes`](#parameter-eventtypes) | array | Windows event types to configure when kind is WindowsEvent. | | [`instanceName`](#parameter-instancename) | string | Name of the instance to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. | | [`intervalSeconds`](#parameter-intervalseconds) | int | Interval in seconds to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. | -| [`kind`](#parameter-kind) | string | The kind of the DataSource. | +| [`kind`](#parameter-kind) | string | The kind of the data source. | | [`linkedResourceId`](#parameter-linkedresourceid) | string | Resource ID of the resource to be linked. | | [`objectName`](#parameter-objectname) | string | Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject. | | [`performanceCounters`](#parameter-performancecounters) | array | List of counters to configure when the kind is LinuxPerformanceObject. | @@ -48,7 +48,7 @@ This module deploys a Log Analytics Workspace Data Source. ### Parameter: `name` -Name of the solution. +Name of the data source. - Required: Yes - Type: string @@ -66,7 +66,6 @@ Counter name to configure when kind is WindowsPerformanceCounter. - Required: No - Type: string -- Default: `''` ### Parameter: `eventLogName` @@ -74,7 +73,6 @@ Windows event log name to configure when kind is WindowsEvent. - Required: No - Type: string -- Default: `''` ### Parameter: `eventTypes` @@ -102,7 +100,7 @@ Interval in seconds to configure when kind is WindowsPerformanceCounter or Linux ### Parameter: `kind` -The kind of the DataSource. +The kind of the data source. - Required: No - Type: string @@ -127,7 +125,6 @@ Resource ID of the resource to be linked. - Required: No - Type: string -- Default: `''` ### Parameter: `objectName` @@ -135,7 +132,6 @@ Name of the object to configure when kind is WindowsPerformanceCounter or LinuxP - Required: No - Type: string -- Default: `''` ### Parameter: `performanceCounters` @@ -151,7 +147,6 @@ State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerform - Required: No - Type: string -- Default: `''` ### Parameter: `syslogName` @@ -159,7 +154,6 @@ System log to configure when kind is LinuxSyslog. - Required: No - Type: string -- Default: `''` ### Parameter: `syslogSeverities` diff --git a/avm/res/operational-insights/workspace/data-source/main.bicep b/avm/res/operational-insights/workspace/data-source/main.bicep index e0e468df37..9b74a191a6 100644 --- a/avm/res/operational-insights/workspace/data-source/main.bicep +++ b/avm/res/operational-insights/workspace/data-source/main.bicep @@ -5,10 +5,10 @@ metadata owner = 'Azure/module-maintainers' @description('Conditional. The name of the parent Log Analytics workspace. Required if the template is used in a standalone deployment.') param logAnalyticsWorkspaceName string -@description('Required. Name of the solution.') +@description('Required. Name of the data source.') param name string -@description('Optional. The kind of the DataSource.') +@description('Optional. The kind of the data source.') @allowed([ 'AzureActivityLog' 'WindowsEvent' @@ -25,16 +25,16 @@ param kind string = 'AzureActivityLog' param tags object? @description('Optional. Resource ID of the resource to be linked.') -param linkedResourceId string = '' +param linkedResourceId string? @description('Optional. Windows event log name to configure when kind is WindowsEvent.') -param eventLogName string = '' +param eventLogName string? @description('Optional. Windows event types to configure when kind is WindowsEvent.') param eventTypes array = [] @description('Optional. Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject.') -param objectName string = '' +param objectName string? @description('Optional. Name of the instance to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject.') param instanceName string = '*' @@ -46,13 +46,13 @@ param intervalSeconds int = 60 param performanceCounters array = [] @description('Optional. Counter name to configure when kind is WindowsPerformanceCounter.') -param counterName string = '' +param counterName string? @description('Optional. State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerformanceCollection.') -param state string = '' +param state string? @description('Optional. System log to configure when kind is LinuxSyslog.') -param syslogName string = '' +param syslogName string? @description('Optional. Severities to configure when kind is LinuxSyslog.') param syslogSeverities array = [] diff --git a/avm/res/operational-insights/workspace/data-source/main.json b/avm/res/operational-insights/workspace/data-source/main.json index 632303522e..6e154c67ac 100644 --- a/avm/res/operational-insights/workspace/data-source/main.json +++ b/avm/res/operational-insights/workspace/data-source/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "8463454444688288974" + "version": "0.31.92.45157", + "templateHash": "3019400626196043317" }, "name": "Log Analytics Workspace Datasources", "description": "This module deploys a Log Analytics Workspace Data Source.", @@ -22,7 +22,7 @@ "name": { "type": "string", "metadata": { - "description": "Required. Name of the solution." + "description": "Required. Name of the data source." } }, "kind": { @@ -39,7 +39,7 @@ "LinuxPerformanceCollection" ], "metadata": { - "description": "Optional. The kind of the DataSource." + "description": "Optional. The kind of the data source." } }, "tags": { @@ -51,14 +51,14 @@ }, "linkedResourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Resource ID of the resource to be linked." } }, "eventLogName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Windows event log name to configure when kind is WindowsEvent." } @@ -72,7 +72,7 @@ }, "objectName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject." } @@ -100,21 +100,21 @@ }, "counterName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Counter name to configure when kind is WindowsPerformanceCounter." } }, "state": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerformanceCollection." } }, "syslogName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. System log to configure when kind is LinuxSyslog." } @@ -152,7 +152,10 @@ "syslogName": "[if(and(not(empty(parameters('kind'))), equals(parameters('kind'), 'LinuxSyslog')), parameters('syslogName'), null())]", "syslogSeverities": "[if(and(not(empty(parameters('kind'))), or(equals(parameters('kind'), 'LinuxSyslog'), equals(parameters('kind'), 'LinuxPerformanceObject'))), parameters('syslogSeverities'), null())]", "performanceCounters": "[if(and(not(empty(parameters('kind'))), equals(parameters('kind'), 'LinuxPerformanceObject')), parameters('performanceCounters'), null())]" - } + }, + "dependsOn": [ + "workspace" + ] } }, "outputs": { diff --git a/avm/res/operational-insights/workspace/linked-service/README.md b/avm/res/operational-insights/workspace/linked-service/README.md index aa79236364..bca53b7a24 100644 --- a/avm/res/operational-insights/workspace/linked-service/README.md +++ b/avm/res/operational-insights/workspace/linked-service/README.md @@ -56,7 +56,6 @@ The resource ID of the resource that will be linked to the workspace. This shoul - Required: No - Type: string -- Default: `''` ### Parameter: `tags` @@ -71,7 +70,6 @@ The resource ID of the resource that will be linked to the workspace. This shoul - Required: No - Type: string -- Default: `''` ## Outputs diff --git a/avm/res/operational-insights/workspace/linked-service/main.bicep b/avm/res/operational-insights/workspace/linked-service/main.bicep index 1278279992..8a35e22e57 100644 --- a/avm/res/operational-insights/workspace/linked-service/main.bicep +++ b/avm/res/operational-insights/workspace/linked-service/main.bicep @@ -9,10 +9,10 @@ param logAnalyticsWorkspaceName string param name string @description('Optional. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access.') -param resourceId string = '' +param resourceId string? @description('Optional. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require write access.') -param writeAccessResourceId string = '' +param writeAccessResourceId string? @description('Optional. Tags to configure in the resource.') param tags object? @@ -27,7 +27,7 @@ resource linkedService 'Microsoft.OperationalInsights/workspaces/linkedServices@ tags: tags properties: { resourceId: resourceId - writeAccessResourceId: empty(writeAccessResourceId) ? null : writeAccessResourceId + writeAccessResourceId: writeAccessResourceId } } diff --git a/avm/res/operational-insights/workspace/linked-service/main.json b/avm/res/operational-insights/workspace/linked-service/main.json index 9486a71e8c..b4305d5972 100644 --- a/avm/res/operational-insights/workspace/linked-service/main.json +++ b/avm/res/operational-insights/workspace/linked-service/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "13253888384545811424" + "version": "0.31.92.45157", + "templateHash": "815879010072595898" }, "name": "Log Analytics Workspace Linked Services", "description": "This module deploys a Log Analytics Workspace Linked Service.", @@ -27,14 +27,14 @@ }, "resourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access." } }, "writeAccessResourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require write access." } @@ -61,8 +61,11 @@ "tags": "[parameters('tags')]", "properties": { "resourceId": "[parameters('resourceId')]", - "writeAccessResourceId": "[if(empty(parameters('writeAccessResourceId')), null(), parameters('writeAccessResourceId'))]" - } + "writeAccessResourceId": "[parameters('writeAccessResourceId')]" + }, + "dependsOn": [ + "workspace" + ] } }, "outputs": { diff --git a/avm/res/operational-insights/workspace/linked-storage-account/README.md b/avm/res/operational-insights/workspace/linked-storage-account/README.md index 40e1029831..a4604fdeea 100644 --- a/avm/res/operational-insights/workspace/linked-storage-account/README.md +++ b/avm/res/operational-insights/workspace/linked-storage-account/README.md @@ -21,7 +21,7 @@ This module deploys a Log Analytics Workspace Linked Storage Account. | Parameter | Type | Description | | :-- | :-- | :-- | | [`name`](#parameter-name) | string | Name of the link. | -| [`resourceId`](#parameter-resourceid) | string | The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access. | +| [`storageAccountIds`](#parameter-storageaccountids) | array | Linked storage accounts resources Ids. | **Conditional parameters** @@ -45,12 +45,12 @@ Name of the link. ] ``` -### Parameter: `resourceId` +### Parameter: `storageAccountIds` -The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access. +Linked storage accounts resources Ids. - Required: Yes -- Type: string +- Type: array ### Parameter: `logAnalyticsWorkspaceName` diff --git a/avm/res/operational-insights/workspace/linked-storage-account/main.bicep b/avm/res/operational-insights/workspace/linked-storage-account/main.bicep index 60ec0f85d8..4107bc9470 100644 --- a/avm/res/operational-insights/workspace/linked-storage-account/main.bicep +++ b/avm/res/operational-insights/workspace/linked-storage-account/main.bicep @@ -14,8 +14,9 @@ param logAnalyticsWorkspaceName string ]) param name string -@description('Required. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access.') -param resourceId string +@minLength(1) +@description('Required. Linked storage accounts resources Ids.') +param storageAccountIds string[] resource workspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' existing = { name: logAnalyticsWorkspaceName @@ -25,9 +26,7 @@ resource linkedStorageAccount 'Microsoft.OperationalInsights/workspaces/linkedSt name: name parent: workspace properties: { - storageAccountIds: [ - resourceId - ] + storageAccountIds: storageAccountIds } } diff --git a/avm/res/operational-insights/workspace/linked-storage-account/main.json b/avm/res/operational-insights/workspace/linked-storage-account/main.json index 01c473ad05..8e76c78f95 100644 --- a/avm/res/operational-insights/workspace/linked-storage-account/main.json +++ b/avm/res/operational-insights/workspace/linked-storage-account/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "14472959311832661205" + "version": "0.31.92.45157", + "templateHash": "15129623170213660788" }, "name": "Log Analytics Workspace Linked Storage Accounts", "description": "This module deploys a Log Analytics Workspace Linked Storage Account.", @@ -30,25 +31,36 @@ "description": "Required. Name of the link." } }, - "resourceId": { - "type": "string", + "storageAccountIds": { + "type": "array", + "items": { + "type": "string" + }, + "minLength": 1, "metadata": { - "description": "Required. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access." + "description": "Required. Linked storage accounts resources Ids." } } }, - "resources": [ - { + "resources": { + "workspace": { + "existing": true, + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2022-10-01", + "name": "[parameters('logAnalyticsWorkspaceName')]" + }, + "linkedStorageAccount": { "type": "Microsoft.OperationalInsights/workspaces/linkedStorageAccounts", "apiVersion": "2020-08-01", "name": "[format('{0}/{1}', parameters('logAnalyticsWorkspaceName'), parameters('name'))]", "properties": { - "storageAccountIds": [ - "[parameters('resourceId')]" - ] - } + "storageAccountIds": "[parameters('storageAccountIds')]" + }, + "dependsOn": [ + "workspace" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/avm/res/operational-insights/workspace/main.bicep b/avm/res/operational-insights/workspace/main.bicep index 22cfc7ffd3..94542a2860 100644 --- a/avm/res/operational-insights/workspace/main.bicep +++ b/avm/res/operational-insights/workspace/main.bicep @@ -27,25 +27,25 @@ param skuName string = 'PerGB2018' param skuCapacityReservationLevel int = 100 @description('Optional. List of storage accounts to be read by the workspace.') -param storageInsightsConfigs array = [] +param storageInsightsConfigs storageInsightsConfigType[]? @description('Optional. List of services to be linked.') -param linkedServices array = [] +param linkedServices linkedServiceType[]? @description('Conditional. List of Storage Accounts to be linked. Required if \'forceCmkForQuery\' is set to \'true\' and \'savedSearches\' is not empty.') -param linkedStorageAccounts array = [] +param linkedStorageAccounts linkedStorageAccountType[]? @description('Optional. Kusto Query Language searches to save.') -param savedSearches array = [] +param savedSearches savedSearchType[]? @description('Optional. LAW data export instances to be deployed.') -param dataExports array = [] +param dataExports dataExportType[]? @description('Optional. LAW data sources to configure.') -param dataSources array = [] +param dataSources dataSourceType[]? @description('Optional. LAW custom tables to be deployed.') -param tables array = [] +param tables tableType[]? @description('Optional. List of gallerySolutions to be created in the log analytics workspace.') param gallerySolutions gallerySolutionType[]? @@ -242,7 +242,7 @@ resource logAnalyticsWorkspace_diagnosticSettings 'Microsoft.Insights/diagnostic ] module logAnalyticsWorkspace_storageInsightConfigs 'storage-insight-config/main.bicep' = [ - for (storageInsightsConfig, index) in storageInsightsConfigs: { + for (storageInsightsConfig, index) in storageInsightsConfigs ?? []: { name: '${uniqueString(deployment().name, location)}-LAW-StorageInsightsConfig-${index}' params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name @@ -254,7 +254,7 @@ module logAnalyticsWorkspace_storageInsightConfigs 'storage-insight-config/main. ] module logAnalyticsWorkspace_linkedServices 'linked-service/main.bicep' = [ - for (linkedService, index) in linkedServices: { + for (linkedService, index) in linkedServices ?? []: { name: '${uniqueString(deployment().name, location)}-LAW-LinkedService-${index}' params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name @@ -266,18 +266,18 @@ module logAnalyticsWorkspace_linkedServices 'linked-service/main.bicep' = [ ] module logAnalyticsWorkspace_linkedStorageAccounts 'linked-storage-account/main.bicep' = [ - for (linkedStorageAccount, index) in linkedStorageAccounts: { + for (linkedStorageAccount, index) in linkedStorageAccounts ?? []: { name: '${uniqueString(deployment().name, location)}-LAW-LinkedStorageAccount-${index}' params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name name: linkedStorageAccount.name - resourceId: linkedStorageAccount.resourceId + storageAccountIds: linkedStorageAccount.storageAccountIds } } ] module logAnalyticsWorkspace_savedSearches 'saved-search/main.bicep' = [ - for (savedSearch, index) in savedSearches: { + for (savedSearch, index) in savedSearches ?? []: { name: '${uniqueString(deployment().name, location)}-LAW-SavedSearch-${index}' params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name @@ -288,6 +288,7 @@ module logAnalyticsWorkspace_savedSearches 'saved-search/main.bicep' = [ query: savedSearch.query functionAlias: savedSearch.?functionAlias functionParameters: savedSearch.?functionParameters + tags: savedSearch.?tags version: savedSearch.?version } dependsOn: [ @@ -297,7 +298,7 @@ module logAnalyticsWorkspace_savedSearches 'saved-search/main.bicep' = [ ] module logAnalyticsWorkspace_dataExports 'data-export/main.bicep' = [ - for (dataExport, index) in dataExports: { + for (dataExport, index) in dataExports ?? []: { name: '${uniqueString(deployment().name, location)}-LAW-DataExport-${index}' params: { workspaceName: logAnalyticsWorkspace.name @@ -310,7 +311,7 @@ module logAnalyticsWorkspace_dataExports 'data-export/main.bicep' = [ ] module logAnalyticsWorkspace_dataSources 'data-source/main.bicep' = [ - for (dataSource, index) in dataSources: { + for (dataSource, index) in dataSources ?? []: { name: '${uniqueString(deployment().name, location)}-LAW-DataSource-${index}' params: { logAnalyticsWorkspaceName: logAnalyticsWorkspace.name @@ -327,12 +328,13 @@ module logAnalyticsWorkspace_dataSources 'data-source/main.bicep' = [ syslogName: dataSource.?syslogName syslogSeverities: dataSource.?syslogSeverities performanceCounters: dataSource.?performanceCounters + tags: dataSource.?tags } } ] module logAnalyticsWorkspace_tables 'table/main.bicep' = [ - for (table, index) in tables: { + for (table, index) in tables ?? []: { name: '${uniqueString(deployment().name, location)}-LAW-Table-${index}' params: { workspaceName: logAnalyticsWorkspace.name @@ -474,6 +476,7 @@ type diagnosticSettingType = { import { solutionPlanType } from 'br/public:avm/res/operations-management/solution:0.3.0' @export() +@description('Properties of the gallery solutions to be created in the log analytics workspace.') type gallerySolutionType = { @description('''Required. Name of the solution. For solutions authored by Microsoft, the name must be in the pattern: `SolutionType(WorkspaceName)`, for example: `AntiMalware(contoso-Logs)`. @@ -484,3 +487,165 @@ type gallerySolutionType = { @description('Required. Plan for solution object supported by the OperationsManagement resource provider.') plan: solutionPlanType } + +@export() +@description('Properties of the storage insights configuration.') +type storageInsightsConfigType = { + @description('Required. Resource ID of the storage account to be linked.') + storageAccountResourceId: string + + @description('Optional. The names of the blob containers that the workspace should read.') + containers: string[]? + + @description('Optional. List of tables to be read by the workspace.') + tables: string[]? +} + +@export() +@description('Properties of the linked service.') +type linkedServiceType = { + @description('Required. Name of the linked service.') + name: string + + @description('Optional. The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access.') + resourceId: string? + + @description('Optional. The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access.') + writeAccessResourceId: string? +} + +@export() +@description('Properties of the linked storage account.') +type linkedStorageAccountType = { + @description('Required. Name of the link.') + name: string + + @minLength(1) + @description('Required. Linked storage accounts resources Ids.') + storageAccountIds: string[] +} + +@export() +@description('Properties of the saved search.') +type savedSearchType = { + @description('Required. Name of the saved search.') + name: string + + @description('Optional. The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag.') + etag: string? + + @description('Required. The category of the saved search. This helps the user to find a saved search faster.') + category: string + + @description('Required. Display name for the search.') + displayName: string + + @description('Optional. The function alias if query serves as a function.') + 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.') + functionParameters: string? + + @description('Required. The query expression for the saved search.') + query: string + + @description('Optional. The tags attached to the saved search.') + tags: array? + + @description('Optional. The version number of the query language. The current version is 2 and is the default.') + version: int? +} + +import { destinationType } from 'data-export/main.bicep' + +@export() +@description('Properties of the data export.') +type dataExportType = { + @description('Required. Name of the data export.') + name: string + + @description('Optional. The destination of the data export.') + destination: destinationType? + + @description('Optional. Enable or disable the data export.') + enable: bool? + + @description('Required. The list of table names to export.') + tableNames: string[] +} + +@export() +@description('Properties of the data source.') +type dataSourceType = { + @description('Required. Name of the data source.') + name: string + + @description('Required. The kind of data source.') + kind: string + + @description('Optional. The resource id of the resource that will be linked to the workspace.') + linkedResourceId: string? + + @description('Optional. The name of the event log to configure when kind is WindowsEvent.') + eventLogName: string? + + @description('Optional. The event types to configure when kind is WindowsEvent.') + eventTypes: array? + + @description('Optional. Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject.') + objectName: string? + + @description('Optional. Name of the instance to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject.') + instanceName: string? + + @description('Optional. Interval in seconds to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject.') + intervalSeconds: int? + + @description('Optional. List of counters to configure when the kind is LinuxPerformanceObject.') + performanceCounters: array? + + @description('Optional. Counter name to configure when kind is WindowsPerformanceCounter.') + counterName: string? + + @description('Optional. State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerformanceCollection.') + state: string? + + @description('Optional. System log to configure when kind is LinuxSyslog.') + syslogName: string? + + @description('Optional. Severities to configure when kind is LinuxSyslog.') + syslogSeverities: array? + + @description('Optional. Tags to configure in the resource.') + tags: object? +} + +import { schemaType, restoredLogsType, searchResultsType } from 'table/main.bicep' + +@export() +@description('Properties of the custom table.') +type tableType = { + @description('Required. The name of the table.') + name: string + + @description('Optional. The plan for the table.') + plan: string? + + @description('Optional. The restored logs for the table.') + restoredLogs: restoredLogsType? + + @description('Optional. The schema for the table.') + schema: schemaType? + + @description('Optional. The search results for the table.') + searchResults: searchResultsType? + + @description('Optional. The retention in days for the table.') + retentionInDays: int? + + @description('Optional. The total retention in days for the table.') + totalRetentionInDays: int? + + @description('Optional. The role assignments for the table.') + roleAssignments: roleAssignmentType[]? +} diff --git a/avm/res/operational-insights/workspace/main.json b/avm/res/operational-insights/workspace/main.json index 5b7a4ae798..5af1767572 100644 --- a/avm/res/operational-insights/workspace/main.json +++ b/avm/res/operational-insights/workspace/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "13803826230764856157" + "version": "0.31.92.45157", + "templateHash": "4016402011070477200" }, "name": "Log Analytics Workspaces", "description": "This module deploys a Log Analytics Workspace.", @@ -153,7 +153,468 @@ } }, "metadata": { - "__bicep_export!": true + "__bicep_export!": true, + "description": "Properties of the gallery solutions to be created in the log analytics workspace." + } + }, + "storageInsightsConfigType": { + "type": "object", + "properties": { + "storageAccountResourceId": { + "type": "string", + "metadata": { + "description": "Required. Resource ID of the storage account to be linked." + } + }, + "containers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true, + "metadata": { + "description": "Optional. The names of the blob containers that the workspace should read." + } + }, + "tables": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true, + "metadata": { + "description": "Optional. List of tables to be read by the workspace." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "Properties of the storage insights configuration." + } + }, + "linkedServiceType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. Name of the linked service." + } + }, + "resourceId": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access." + } + }, + "writeAccessResourceId": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "Properties of the linked service." + } + }, + "linkedStorageAccountType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. Name of the link." + } + }, + "storageAccountIds": { + "type": "array", + "items": { + "type": "string" + }, + "minLength": 1, + "metadata": { + "description": "Required. Linked storage accounts resources Ids." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "Properties of the linked storage account." + } + }, + "savedSearchType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. Name of the saved search." + } + }, + "etag": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The ETag of the saved search. To override an existing saved search, use \"*\" or specify the current Etag." + } + }, + "category": { + "type": "string", + "metadata": { + "description": "Required. The category of the saved search. This helps the user to find a saved search faster." + } + }, + "displayName": { + "type": "string", + "metadata": { + "description": "Required. Display name for the search." + } + }, + "functionAlias": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The function alias if query serves as a function." + } + }, + "functionParameters": { + "type": "string", + "nullable": true, + "metadata": { + "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." + } + }, + "query": { + "type": "string", + "metadata": { + "description": "Required. The query expression for the saved search." + } + }, + "tags": { + "type": "array", + "nullable": true, + "metadata": { + "description": "Optional. The tags attached to the saved search." + } + }, + "version": { + "type": "int", + "nullable": true, + "metadata": { + "description": "Optional. The version number of the query language. The current version is 2 and is the default." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "Properties of the saved search." + } + }, + "dataExportType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. Name of the data export." + } + }, + "destination": { + "$ref": "#/definitions/destinationType", + "nullable": true, + "metadata": { + "description": "Optional. The destination of the data export." + } + }, + "enable": { + "type": "bool", + "nullable": true, + "metadata": { + "description": "Optional. Enable or disable the data export." + } + }, + "tableNames": { + "type": "array", + "items": { + "type": "string" + }, + "metadata": { + "description": "Required. The list of table names to export." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "Properties of the data export." + } + }, + "dataSourceType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. Name of the data source." + } + }, + "kind": { + "type": "string", + "metadata": { + "description": "Required. The kind of data source." + } + }, + "linkedResourceId": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The resource id of the resource that will be linked to the workspace." + } + }, + "eventLogName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The name of the event log to configure when kind is WindowsEvent." + } + }, + "eventTypes": { + "type": "array", + "nullable": true, + "metadata": { + "description": "Optional. The event types to configure when kind is WindowsEvent." + } + }, + "objectName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject." + } + }, + "instanceName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Name of the instance to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject." + } + }, + "intervalSeconds": { + "type": "int", + "nullable": true, + "metadata": { + "description": "Optional. Interval in seconds to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject." + } + }, + "performanceCounters": { + "type": "array", + "nullable": true, + "metadata": { + "description": "Optional. List of counters to configure when the kind is LinuxPerformanceObject." + } + }, + "counterName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Counter name to configure when kind is WindowsPerformanceCounter." + } + }, + "state": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerformanceCollection." + } + }, + "syslogName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. System log to configure when kind is LinuxSyslog." + } + }, + "syslogSeverities": { + "type": "array", + "nullable": true, + "metadata": { + "description": "Optional. Severities to configure when kind is LinuxSyslog." + } + }, + "tags": { + "type": "object", + "nullable": true, + "metadata": { + "description": "Optional. Tags to configure in the resource." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "Properties of the data source." + } + }, + "tableType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. The name of the table." + } + }, + "plan": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The plan for the table." + } + }, + "restoredLogs": { + "$ref": "#/definitions/restoredLogsType", + "nullable": true, + "metadata": { + "description": "Optional. The restored logs for the table." + } + }, + "schema": { + "$ref": "#/definitions/schemaType", + "nullable": true, + "metadata": { + "description": "Optional. The schema for the table." + } + }, + "searchResults": { + "$ref": "#/definitions/searchResultsType", + "nullable": true, + "metadata": { + "description": "Optional. The search results for the table." + } + }, + "retentionInDays": { + "type": "int", + "nullable": true, + "metadata": { + "description": "Optional. The retention in days for the table." + } + }, + "totalRetentionInDays": { + "type": "int", + "nullable": true, + "metadata": { + "description": "Optional. The total retention in days for the table." + } + }, + "roleAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/roleAssignmentType" + }, + "nullable": true, + "metadata": { + "description": "Optional. The role assignments for the table." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "Properties of the custom table." + } + }, + "_1.columnType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. The column name." + } + }, + "type": { + "type": "string", + "allowedValues": [ + "boolean", + "dateTime", + "dynamic", + "guid", + "int", + "long", + "real", + "string" + ], + "metadata": { + "description": "Required. The column type." + } + }, + "dataTypeHint": { + "type": "string", + "allowedValues": [ + "armPath", + "guid", + "ip", + "uri" + ], + "nullable": true, + "metadata": { + "description": "Optional. The column data type logical hint." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The column description." + } + }, + "displayName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Column display name." + } + } + }, + "metadata": { + "description": "The parameters of the table column.", + "__bicep_imported_from!": { + "sourceTemplate": "table/main.bicep" + } + } + }, + "destinationType": { + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "metadata": { + "description": "Required. The destination resource ID." + } + }, + "metaData": { + "type": "object", + "properties": { + "eventHubName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account." + } + } + }, + "nullable": true, + "metadata": { + "description": "Optional. The destination metadata." + } + } + }, + "metadata": { + "description": "The data export destination properties.", + "__bicep_imported_from!": { + "sourceTemplate": "data-export/main.bicep" + } } }, "lockType": { @@ -214,6 +675,38 @@ } } }, + "restoredLogsType": { + "type": "object", + "properties": { + "sourceTable": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table to restore data from." + } + }, + "startRestoreTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to start the restore from (UTC)." + } + }, + "endRestoreTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to end the restore by (UTC)." + } + } + }, + "metadata": { + "description": "The parameters of the restore operation that initiated the table.", + "__bicep_imported_from!": { + "sourceTemplate": "table/main.bicep" + } + } + }, "roleAssignmentType": { "type": "object", "properties": { @@ -247,45 +740,130 @@ ], "nullable": true, "metadata": { - "description": "Optional. The principal type of the assigned principal ID." + "description": "Optional. The principal type of the assigned principal ID." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The description of the role assignment." + } + }, + "condition": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"." + } + }, + "conditionVersion": { + "type": "string", + "allowedValues": [ + "2.0" + ], + "nullable": true, + "metadata": { + "description": "Optional. Version of the condition." + } + }, + "delegatedManagedIdentityResourceId": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The Resource Id of the delegated managed identity resource." + } + } + }, + "metadata": { + "description": "An AVM-aligned type for a role assignment.", + "__bicep_imported_from!": { + "sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.1" + } + } + }, + "schemaType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. The table name." + } + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/_1.columnType" + }, + "metadata": { + "description": "Required. A list of table custom columns." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table description." + } + }, + "displayName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table display name." + } + } + }, + "metadata": { + "description": "The table schema.", + "__bicep_imported_from!": { + "sourceTemplate": "table/main.bicep" + } + } + }, + "searchResultsType": { + "type": "object", + "properties": { + "query": { + "type": "string", + "metadata": { + "description": "Required. The search job query." } }, "description": { "type": "string", "nullable": true, "metadata": { - "description": "Optional. The description of the role assignment." + "description": "Optional. The search description." } }, - "condition": { - "type": "string", + "limit": { + "type": "int", "nullable": true, "metadata": { - "description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"." + "description": "Optional. Limit the search job to return up to specified number of rows." } }, - "conditionVersion": { + "startSearchTime": { "type": "string", - "allowedValues": [ - "2.0" - ], "nullable": true, "metadata": { - "description": "Optional. Version of the condition." + "description": "Optional. The timestamp to start the search from (UTC)." } }, - "delegatedManagedIdentityResourceId": { + "endSearchTime": { "type": "string", "nullable": true, "metadata": { - "description": "Optional. The Resource Id of the delegated managed identity resource." + "description": "Optional. The timestamp to end the search by (UTC)." } } }, "metadata": { - "description": "An AVM-aligned type for a role assignment.", + "description": "The parameters of the search job that initiated the table.", "__bicep_imported_from!": { - "sourceTemplate": "br:mcr.microsoft.com/bicep/avm/utl/types/avm-common-types:0.2.1" + "sourceTemplate": "table/main.bicep" } } }, @@ -362,49 +940,70 @@ }, "storageInsightsConfigs": { "type": "array", - "defaultValue": [], + "items": { + "$ref": "#/definitions/storageInsightsConfigType" + }, + "nullable": true, "metadata": { "description": "Optional. List of storage accounts to be read by the workspace." } }, "linkedServices": { "type": "array", - "defaultValue": [], + "items": { + "$ref": "#/definitions/linkedServiceType" + }, + "nullable": true, "metadata": { "description": "Optional. List of services to be linked." } }, "linkedStorageAccounts": { "type": "array", - "defaultValue": [], + "items": { + "$ref": "#/definitions/linkedStorageAccountType" + }, + "nullable": true, "metadata": { "description": "Conditional. List of Storage Accounts to be linked. Required if 'forceCmkForQuery' is set to 'true' and 'savedSearches' is not empty." } }, "savedSearches": { "type": "array", - "defaultValue": [], + "items": { + "$ref": "#/definitions/savedSearchType" + }, + "nullable": true, "metadata": { "description": "Optional. Kusto Query Language searches to save." } }, "dataExports": { "type": "array", - "defaultValue": [], + "items": { + "$ref": "#/definitions/dataExportType" + }, + "nullable": true, "metadata": { "description": "Optional. LAW data export instances to be deployed." } }, "dataSources": { "type": "array", - "defaultValue": [], + "items": { + "$ref": "#/definitions/dataSourceType" + }, + "nullable": true, "metadata": { "description": "Optional. LAW data sources to configure." } }, "tables": { "type": "array", - "defaultValue": [], + "items": { + "$ref": "#/definitions/tableType" + }, + "nullable": true, "metadata": { "description": "Optional. LAW custom tables to be deployed." } @@ -689,7 +1288,7 @@ "logAnalyticsWorkspace_storageInsightConfigs": { "copy": { "name": "logAnalyticsWorkspace_storageInsightConfigs", - "count": "[length(parameters('storageInsightsConfigs'))]" + "count": "[length(coalesce(parameters('storageInsightsConfigs'), createArray()))]" }, "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -704,13 +1303,13 @@ "value": "[parameters('name')]" }, "containers": { - "value": "[tryGet(parameters('storageInsightsConfigs')[copyIndex()], 'containers')]" + "value": "[tryGet(coalesce(parameters('storageInsightsConfigs'), createArray())[copyIndex()], 'containers')]" }, "tables": { - "value": "[tryGet(parameters('storageInsightsConfigs')[copyIndex()], 'tables')]" + "value": "[tryGet(coalesce(parameters('storageInsightsConfigs'), createArray())[copyIndex()], 'tables')]" }, "storageAccountResourceId": { - "value": "[parameters('storageInsightsConfigs')[copyIndex()].storageAccountResourceId]" + "value": "[coalesce(parameters('storageInsightsConfigs'), createArray())[copyIndex()].storageAccountResourceId]" } }, "template": { @@ -720,8 +1319,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "4634762044709818669" + "version": "0.31.92.45157", + "templateHash": "156138954055342275" }, "name": "Log Analytics Workspace Storage Insight Configs", "description": "This module deploys a Log Analytics Workspace Storage Insight Config.", @@ -749,14 +1348,20 @@ }, "containers": { "type": "array", - "defaultValue": [], + "items": { + "type": "string" + }, + "nullable": true, "metadata": { "description": "Optional. The names of the blob containers that the workspace should read." } }, "tables": { "type": "array", - "defaultValue": [], + "items": { + "type": "string" + }, + "nullable": true, "metadata": { "description": "Optional. The names of the Azure tables that the workspace should read." } @@ -794,7 +1399,11 @@ "id": "[parameters('storageAccountResourceId')]", "key": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', last(split(parameters('storageAccountResourceId'), '/'))), '2022-09-01').keys[0].value]" } - } + }, + "dependsOn": [ + "storageAccount", + "workspace" + ] } }, "outputs": { @@ -829,7 +1438,7 @@ "logAnalyticsWorkspace_linkedServices": { "copy": { "name": "logAnalyticsWorkspace_linkedServices", - "count": "[length(parameters('linkedServices'))]" + "count": "[length(coalesce(parameters('linkedServices'), createArray()))]" }, "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -844,13 +1453,13 @@ "value": "[parameters('name')]" }, "name": { - "value": "[parameters('linkedServices')[copyIndex()].name]" + "value": "[coalesce(parameters('linkedServices'), createArray())[copyIndex()].name]" }, "resourceId": { - "value": "[tryGet(parameters('linkedServices')[copyIndex()], 'resourceId')]" + "value": "[tryGet(coalesce(parameters('linkedServices'), createArray())[copyIndex()], 'resourceId')]" }, "writeAccessResourceId": { - "value": "[tryGet(parameters('linkedServices')[copyIndex()], 'writeAccessResourceId')]" + "value": "[tryGet(coalesce(parameters('linkedServices'), createArray())[copyIndex()], 'writeAccessResourceId')]" } }, "template": { @@ -860,8 +1469,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "13253888384545811424" + "version": "0.31.92.45157", + "templateHash": "815879010072595898" }, "name": "Log Analytics Workspace Linked Services", "description": "This module deploys a Log Analytics Workspace Linked Service.", @@ -882,14 +1491,14 @@ }, "resourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access." } }, "writeAccessResourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require write access." } @@ -916,8 +1525,11 @@ "tags": "[parameters('tags')]", "properties": { "resourceId": "[parameters('resourceId')]", - "writeAccessResourceId": "[if(empty(parameters('writeAccessResourceId')), null(), parameters('writeAccessResourceId'))]" - } + "writeAccessResourceId": "[parameters('writeAccessResourceId')]" + }, + "dependsOn": [ + "workspace" + ] } }, "outputs": { @@ -952,7 +1564,7 @@ "logAnalyticsWorkspace_linkedStorageAccounts": { "copy": { "name": "logAnalyticsWorkspace_linkedStorageAccounts", - "count": "[length(parameters('linkedStorageAccounts'))]" + "count": "[length(coalesce(parameters('linkedStorageAccounts'), createArray()))]" }, "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -967,20 +1579,21 @@ "value": "[parameters('name')]" }, "name": { - "value": "[parameters('linkedStorageAccounts')[copyIndex()].name]" + "value": "[coalesce(parameters('linkedStorageAccounts'), createArray())[copyIndex()].name]" }, - "resourceId": { - "value": "[parameters('linkedStorageAccounts')[copyIndex()].resourceId]" + "storageAccountIds": { + "value": "[coalesce(parameters('linkedStorageAccounts'), createArray())[copyIndex()].storageAccountIds]" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "14472959311832661205" + "version": "0.31.92.45157", + "templateHash": "15129623170213660788" }, "name": "Log Analytics Workspace Linked Storage Accounts", "description": "This module deploys a Log Analytics Workspace Linked Storage Account.", @@ -1005,25 +1618,36 @@ "description": "Required. Name of the link." } }, - "resourceId": { - "type": "string", + "storageAccountIds": { + "type": "array", + "items": { + "type": "string" + }, + "minLength": 1, "metadata": { - "description": "Required. The resource ID of the resource that will be linked to the workspace. This should be used for linking resources which require read access." + "description": "Required. Linked storage accounts resources Ids." } } }, - "resources": [ - { + "resources": { + "workspace": { + "existing": true, + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2022-10-01", + "name": "[parameters('logAnalyticsWorkspaceName')]" + }, + "linkedStorageAccount": { "type": "Microsoft.OperationalInsights/workspaces/linkedStorageAccounts", "apiVersion": "2020-08-01", "name": "[format('{0}/{1}', parameters('logAnalyticsWorkspaceName'), parameters('name'))]", "properties": { - "storageAccountIds": [ - "[parameters('resourceId')]" - ] - } + "storageAccountIds": "[parameters('storageAccountIds')]" + }, + "dependsOn": [ + "workspace" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1056,7 +1680,7 @@ "logAnalyticsWorkspace_savedSearches": { "copy": { "name": "logAnalyticsWorkspace_savedSearches", - "count": "[length(parameters('savedSearches'))]" + "count": "[length(coalesce(parameters('savedSearches'), createArray()))]" }, "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -1071,28 +1695,31 @@ "value": "[parameters('name')]" }, "name": { - "value": "[format('{0}{1}', parameters('savedSearches')[copyIndex()].name, uniqueString(deployment().name))]" + "value": "[format('{0}{1}', coalesce(parameters('savedSearches'), createArray())[copyIndex()].name, uniqueString(deployment().name))]" }, "etag": { - "value": "[tryGet(parameters('savedSearches')[copyIndex()], 'etag')]" + "value": "[tryGet(coalesce(parameters('savedSearches'), createArray())[copyIndex()], 'etag')]" }, "displayName": { - "value": "[parameters('savedSearches')[copyIndex()].displayName]" + "value": "[coalesce(parameters('savedSearches'), createArray())[copyIndex()].displayName]" }, "category": { - "value": "[parameters('savedSearches')[copyIndex()].category]" + "value": "[coalesce(parameters('savedSearches'), createArray())[copyIndex()].category]" }, "query": { - "value": "[parameters('savedSearches')[copyIndex()].query]" + "value": "[coalesce(parameters('savedSearches'), createArray())[copyIndex()].query]" }, "functionAlias": { - "value": "[tryGet(parameters('savedSearches')[copyIndex()], 'functionAlias')]" + "value": "[tryGet(coalesce(parameters('savedSearches'), createArray())[copyIndex()], 'functionAlias')]" }, "functionParameters": { - "value": "[tryGet(parameters('savedSearches')[copyIndex()], 'functionParameters')]" + "value": "[tryGet(coalesce(parameters('savedSearches'), createArray())[copyIndex()], 'functionParameters')]" + }, + "tags": { + "value": "[tryGet(coalesce(parameters('savedSearches'), createArray())[copyIndex()], 'tags')]" }, "version": { - "value": "[tryGet(parameters('savedSearches')[copyIndex()], 'version')]" + "value": "[tryGet(coalesce(parameters('savedSearches'), createArray())[copyIndex()], 'version')]" } }, "template": { @@ -1102,8 +1729,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "1097692446107685243" + "version": "0.31.92.45157", + "templateHash": "15600200446151630277" }, "name": "Log Analytics Workspace Saved Searches", "description": "This module deploys a Log Analytics Workspace Saved Search.", @@ -1196,7 +1823,10 @@ "functionAlias": "[parameters('functionAlias')]", "functionParameters": "[parameters('functionParameters')]", "version": "[parameters('version')]" - } + }, + "dependsOn": [ + "workspace" + ] } }, "outputs": { @@ -1232,7 +1862,7 @@ "logAnalyticsWorkspace_dataExports": { "copy": { "name": "logAnalyticsWorkspace_dataExports", - "count": "[length(parameters('dataExports'))]" + "count": "[length(coalesce(parameters('dataExports'), createArray()))]" }, "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -1247,31 +1877,65 @@ "value": "[parameters('name')]" }, "name": { - "value": "[parameters('dataExports')[copyIndex()].name]" + "value": "[coalesce(parameters('dataExports'), createArray())[copyIndex()].name]" }, "destination": { - "value": "[tryGet(parameters('dataExports')[copyIndex()], 'destination')]" + "value": "[tryGet(coalesce(parameters('dataExports'), createArray())[copyIndex()], 'destination')]" }, "enable": { - "value": "[tryGet(parameters('dataExports')[copyIndex()], 'enable')]" + "value": "[tryGet(coalesce(parameters('dataExports'), createArray())[copyIndex()], 'enable')]" }, "tableNames": { - "value": "[tryGet(parameters('dataExports')[copyIndex()], 'tableNames')]" + "value": "[tryGet(coalesce(parameters('dataExports'), createArray())[copyIndex()], 'tableNames')]" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "6471227851268955186" + "version": "0.31.92.45157", + "templateHash": "8392467222383128491" }, "name": "Log Analytics Workspace Data Exports", "description": "This module deploys a Log Analytics Workspace Data Export.", "owner": "Azure/module-maintainers" }, + "definitions": { + "destinationType": { + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "metadata": { + "description": "Required. The destination resource ID." + } + }, + "metaData": { + "type": "object", + "properties": { + "eventHubName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account." + } + } + }, + "nullable": true, + "metadata": { + "description": "Optional. The destination metadata." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The data export destination properties." + } + } + }, "parameters": { "name": { "type": "string", @@ -1288,8 +1952,8 @@ } }, "destination": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/destinationType", + "nullable": true, "metadata": { "description": "Optional. Destination properties." } @@ -1303,14 +1967,23 @@ }, "tableNames": { "type": "array", - "defaultValue": [], + "items": { + "type": "string" + }, + "minLength": 1, "metadata": { - "description": "Optional. An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']." + "description": "Required. An array of tables to export, for example: ['Heartbeat', 'SecurityEvent']." } } }, - "resources": [ - { + "resources": { + "workspace": { + "existing": true, + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2022-10-01", + "name": "[parameters('workspaceName')]" + }, + "dataExport": { "type": "Microsoft.OperationalInsights/workspaces/dataExports", "apiVersion": "2020-08-01", "name": "[format('{0}/{1}', parameters('workspaceName'), parameters('name'))]", @@ -1318,9 +1991,12 @@ "destination": "[parameters('destination')]", "enable": "[parameters('enable')]", "tableNames": "[parameters('tableNames')]" - } + }, + "dependsOn": [ + "workspace" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1353,7 +2029,7 @@ "logAnalyticsWorkspace_dataSources": { "copy": { "name": "logAnalyticsWorkspace_dataSources", - "count": "[length(parameters('dataSources'))]" + "count": "[length(coalesce(parameters('dataSources'), createArray()))]" }, "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -1368,43 +2044,46 @@ "value": "[parameters('name')]" }, "name": { - "value": "[parameters('dataSources')[copyIndex()].name]" + "value": "[coalesce(parameters('dataSources'), createArray())[copyIndex()].name]" }, "kind": { - "value": "[parameters('dataSources')[copyIndex()].kind]" + "value": "[coalesce(parameters('dataSources'), createArray())[copyIndex()].kind]" }, "linkedResourceId": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'linkedResourceId')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'linkedResourceId')]" }, "eventLogName": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'eventLogName')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'eventLogName')]" }, "eventTypes": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'eventTypes')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'eventTypes')]" }, "objectName": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'objectName')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'objectName')]" }, "instanceName": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'instanceName')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'instanceName')]" }, "intervalSeconds": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'intervalSeconds')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'intervalSeconds')]" }, "counterName": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'counterName')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'counterName')]" }, "state": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'state')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'state')]" }, "syslogName": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'syslogName')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'syslogName')]" }, "syslogSeverities": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'syslogSeverities')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'syslogSeverities')]" }, "performanceCounters": { - "value": "[tryGet(parameters('dataSources')[copyIndex()], 'performanceCounters')]" + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'performanceCounters')]" + }, + "tags": { + "value": "[tryGet(coalesce(parameters('dataSources'), createArray())[copyIndex()], 'tags')]" } }, "template": { @@ -1414,8 +2093,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "8463454444688288974" + "version": "0.31.92.45157", + "templateHash": "3019400626196043317" }, "name": "Log Analytics Workspace Datasources", "description": "This module deploys a Log Analytics Workspace Data Source.", @@ -1431,7 +2110,7 @@ "name": { "type": "string", "metadata": { - "description": "Required. Name of the solution." + "description": "Required. Name of the data source." } }, "kind": { @@ -1448,7 +2127,7 @@ "LinuxPerformanceCollection" ], "metadata": { - "description": "Optional. The kind of the DataSource." + "description": "Optional. The kind of the data source." } }, "tags": { @@ -1460,14 +2139,14 @@ }, "linkedResourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Resource ID of the resource to be linked." } }, "eventLogName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Windows event log name to configure when kind is WindowsEvent." } @@ -1481,7 +2160,7 @@ }, "objectName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Name of the object to configure when kind is WindowsPerformanceCounter or LinuxPerformanceObject." } @@ -1509,21 +2188,21 @@ }, "counterName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. Counter name to configure when kind is WindowsPerformanceCounter." } }, "state": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. State to configure when kind is IISLogs or LinuxSyslogCollection or LinuxPerformanceCollection." } }, "syslogName": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { "description": "Optional. System log to configure when kind is LinuxSyslog." } @@ -1561,7 +2240,10 @@ "syslogName": "[if(and(not(empty(parameters('kind'))), equals(parameters('kind'), 'LinuxSyslog')), parameters('syslogName'), null())]", "syslogSeverities": "[if(and(not(empty(parameters('kind'))), or(equals(parameters('kind'), 'LinuxSyslog'), equals(parameters('kind'), 'LinuxPerformanceObject'))), parameters('syslogSeverities'), null())]", "performanceCounters": "[if(and(not(empty(parameters('kind'))), equals(parameters('kind'), 'LinuxPerformanceObject')), parameters('performanceCounters'), null())]" - } + }, + "dependsOn": [ + "workspace" + ] } }, "outputs": { @@ -1596,7 +2278,7 @@ "logAnalyticsWorkspace_tables": { "copy": { "name": "logAnalyticsWorkspace_tables", - "count": "[length(parameters('tables'))]" + "count": "[length(coalesce(parameters('tables'), createArray()))]" }, "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -1611,28 +2293,28 @@ "value": "[parameters('name')]" }, "name": { - "value": "[parameters('tables')[copyIndex()].name]" + "value": "[coalesce(parameters('tables'), createArray())[copyIndex()].name]" }, "plan": { - "value": "[tryGet(parameters('tables')[copyIndex()], 'plan')]" + "value": "[tryGet(coalesce(parameters('tables'), createArray())[copyIndex()], 'plan')]" }, "schema": { - "value": "[tryGet(parameters('tables')[copyIndex()], 'schema')]" + "value": "[tryGet(coalesce(parameters('tables'), createArray())[copyIndex()], 'schema')]" }, "retentionInDays": { - "value": "[tryGet(parameters('tables')[copyIndex()], 'retentionInDays')]" + "value": "[tryGet(coalesce(parameters('tables'), createArray())[copyIndex()], 'retentionInDays')]" }, "totalRetentionInDays": { - "value": "[tryGet(parameters('tables')[copyIndex()], 'totalRetentionInDays')]" + "value": "[tryGet(coalesce(parameters('tables'), createArray())[copyIndex()], 'totalRetentionInDays')]" }, "restoredLogs": { - "value": "[tryGet(parameters('tables')[copyIndex()], 'restoredLogs')]" + "value": "[tryGet(coalesce(parameters('tables'), createArray())[copyIndex()], 'restoredLogs')]" }, "searchResults": { - "value": "[tryGet(parameters('tables')[copyIndex()], 'searchResults')]" + "value": "[tryGet(coalesce(parameters('tables'), createArray())[copyIndex()], 'searchResults')]" }, "roleAssignments": { - "value": "[tryGet(parameters('tables')[copyIndex()], 'roleAssignments')]" + "value": "[tryGet(coalesce(parameters('tables'), createArray())[copyIndex()], 'roleAssignments')]" } }, "template": { @@ -1642,14 +2324,183 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "7459975468074908308" + "version": "0.31.92.45157", + "templateHash": "13277383761731431931" }, "name": "Log Analytics Workspace Tables", "description": "This module deploys a Log Analytics Workspace Table.", "owner": "Azure/module-maintainers" }, "definitions": { + "restoredLogsType": { + "type": "object", + "properties": { + "sourceTable": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table to restore data from." + } + }, + "startRestoreTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to start the restore from (UTC)." + } + }, + "endRestoreTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to end the restore by (UTC)." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The parameters of the restore operation that initiated the table." + } + }, + "schemaType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. The table name." + } + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/columnType" + }, + "metadata": { + "description": "Required. A list of table custom columns." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table description." + } + }, + "displayName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table display name." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The table schema." + } + }, + "columnType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. The column name." + } + }, + "type": { + "type": "string", + "allowedValues": [ + "boolean", + "dateTime", + "dynamic", + "guid", + "int", + "long", + "real", + "string" + ], + "metadata": { + "description": "Required. The column type." + } + }, + "dataTypeHint": { + "type": "string", + "allowedValues": [ + "armPath", + "guid", + "ip", + "uri" + ], + "nullable": true, + "metadata": { + "description": "Optional. The column data type logical hint." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The column description." + } + }, + "displayName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Column display name." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The parameters of the table column." + } + }, + "searchResultsType": { + "type": "object", + "properties": { + "query": { + "type": "string", + "metadata": { + "description": "Required. The search job query." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The search description." + } + }, + "limit": { + "type": "int", + "nullable": true, + "metadata": { + "description": "Optional. Limit the search job to return up to specified number of rows." + } + }, + "startSearchTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to start the search from (UTC)." + } + }, + "endSearchTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to end the search by (UTC)." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The parameters of the search job that initiated the table." + } + }, "roleAssignmentType": { "type": "object", "properties": { @@ -1751,8 +2602,8 @@ } }, "restoredLogs": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/restoredLogsType", + "nullable": true, "metadata": { "description": "Optional. Restore parameters." } @@ -1767,15 +2618,15 @@ } }, "schema": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/schemaType", + "nullable": true, "metadata": { "description": "Optional. Table's schema." } }, "searchResults": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/searchResultsType", + "nullable": true, "metadata": { "description": "Optional. Parameters of the search job that initiated this table." } @@ -1838,7 +2689,10 @@ "schema": "[parameters('schema')]", "searchResults": "[parameters('searchResults')]", "totalRetentionInDays": "[parameters('totalRetentionInDays')]" - } + }, + "dependsOn": [ + "workspace" + ] }, "table_roleAssignments": { "copy": { diff --git a/avm/res/operational-insights/workspace/saved-search/main.json b/avm/res/operational-insights/workspace/saved-search/main.json index 94d7355386..645e600903 100644 --- a/avm/res/operational-insights/workspace/saved-search/main.json +++ b/avm/res/operational-insights/workspace/saved-search/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "1097692446107685243" + "version": "0.31.92.45157", + "templateHash": "15600200446151630277" }, "name": "Log Analytics Workspace Saved Searches", "description": "This module deploys a Log Analytics Workspace Saved Search.", @@ -99,7 +99,10 @@ "functionAlias": "[parameters('functionAlias')]", "functionParameters": "[parameters('functionParameters')]", "version": "[parameters('version')]" - } + }, + "dependsOn": [ + "workspace" + ] } }, "outputs": { diff --git a/avm/res/operational-insights/workspace/storage-insight-config/README.md b/avm/res/operational-insights/workspace/storage-insight-config/README.md index 67797b8b01..8bd800b2d2 100644 --- a/avm/res/operational-insights/workspace/storage-insight-config/README.md +++ b/avm/res/operational-insights/workspace/storage-insight-config/README.md @@ -57,7 +57,6 @@ The names of the blob containers that the workspace should read. - Required: No - Type: array -- Default: `[]` ### Parameter: `name` @@ -73,7 +72,6 @@ The names of the Azure tables that the workspace should read. - Required: No - Type: array -- Default: `[]` ### Parameter: `tags` diff --git a/avm/res/operational-insights/workspace/storage-insight-config/main.bicep b/avm/res/operational-insights/workspace/storage-insight-config/main.bicep index 81da4012c7..6d90355bda 100644 --- a/avm/res/operational-insights/workspace/storage-insight-config/main.bicep +++ b/avm/res/operational-insights/workspace/storage-insight-config/main.bicep @@ -12,10 +12,10 @@ param name string = '${last(split(storageAccountResourceId, '/'))}-stinsconfig' param storageAccountResourceId string @description('Optional. The names of the blob containers that the workspace should read.') -param containers array = [] +param containers string[]? @description('Optional. The names of the Azure tables that the workspace should read.') -param tables array = [] +param tables string[]? @description('Optional. Tags to configure in the resource.') param tags object? diff --git a/avm/res/operational-insights/workspace/storage-insight-config/main.json b/avm/res/operational-insights/workspace/storage-insight-config/main.json index 58fde53976..a344a30e2a 100644 --- a/avm/res/operational-insights/workspace/storage-insight-config/main.json +++ b/avm/res/operational-insights/workspace/storage-insight-config/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "4634762044709818669" + "version": "0.31.92.45157", + "templateHash": "156138954055342275" }, "name": "Log Analytics Workspace Storage Insight Configs", "description": "This module deploys a Log Analytics Workspace Storage Insight Config.", @@ -34,14 +34,20 @@ }, "containers": { "type": "array", - "defaultValue": [], + "items": { + "type": "string" + }, + "nullable": true, "metadata": { "description": "Optional. The names of the blob containers that the workspace should read." } }, "tables": { "type": "array", - "defaultValue": [], + "items": { + "type": "string" + }, + "nullable": true, "metadata": { "description": "Optional. The names of the Azure tables that the workspace should read." } @@ -79,7 +85,11 @@ "id": "[parameters('storageAccountResourceId')]", "key": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', last(split(parameters('storageAccountResourceId'), '/'))), '2022-09-01').keys[0].value]" } - } + }, + "dependsOn": [ + "storageAccount", + "workspace" + ] } }, "outputs": { diff --git a/avm/res/operational-insights/workspace/table/README.md b/avm/res/operational-insights/workspace/table/README.md index 4418b50f3b..a9c0f4d783 100644 --- a/avm/res/operational-insights/workspace/table/README.md +++ b/avm/res/operational-insights/workspace/table/README.md @@ -77,7 +77,35 @@ Restore parameters. - Required: No - Type: object -- Default: `{}` + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`endRestoreTime`](#parameter-restoredlogsendrestoretime) | string | The timestamp to end the restore by (UTC). | +| [`sourceTable`](#parameter-restoredlogssourcetable) | string | The table to restore data from. | +| [`startRestoreTime`](#parameter-restoredlogsstartrestoretime) | string | The timestamp to start the restore from (UTC). | + +### Parameter: `restoredLogs.endRestoreTime` + +The timestamp to end the restore by (UTC). + +- Required: No +- Type: string + +### Parameter: `restoredLogs.sourceTable` + +The table to restore data from. + +- Required: No +- Type: string + +### Parameter: `restoredLogs.startRestoreTime` + +The timestamp to start the restore from (UTC). + +- Required: No +- Type: string ### Parameter: `retentionInDays` @@ -200,7 +228,120 @@ Table's schema. - Required: No - Type: object -- Default: `{}` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`columns`](#parameter-schemacolumns) | array | A list of table custom columns. | +| [`name`](#parameter-schemaname) | string | The table name. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`description`](#parameter-schemadescription) | string | The table description. | +| [`displayName`](#parameter-schemadisplayname) | string | The table display name. | + +### Parameter: `schema.columns` + +A list of table custom columns. + +- Required: Yes +- Type: array + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`name`](#parameter-schemacolumnsname) | string | The column name. | +| [`type`](#parameter-schemacolumnstype) | string | The column type. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`dataTypeHint`](#parameter-schemacolumnsdatatypehint) | string | The column data type logical hint. | +| [`description`](#parameter-schemacolumnsdescription) | string | The column description. | +| [`displayName`](#parameter-schemacolumnsdisplayname) | string | Column display name. | + +### Parameter: `schema.columns.name` + +The column name. + +- Required: Yes +- Type: string + +### Parameter: `schema.columns.type` + +The column type. + +- Required: Yes +- Type: string +- Allowed: + ```Bicep + [ + 'boolean' + 'dateTime' + 'dynamic' + 'guid' + 'int' + 'long' + 'real' + 'string' + ] + ``` + +### Parameter: `schema.columns.dataTypeHint` + +The column data type logical hint. + +- Required: No +- Type: string +- Allowed: + ```Bicep + [ + 'armPath' + 'guid' + 'ip' + 'uri' + ] + ``` + +### Parameter: `schema.columns.description` + +The column description. + +- Required: No +- Type: string + +### Parameter: `schema.columns.displayName` + +Column display name. + +- Required: No +- Type: string + +### Parameter: `schema.name` + +The table name. + +- Required: Yes +- Type: string + +### Parameter: `schema.description` + +The table description. + +- Required: No +- Type: string + +### Parameter: `schema.displayName` + +The table display name. + +- Required: No +- Type: string ### Parameter: `searchResults` @@ -208,7 +349,56 @@ Parameters of the search job that initiated this table. - Required: No - Type: object -- Default: `{}` + +**Required parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`query`](#parameter-searchresultsquery) | string | The search job query. | + +**Optional parameters** + +| Parameter | Type | Description | +| :-- | :-- | :-- | +| [`description`](#parameter-searchresultsdescription) | string | The search description. | +| [`endSearchTime`](#parameter-searchresultsendsearchtime) | string | The timestamp to end the search by (UTC). | +| [`limit`](#parameter-searchresultslimit) | int | Limit the search job to return up to specified number of rows. | +| [`startSearchTime`](#parameter-searchresultsstartsearchtime) | string | The timestamp to start the search from (UTC). | + +### Parameter: `searchResults.query` + +The search job query. + +- Required: Yes +- Type: string + +### Parameter: `searchResults.description` + +The search description. + +- Required: No +- Type: string + +### Parameter: `searchResults.endSearchTime` + +The timestamp to end the search by (UTC). + +- Required: No +- Type: string + +### Parameter: `searchResults.limit` + +Limit the search job to return up to specified number of rows. + +- Required: No +- Type: int + +### Parameter: `searchResults.startSearchTime` + +The timestamp to start the search from (UTC). + +- Required: No +- Type: string ### Parameter: `totalRetentionInDays` diff --git a/avm/res/operational-insights/workspace/table/main.bicep b/avm/res/operational-insights/workspace/table/main.bicep index ad3323e998..98aea3459e 100644 --- a/avm/res/operational-insights/workspace/table/main.bicep +++ b/avm/res/operational-insights/workspace/table/main.bicep @@ -20,7 +20,7 @@ param workspaceName string param plan string = 'Analytics' @description('Optional. Restore parameters.') -param restoredLogs object = {} +param restoredLogs restoredLogsType? @description('Optional. The table retention in days, between 4 and 730. Setting this property to -1 will default to the workspace retention.') @minValue(-1) @@ -28,10 +28,10 @@ param restoredLogs object = {} param retentionInDays int = -1 @description('Optional. Table\'s schema.') -param schema object = {} +param schema schemaType? @description('Optional. Parameters of the search job that initiated this table.') -param searchResults object = {} +param searchResults searchResultsType? @description('Optional. The table total retention in days, between 4 and 2555. Setting this property to -1 will default to table retention.') @minValue(-1) @@ -136,3 +136,57 @@ output resourceGroupName string = resourceGroup().name // =============== // // Definitions // // =============== // + +@export() +@description('The parameters of the restore operation that initiated the table.') +type restoredLogsType = { + @description('Optional. The table to restore data from.') + sourceTable: string? + @description('Optional. The timestamp to start the restore from (UTC).') + startRestoreTime: string? + @description('Optional. The timestamp to end the restore by (UTC).') + endRestoreTime: string? +} + +@export() +@description('The table schema.') +type schemaType = { + @description('Required. The table name.') + name: string + @description('Required. A list of table custom columns.') + columns: columnType[] + @description('Optional. The table description.') + description: string? + @description('Optional. The table display name.') + displayName: string? +} + +@export() +@description('The parameters of the table column.') +type columnType = { + @description('Required. The column name.') + name: string + @description('Required. The column type.') + type: 'boolean' | 'dateTime' | 'dynamic' | 'guid' | 'int' | 'long' | 'real' | 'string' + @description('Optional. The column data type logical hint.') + dataTypeHint: 'armPath' | 'guid' | 'ip' | 'uri'? + @description('Optional. The column description.') + description: string? + @description('Optional. Column display name.') + displayName: string? +} + +@export() +@description('The parameters of the search job that initiated the table.') +type searchResultsType = { + @description('Required. The search job query.') + query: string + @description('Optional. The search description.') + description: string? + @description('Optional. Limit the search job to return up to specified number of rows.') + limit: int? + @description('Optional. The timestamp to start the search from (UTC).') + startSearchTime: string? + @description('Optional. The timestamp to end the search by (UTC).') + endSearchTime: string? +} diff --git a/avm/res/operational-insights/workspace/table/main.json b/avm/res/operational-insights/workspace/table/main.json index 25942c72b9..5c56c36063 100644 --- a/avm/res/operational-insights/workspace/table/main.json +++ b/avm/res/operational-insights/workspace/table/main.json @@ -5,14 +5,183 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.31.34.60546", - "templateHash": "7459975468074908308" + "version": "0.31.92.45157", + "templateHash": "13277383761731431931" }, "name": "Log Analytics Workspace Tables", "description": "This module deploys a Log Analytics Workspace Table.", "owner": "Azure/module-maintainers" }, "definitions": { + "restoredLogsType": { + "type": "object", + "properties": { + "sourceTable": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table to restore data from." + } + }, + "startRestoreTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to start the restore from (UTC)." + } + }, + "endRestoreTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to end the restore by (UTC)." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The parameters of the restore operation that initiated the table." + } + }, + "schemaType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. The table name." + } + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/columnType" + }, + "metadata": { + "description": "Required. A list of table custom columns." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table description." + } + }, + "displayName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The table display name." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The table schema." + } + }, + "columnType": { + "type": "object", + "properties": { + "name": { + "type": "string", + "metadata": { + "description": "Required. The column name." + } + }, + "type": { + "type": "string", + "allowedValues": [ + "boolean", + "dateTime", + "dynamic", + "guid", + "int", + "long", + "real", + "string" + ], + "metadata": { + "description": "Required. The column type." + } + }, + "dataTypeHint": { + "type": "string", + "allowedValues": [ + "armPath", + "guid", + "ip", + "uri" + ], + "nullable": true, + "metadata": { + "description": "Optional. The column data type logical hint." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The column description." + } + }, + "displayName": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. Column display name." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The parameters of the table column." + } + }, + "searchResultsType": { + "type": "object", + "properties": { + "query": { + "type": "string", + "metadata": { + "description": "Required. The search job query." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The search description." + } + }, + "limit": { + "type": "int", + "nullable": true, + "metadata": { + "description": "Optional. Limit the search job to return up to specified number of rows." + } + }, + "startSearchTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to start the search from (UTC)." + } + }, + "endSearchTime": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The timestamp to end the search by (UTC)." + } + } + }, + "metadata": { + "__bicep_export!": true, + "description": "The parameters of the search job that initiated the table." + } + }, "roleAssignmentType": { "type": "object", "properties": { @@ -114,8 +283,8 @@ } }, "restoredLogs": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/restoredLogsType", + "nullable": true, "metadata": { "description": "Optional. Restore parameters." } @@ -130,15 +299,15 @@ } }, "schema": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/schemaType", + "nullable": true, "metadata": { "description": "Optional. Table's schema." } }, "searchResults": { - "type": "object", - "defaultValue": {}, + "$ref": "#/definitions/searchResultsType", + "nullable": true, "metadata": { "description": "Optional. Parameters of the search job that initiated this table." } @@ -201,7 +370,10 @@ "schema": "[parameters('schema')]", "searchResults": "[parameters('searchResults')]", "totalRetentionInDays": "[parameters('totalRetentionInDays')]" - } + }, + "dependsOn": [ + "workspace" + ] }, "table_roleAssignments": { "copy": { diff --git a/avm/res/operational-insights/workspace/tests/e2e/adv/main.test.bicep b/avm/res/operational-insights/workspace/tests/e2e/adv/main.test.bicep index 9fe570be9d..56fbf274a5 100644 --- a/avm/res/operational-insights/workspace/tests/e2e/adv/main.test.bicep +++ b/avm/res/operational-insights/workspace/tests/e2e/adv/main.test.bicep @@ -201,7 +201,9 @@ module testDeployment '../../../main.bicep' = [ linkedStorageAccounts: [ { name: 'Query' - resourceId: nestedDependencies.outputs.storageAccountResourceId + storageAccountIds: [ + nestedDependencies.outputs.storageAccountResourceId + ] } ] publicNetworkAccessForIngestion: 'Disabled' @@ -234,11 +236,11 @@ module testDeployment '../../../main.bicep' = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'RawData' - type: 'String' + type: 'string' } ] } @@ -272,27 +274,27 @@ module testDeployment '../../../main.bicep' = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'EventTime' - type: 'DateTime' + type: 'dateTime' } { name: 'EventLevel' - type: 'String' + type: 'string' } { name: 'EventCode' - type: 'Int' + type: 'int' } { name: 'Message' - type: 'String' + type: 'string' } { name: 'RawData' - type: 'String' + type: 'string' } ] } diff --git a/avm/res/operational-insights/workspace/tests/e2e/max/main.test.bicep b/avm/res/operational-insights/workspace/tests/e2e/max/main.test.bicep index 1c9fde140b..c2d85a7fde 100644 --- a/avm/res/operational-insights/workspace/tests/e2e/max/main.test.bicep +++ b/avm/res/operational-insights/workspace/tests/e2e/max/main.test.bicep @@ -206,7 +206,9 @@ module testDeployment '../../../main.bicep' = [ linkedStorageAccounts: [ { name: 'Query' - resourceId: nestedDependencies.outputs.storageAccountResourceId + storageAccountIds: [ + nestedDependencies.outputs.storageAccountResourceId + ] } ] tables: [ @@ -217,11 +219,11 @@ module testDeployment '../../../main.bicep' = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'RawData' - type: 'String' + type: 'string' } ] } @@ -255,27 +257,27 @@ module testDeployment '../../../main.bicep' = [ columns: [ { name: 'TimeGenerated' - type: 'DateTime' + type: 'dateTime' } { name: 'EventTime' - type: 'DateTime' + type: 'dateTime' } { name: 'EventLevel' - type: 'String' + type: 'string' } { name: 'EventCode' - type: 'Int' + type: 'int' } { name: 'Message' - type: 'String' + type: 'string' } { name: 'RawData' - type: 'String' + type: 'string' } ] } diff --git a/avm/res/operational-insights/workspace/tests/e2e/waf-aligned/main.test.bicep b/avm/res/operational-insights/workspace/tests/e2e/waf-aligned/main.test.bicep index 9819017c8c..80c5cfb578 100644 --- a/avm/res/operational-insights/workspace/tests/e2e/waf-aligned/main.test.bicep +++ b/avm/res/operational-insights/workspace/tests/e2e/waf-aligned/main.test.bicep @@ -183,7 +183,9 @@ module testDeployment '../../../main.bicep' = [ linkedStorageAccounts: [ { name: 'Query' - resourceId: nestedDependencies.outputs.storageAccountResourceId + storageAccountIds: [ + nestedDependencies.outputs.storageAccountResourceId + ] } ] publicNetworkAccessForIngestion: 'Disabled' diff --git a/avm/res/operational-insights/workspace/version.json b/avm/res/operational-insights/workspace/version.json index 9a9a06e897..b39a201436 100644 --- a/avm/res/operational-insights/workspace/version.json +++ b/avm/res/operational-insights/workspace/version.json @@ -1,7 +1,7 @@ { "$schema": "https://aka.ms/bicep-registry-module-version-file-schema#", - "version": "0.8", + "version": "0.9", "pathFilters": [ "./main.json" ] -} \ No newline at end of file +}