diff --git a/constructs/Compute/virtualMachinesMultiple/README.md b/constructs/Compute/virtualMachinesMultiple/README.md
index 19266955b9..81b6f034e7 100644
--- a/constructs/Compute/virtualMachinesMultiple/README.md
+++ b/constructs/Compute/virtualMachinesMultiple/README.md
@@ -67,7 +67,6 @@ This module deploys one or multiple Virtual Machines.
| `dedicatedHostId` | string | `''` | | Specifies resource ID about the dedicated host that the virtual machine resides in. |
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
| `disablePasswordAuthentication` | bool | `False` | | Specifies whether password authentication should be disabled. |
diff --git a/constructs/Compute/virtualMachinesMultiple/main.bicep b/constructs/Compute/virtualMachinesMultiple/main.bicep
index 42e9527e8a..9fc00d6f9e 100644
--- a/constructs/Compute/virtualMachinesMultiple/main.bicep
+++ b/constructs/Compute/virtualMachinesMultiple/main.bicep
@@ -230,11 +230,6 @@ param extensionCustomScriptProtectedSetting object = {}
@description('Optional. Location for all resources.')
param location string = resourceGroup().location
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -301,7 +296,7 @@ var vmNamesToApply = !empty(vmNames) ? vmNames : vmGeneratedNames
var enableReferencedModulesTelemetry = false
-module virtualMachine '../../../modules/Compute/virtualMachines/main.bicep' = [for (vmName, index) in vmNamesToApply: {
+module virtualMachine '../../../modules/compute/virtual-machine/main.bicep' = [for (vmName, index) in vmNamesToApply: {
name: '${deployment().name}-vm-${index}'
params: {
name: vmName
@@ -328,7 +323,6 @@ module virtualMachine '../../../modules/Compute/virtualMachines/main.bicep' = [f
dedicatedHostId: dedicatedHostId
diagnosticEventHubAuthorizationRuleId: diagnosticEventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticEventHubName
- diagnosticLogsRetentionInDays: diagnosticLogsRetentionInDays
diagnosticStorageAccountId: diagnosticStorageAccountId
diagnosticWorkspaceId: diagnosticWorkspaceId
disablePasswordAuthentication: disablePasswordAuthentication
diff --git a/docs/wiki/The library - Module design.md b/docs/wiki/The library - Module design.md
index 8be0455ffb..b1ad89c38c 100644
--- a/docs/wiki/The library - Module design.md
+++ b/docs/wiki/The library - Module design.md
@@ -295,10 +295,6 @@ The diagnostic settings may differ slightly, from resource to resource. Most not
Details
```bicep
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -336,20 +332,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -357,10 +345,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
resource _diagnosticSettings 'Microsoft.Insights/diagnosticsettings@2021-05-01-preview' = if (!empty(diagnosticStorageAccountId) || !empty(diagnosticWorkspaceId) || !empty(diagnosticEventHubAuthorizationRuleId) || !empty(diagnosticEventHubName)) {
diff --git a/modules/aad/domain-service/.test/common/main.test.bicep b/modules/aad/domain-service/.test/common/main.test.bicep
index d75646823c..39ebef747d 100644
--- a/modules/aad/domain-service/.test/common/main.test.bicep
+++ b/modules/aad/domain-service/.test/common/main.test.bicep
@@ -75,7 +75,6 @@ module testDeployment '../../main.bicep' = {
additionalRecipients: [
'${namePrefix}@noreply.github.com'
]
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/aad/domain-service/README.md b/modules/aad/domain-service/README.md
index 5f254cf354..14813acc04 100644
--- a/modules/aad/domain-service/README.md
+++ b/modules/aad/domain-service/README.md
@@ -43,7 +43,6 @@ This module deploys an Azure Active Directory Domain Services (AADDS).
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', AccountLogon, AccountManagement, allLogs, DetailTracking, DirectoryServiceAccess, LogonLogoff, ObjectAccess, PolicyChange, PrivilegeUse, SystemSecurity]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
| `domainConfigurationType` | string | `'FullySynced'` | `[FullySynced, ResourceTrusting]` | The value is to provide domain configuration type. |
@@ -238,7 +237,6 @@ module domainService './aad/domain-service/main.bicep' = {
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -289,9 +287,6 @@ module domainService './aad/domain-service/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/aad/domain-service/main.bicep b/modules/aad/domain-service/main.bicep
index 8e33c8f9b0..e8aa4ad471 100644
--- a/modules/aad/domain-service/main.bicep
+++ b/modules/aad/domain-service/main.bicep
@@ -130,11 +130,6 @@ param diagnosticEventHubName string = ''
@description('Optional. Tags of the resource.')
param tags object = {}
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true
@@ -170,20 +165,12 @@ param diagnosticLogCategoriesToEnable array = [
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
diff --git a/modules/aad/domain-service/main.json b/modules/aad/domain-service/main.json
index c312c1d420..d7c212e90c 100644
--- a/modules/aad/domain-service/main.json
+++ b/modules/aad/domain-service/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "12721378436248791893"
+ "templateHash": "11963708843565725905"
},
"name": "Azure Active Directory Domain Services",
"description": "This module deploys an Azure Active Directory Domain Services (AADDS).",
@@ -235,15 +235,6 @@
"description": "Optional. Tags of the resource."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"enableDefaultTelemetry": {
"type": "bool",
"defaultValue": true,
@@ -300,15 +291,11 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
diff --git a/modules/analysis-services/server/.test/common/main.test.bicep b/modules/analysis-services/server/.test/common/main.test.bicep
index b5ad65e147..ad76d1af43 100644
--- a/modules/analysis-services/server/.test/common/main.test.bicep
+++ b/modules/analysis-services/server/.test/common/main.test.bicep
@@ -74,7 +74,6 @@ module testDeployment '../../main.bicep' = {
principalType: 'ServicePrincipal'
}
]
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/analysis-services/server/.test/max/main.test.bicep b/modules/analysis-services/server/.test/max/main.test.bicep
index a0448bdaa0..582c804860 100644
--- a/modules/analysis-services/server/.test/max/main.test.bicep
+++ b/modules/analysis-services/server/.test/max/main.test.bicep
@@ -85,7 +85,6 @@ module testDeployment '../../main.bicep' = {
principalType: 'ServicePrincipal'
}
]
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/analysis-services/server/README.md b/modules/analysis-services/server/README.md
index 320ede300c..b01b46f8b3 100644
--- a/modules/analysis-services/server/README.md
+++ b/modules/analysis-services/server/README.md
@@ -34,7 +34,6 @@ This module deploys an Analysis Services Server.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, Engine, Service]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -184,7 +183,6 @@ module server './analysis-services/server/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -230,9 +228,6 @@ module server './analysis-services/server/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -291,7 +286,6 @@ module server './analysis-services/server/main.bicep' = {
'Engine'
'Service'
]
- diagnosticLogsRetentionInDays: 7
diagnosticMetricsToEnable: [
'AllMetrics'
]
@@ -353,9 +347,6 @@ module server './analysis-services/server/main.bicep' = {
"Service"
]
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticMetricsToEnable": {
"value": [
"AllMetrics"
diff --git a/modules/analysis-services/server/main.bicep b/modules/analysis-services/server/main.bicep
index 178798e9db..0b0ca98d44 100644
--- a/modules/analysis-services/server/main.bicep
+++ b/modules/analysis-services/server/main.bicep
@@ -26,11 +26,6 @@ param firewallSettings object = {
@description('Optional. Location for all Resources.')
param location string = resourceGroup().location
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -85,20 +80,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -106,10 +93,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
diff --git a/modules/analysis-services/server/main.json b/modules/analysis-services/server/main.json
index be5e134680..034f53242c 100644
--- a/modules/analysis-services/server/main.json
+++ b/modules/analysis-services/server/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "430189201191579276"
+ "templateHash": "10064223785329368726"
},
"name": "Analysis Services Servers",
"description": "This module deploys an Analysis Services Server.",
@@ -55,15 +55,6 @@
"description": "Optional. Location for all Resources."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -167,11 +158,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -180,15 +167,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
diff --git a/modules/api-management/service/.test/max/main.test.bicep b/modules/api-management/service/.test/max/main.test.bicep
index 0ffbd7d57d..daf0f7f8ad 100644
--- a/modules/api-management/service/.test/max/main.test.bicep
+++ b/modules/api-management/service/.test/max/main.test.bicep
@@ -117,7 +117,6 @@ module testDeployment '../../main.bicep' = {
useFromLocation: 'westeurope'
}
]
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/api-management/service/README.md b/modules/api-management/service/README.md
index 5a6a3c57a6..0aa2f605e6 100644
--- a/modules/api-management/service/README.md
+++ b/modules/api-management/service/README.md
@@ -59,7 +59,6 @@ This module deploys an API Management Service.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, GatewayLogs]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -484,7 +483,6 @@ module service './api-management/service/main.bicep' = {
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -653,9 +651,6 @@ module service './api-management/service/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/api-management/service/main.bicep b/modules/api-management/service/main.bicep
index 3d7e8e488c..cdc0d4c0d6 100644
--- a/modules/api-management/service/main.bicep
+++ b/modules/api-management/service/main.bicep
@@ -18,11 +18,6 @@ param enableDefaultTelemetry bool = true
@description('Optional. Custom properties of the API Management service.')
param customProperties object = {}
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -177,20 +172,12 @@ var authorizationServerList = !empty(authorizationServers) ? authorizationServer
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -198,10 +185,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? (!empty(userAssignedIdentities) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned') : (!empty(userAssignedIdentities) ? 'UserAssigned' : 'None')
diff --git a/modules/api-management/service/main.json b/modules/api-management/service/main.json
index f6c8a70c9a..466bded3f4 100644
--- a/modules/api-management/service/main.json
+++ b/modules/api-management/service/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "14244041467276346330"
+ "templateHash": "11924576523256910990"
},
"name": "API Management Services",
"description": "This module deploys an API Management Service.",
@@ -47,15 +47,6 @@
"description": "Optional. Custom properties of the API Management service."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -361,11 +352,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -374,17 +361,13 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
"enableReferencedModulesTelemetry": false,
"authorizationServerList": "[if(not(empty(parameters('authorizationServers'))), parameters('authorizationServers').secureList, createArray())]",
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]"
},
diff --git a/modules/app-configuration/configuration-store/.test/common/main.test.bicep b/modules/app-configuration/configuration-store/.test/common/main.test.bicep
index 10563eb418..46047d29bc 100644
--- a/modules/app-configuration/configuration-store/.test/common/main.test.bicep
+++ b/modules/app-configuration/configuration-store/.test/common/main.test.bicep
@@ -64,7 +64,6 @@ module testDeployment '../../main.bicep' = {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
createMode: 'Default'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/app-configuration/configuration-store/README.md b/modules/app-configuration/configuration-store/README.md
index c4169483c2..23edaceeaf 100644
--- a/modules/app-configuration/configuration-store/README.md
+++ b/modules/app-configuration/configuration-store/README.md
@@ -38,7 +38,6 @@ This module deploys an App Configuration Store.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, Audit, HttpRequest]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -333,7 +332,6 @@ module configurationStore './app-configuration/configuration-store/main.bicep' =
createMode: 'Default'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
disableLocalAuth: false
@@ -401,9 +399,6 @@ module configurationStore './app-configuration/configuration-store/main.bicep' =
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/app-configuration/configuration-store/main.bicep b/modules/app-configuration/configuration-store/main.bicep
index fe242a7844..f3943eb2ba 100644
--- a/modules/app-configuration/configuration-store/main.bicep
+++ b/modules/app-configuration/configuration-store/main.bicep
@@ -50,11 +50,6 @@ param softDeleteRetentionInDays int = 1
@description('Optional. All Key / Values to create.')
param keyValues array = []
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -114,20 +109,12 @@ var enableReferencedModulesTelemetry = false
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -135,10 +122,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? 'SystemAssigned' : !empty(userAssignedIdentities) ? 'UserAssigned' : 'None'
diff --git a/modules/app-configuration/configuration-store/main.json b/modules/app-configuration/configuration-store/main.json
index f8b7c51280..84bf22d70e 100644
--- a/modules/app-configuration/configuration-store/main.json
+++ b/modules/app-configuration/configuration-store/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "9490352980552121351"
+ "templateHash": "10371162736830551365"
},
"name": "App Configuration Stores",
"description": "This module deploys an App Configuration Store.",
@@ -103,15 +103,6 @@
"description": "Optional. All Key / Values to create."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -222,11 +213,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -235,16 +222,12 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
"enableReferencedModulesTelemetry": false,
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), 'SystemAssigned', if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": {
"type": "[variables('identityType')]",
diff --git a/modules/automation/automation-account/.test/common/main.test.bicep b/modules/automation/automation-account/.test/common/main.test.bicep
index 0637bd5fad..461dfed416 100644
--- a/modules/automation/automation-account/.test/common/main.test.bicep
+++ b/modules/automation/automation-account/.test/common/main.test.bicep
@@ -65,7 +65,6 @@ module testDeployment '../../main.bicep' = {
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/automation/automation-account/README.md b/modules/automation/automation-account/README.md
index 8db593560c..896c504721 100644
--- a/modules/automation/automation-account/README.md
+++ b/modules/automation/automation-account/README.md
@@ -53,7 +53,6 @@ This module deploys an Azure Automation Account.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, DscNodeStatus, JobLogs, JobStreams]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -409,7 +408,6 @@ module automationAccount './automation/automation-account/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
disableLocalAuth: true
@@ -613,9 +611,6 @@ module automationAccount './automation/automation-account/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/automation/automation-account/main.bicep b/modules/automation/automation-account/main.bicep
index b94b53b0d4..8f03f5f404 100644
--- a/modules/automation/automation-account/main.bicep
+++ b/modules/automation/automation-account/main.bicep
@@ -65,11 +65,6 @@ param disableLocalAuth bool = true
@description('Optional. Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible.')
param privateEndpoints array = []
-@minValue(0)
-@maxValue(365)
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -133,20 +128,12 @@ var enableReferencedModulesTelemetry = false
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -154,10 +141,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? (!empty(userAssignedIdentities) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned') : (!empty(userAssignedIdentities) ? 'UserAssigned' : 'None')
diff --git a/modules/automation/automation-account/main.json b/modules/automation/automation-account/main.json
index 5190a537aa..bac8c5b284 100644
--- a/modules/automation/automation-account/main.json
+++ b/modules/automation/automation-account/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "12601553929742094465"
+ "templateHash": "16595917199403663446"
},
"name": "Automation Accounts",
"description": "This module deploys an Azure Automation Account.",
@@ -146,15 +146,6 @@
"description": "Optional. Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -273,11 +264,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -286,16 +273,12 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
"enableReferencedModulesTelemetry": false,
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]"
},
diff --git a/modules/batch/batch-account/.test/common/main.test.bicep b/modules/batch/batch-account/.test/common/main.test.bicep
index f4fab0de97..b2fa9e7a62 100644
--- a/modules/batch/batch-account/.test/common/main.test.bicep
+++ b/modules/batch/batch-account/.test/common/main.test.bicep
@@ -66,7 +66,6 @@ module testDeployment '../../main.bicep' = {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
storageAccountId: nestedDependencies.outputs.storageAccountResourceId
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/batch/batch-account/README.md b/modules/batch/batch-account/README.md
index f1fffea321..85dcc30c05 100644
--- a/modules/batch/batch-account/README.md
+++ b/modules/batch/batch-account/README.md
@@ -47,7 +47,6 @@ This module deploys a Batch Account.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, ServiceLog]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -281,7 +280,6 @@ module batchAccount './batch/batch-account/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -348,9 +346,6 @@ module batchAccount './batch/batch-account/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/batch/batch-account/main.bicep b/modules/batch/batch-account/main.bicep
index 6c1bbcb34e..092005e322 100644
--- a/modules/batch/batch-account/main.bicep
+++ b/modules/batch/batch-account/main.bicep
@@ -58,11 +58,6 @@ param networkProfileDefaultAction string = 'Deny'
@description('Optional. Array of IP ranges to filter client IP address. It is only applicable when publicNetworkAccess is not explicitly disabled.')
param networkProfileAllowedIpRanges array = []
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -130,20 +125,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -151,10 +138,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? 'SystemAssigned' : !empty(userAssignedIdentities) ? 'UserAssigned' : 'None'
diff --git a/modules/batch/batch-account/main.json b/modules/batch/batch-account/main.json
index 882013e165..b2ff4246cc 100644
--- a/modules/batch/batch-account/main.json
+++ b/modules/batch/batch-account/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "7332956406118760498"
+ "templateHash": "10210928254812932351"
},
"name": "Batch Accounts",
"description": "This module deploys a Batch Account.",
@@ -118,15 +118,6 @@
"description": "Optional. Array of IP ranges to filter client IP address. It is only applicable when publicNetworkAccess is not explicitly disabled."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -255,11 +246,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -268,11 +255,7 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -284,7 +267,7 @@
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), 'SystemAssigned', if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": {
"type": "[variables('identityType')]",
diff --git a/modules/cache/redis/.test/common/main.test.bicep b/modules/cache/redis/.test/common/main.test.bicep
index 8ad4bad1cc..bc976f33b7 100644
--- a/modules/cache/redis/.test/common/main.test.bicep
+++ b/modules/cache/redis/.test/common/main.test.bicep
@@ -64,7 +64,6 @@ module testDeployment '../../main.bicep' = {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
capacity: 2
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/cache/redis/README.md b/modules/cache/redis/README.md
index bd0f43531d..b005689a95 100644
--- a/modules/cache/redis/README.md
+++ b/modules/cache/redis/README.md
@@ -37,7 +37,6 @@ This module deploys a Redis Cache.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, ConnectedClientList]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
@@ -375,7 +374,6 @@ module redis './cache/redis/main.bicep' = {
capacity: 2
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticSettingsName: 'redisdiagnostics'
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
@@ -441,9 +439,6 @@ module redis './cache/redis/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticSettingsName": {
"value": "redisdiagnostics"
},
diff --git a/modules/cache/redis/main.bicep b/modules/cache/redis/main.bicep
index af50133fca..172c38fa44 100644
--- a/modules/cache/redis/main.bicep
+++ b/modules/cache/redis/main.bicep
@@ -110,11 +110,6 @@ param privateEndpoints array = []
@description('Optional. The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings".')
param diagnosticSettingsName string = ''
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
param diagnosticStorageAccountId string = ''
@@ -153,20 +148,12 @@ var availabilityZones = skuName == 'Premium' ? zoneRedundant ? !empty(zones) ? z
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -174,10 +161,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? 'SystemAssigned' : !empty(userAssignedIdentities) ? 'UserAssigned' : 'None'
diff --git a/modules/cache/redis/main.json b/modules/cache/redis/main.json
index 714388b5d7..3545e1c592 100644
--- a/modules/cache/redis/main.json
+++ b/modules/cache/redis/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "18012960546079116650"
+ "templateHash": "16190276129118056203"
},
"name": "Redis Cache",
"description": "This module deploys a Redis Cache.",
@@ -215,15 +215,6 @@
"description": "Optional. The name of the diagnostic setting, if deployed. If left empty, it defaults to \"-diagnosticSettings\"."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -293,11 +284,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -306,16 +293,12 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
"availabilityZones": "[if(equals(parameters('skuName'), 'Premium'), if(parameters('zoneRedundant'), if(not(empty(parameters('zones'))), parameters('zones'), pickZones('Microsoft.Cache', 'redis', parameters('location'), 3)), createArray()), createArray())]",
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), 'SystemAssigned', if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": {
"type": "[variables('identityType')]",
diff --git a/modules/cognitive-services/account/.test/common/main.test.bicep b/modules/cognitive-services/account/.test/common/main.test.bicep
index 556ce7e70f..7a61062ca0 100644
--- a/modules/cognitive-services/account/.test/common/main.test.bicep
+++ b/modules/cognitive-services/account/.test/common/main.test.bicep
@@ -66,7 +66,6 @@ module testDeployment '../../main.bicep' = {
name: '${namePrefix}${serviceShort}001'
kind: 'Face'
customSubDomainName: '${namePrefix}xdomain'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/cognitive-services/account/README.md b/modules/cognitive-services/account/README.md
index 254afa3940..ce8fb6197a 100644
--- a/modules/cognitive-services/account/README.md
+++ b/modules/cognitive-services/account/README.md
@@ -51,7 +51,6 @@ This module deploys a Cognitive Service.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, Audit, RequestResponse]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -464,7 +463,6 @@ module account './cognitive-services/account/main.bicep' = {
customSubDomainName: 'xdomain'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -549,9 +547,6 @@ module account './cognitive-services/account/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/cognitive-services/account/main.bicep b/modules/cognitive-services/account/main.bicep
index ffa145e7f9..a91549ef74 100644
--- a/modules/cognitive-services/account/main.bicep
+++ b/modules/cognitive-services/account/main.bicep
@@ -57,11 +57,6 @@ param sku string = 'S0'
@description('Optional. Location for all Resources.')
param location string = resourceGroup().location
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -175,20 +170,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -196,10 +183,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var enableReferencedModulesTelemetry = false
diff --git a/modules/cognitive-services/account/main.json b/modules/cognitive-services/account/main.json
index 5cb00062d1..ab8819f327 100644
--- a/modules/cognitive-services/account/main.json
+++ b/modules/cognitive-services/account/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "16050279937194906672"
+ "templateHash": "3690928226777613324"
},
"name": "Cognitive Services",
"description": "This module deploys a Cognitive Service.",
@@ -81,15 +81,6 @@
"description": "Optional. Location for all Resources."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -324,11 +315,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -337,15 +324,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"enableReferencedModulesTelemetry": false,
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]"
diff --git a/modules/compute/virtual-machine-scale-set/.test/linux/main.test.bicep b/modules/compute/virtual-machine-scale-set/.test/linux/main.test.bicep
index d119ea7240..08c5931815 100644
--- a/modules/compute/virtual-machine-scale-set/.test/linux/main.test.bicep
+++ b/modules/compute/virtual-machine-scale-set/.test/linux/main.test.bicep
@@ -111,7 +111,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
disablePasswordAuthentication: true
encryptionAtHost: false
extensionCustomScriptConfig: {
diff --git a/modules/compute/virtual-machine-scale-set/.test/windows/main.test.bicep b/modules/compute/virtual-machine-scale-set/.test/windows/main.test.bicep
index 21a5d78570..c6694102a5 100644
--- a/modules/compute/virtual-machine-scale-set/.test/windows/main.test.bicep
+++ b/modules/compute/virtual-machine-scale-set/.test/windows/main.test.bicep
@@ -93,7 +93,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
encryptionAtHost: false
extensionAntiMalwareConfig: {
enabled: true
diff --git a/modules/compute/virtual-machine-scale-set/README.md b/modules/compute/virtual-machine-scale-set/README.md
index 4ec607b828..b0384b82da 100644
--- a/modules/compute/virtual-machine-scale-set/README.md
+++ b/modules/compute/virtual-machine-scale-set/README.md
@@ -54,7 +54,6 @@ The following resources are required to be able to deploy this resource.
| `dataDisks` | array | `[]` | | Specifies the data disks. For security reasons, it is recommended to specify DiskEncryptionSet into the dataDisk object. Restrictions: DiskEncryptionSet cannot be enabled if Azure Disk Encryption (guest-VM encryption using bitlocker/DM-Crypt) is enabled on your VM Scale sets. |
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
@@ -955,7 +954,6 @@ module virtualMachineScaleSet './compute/virtual-machine-scale-set/main.bicep' =
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
disablePasswordAuthentication: true
@@ -1119,9 +1117,6 @@ module virtualMachineScaleSet './compute/virtual-machine-scale-set/main.bicep' =
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -1609,7 +1604,6 @@ module virtualMachineScaleSet './compute/virtual-machine-scale-set/main.bicep' =
adminPassword: ''
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -1762,9 +1756,6 @@ module virtualMachineScaleSet './compute/virtual-machine-scale-set/main.bicep' =
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/compute/virtual-machine-scale-set/main.bicep b/modules/compute/virtual-machine-scale-set/main.bicep
index 129d0fbec0..fbd688e838 100644
--- a/modules/compute/virtual-machine-scale-set/main.bicep
+++ b/modules/compute/virtual-machine-scale-set/main.bicep
@@ -134,11 +134,6 @@ param bootDiagnosticStorageAccountUri string = '.blob.${environment().suffixes.s
@description('Optional. Storage account used to store boot diagnostic information. Boot diagnostics will be disabled if no value is provided.')
param bootDiagnosticStorageAccountName string = ''
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -293,10 +288,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var publicKeysFormatted = [for publicKey in publicKeys: {
diff --git a/modules/compute/virtual-machine-scale-set/main.json b/modules/compute/virtual-machine-scale-set/main.json
index e223005045..89b7b6a2ca 100644
--- a/modules/compute/virtual-machine-scale-set/main.json
+++ b/modules/compute/virtual-machine-scale-set/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "7835008553811642533"
+ "templateHash": "7715429520805746473"
},
"name": "Virtual Machine Scale Sets",
"description": "This module deploys a Virtual Machine Scale Set.",
@@ -273,15 +273,6 @@
"description": "Optional. Storage account used to store boot diagnostic information. Boot diagnostics will be disabled if no value is provided."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -601,11 +592,7 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
diff --git a/modules/compute/virtual-machine/.bicep/nested_networkInterface.bicep b/modules/compute/virtual-machine/.bicep/nested_networkInterface.bicep
index a89602200b..20386a51b8 100644
--- a/modules/compute/virtual-machine/.bicep/nested_networkInterface.bicep
+++ b/modules/compute/virtual-machine/.bicep/nested_networkInterface.bicep
@@ -12,7 +12,6 @@ param networkSecurityGroupResourceId string = ''
param ipConfigurations array
param lock string = ''
param diagnosticStorageAccountId string
-param diagnosticLogsRetentionInDays int
param diagnosticWorkspaceId string
param diagnosticEventHubAuthorizationRuleId string
param diagnosticEventHubName string
@@ -38,7 +37,6 @@ module networkInterface_publicIPAddresses '../../../network/public-ip-address/ma
diagnosticEventHubAuthorizationRuleId: diagnosticEventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticEventHubName
diagnosticLogCategoriesToEnable: pipdiagnosticLogCategoriesToEnable
- diagnosticLogsRetentionInDays: diagnosticLogsRetentionInDays
diagnosticMetricsToEnable: pipdiagnosticMetricsToEnable
diagnosticSettingsName: pipDiagnosticSettingsName
diagnosticStorageAccountId: diagnosticStorageAccountId
@@ -80,7 +78,6 @@ module networkInterface '../../../network/network-interface/main.bicep' = {
tags: tags
diagnosticEventHubAuthorizationRuleId: diagnosticEventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticEventHubName
- diagnosticLogsRetentionInDays: diagnosticLogsRetentionInDays
diagnosticStorageAccountId: diagnosticStorageAccountId
diagnosticMetricsToEnable: nicDiagnosticMetricsToEnable
diagnosticSettingsName: nicDiagnosticSettingsName
diff --git a/modules/compute/virtual-machine/.test/linux/main.test.bicep b/modules/compute/virtual-machine/.test/linux/main.test.bicep
index fc8e3b07af..f85bc4d585 100644
--- a/modules/compute/virtual-machine/.test/linux/main.test.bicep
+++ b/modules/compute/virtual-machine/.test/linux/main.test.bicep
@@ -166,7 +166,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
disablePasswordAuthentication: true
encryptionAtHost: false
extensionCustomScriptConfig: {
diff --git a/modules/compute/virtual-machine/.test/windows/main.test.bicep b/modules/compute/virtual-machine/.test/windows/main.test.bicep
index e39aa4f154..9e059f65ab 100644
--- a/modules/compute/virtual-machine/.test/windows/main.test.bicep
+++ b/modules/compute/virtual-machine/.test/windows/main.test.bicep
@@ -170,7 +170,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
encryptionAtHost: false
extensionAntiMalwareConfig: {
enabled: true
diff --git a/modules/compute/virtual-machine/README.md b/modules/compute/virtual-machine/README.md
index 318a35ef46..c5dcc52850 100644
--- a/modules/compute/virtual-machine/README.md
+++ b/modules/compute/virtual-machine/README.md
@@ -61,7 +61,6 @@ This module deploys a Virtual Machine with one or multiple NICs and optionally o
| `dedicatedHostId` | string | `''` | | Specifies resource ID about the dedicated host that the virtual machine resides in. |
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
| `disablePasswordAuthentication` | bool | `False` | | Specifies whether password authentication should be disabled. |
@@ -1137,7 +1136,6 @@ module virtualMachine './compute/virtual-machine/main.bicep' = {
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
disablePasswordAuthentication: true
@@ -1374,9 +1372,6 @@ module virtualMachine './compute/virtual-machine/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -1939,7 +1934,6 @@ module virtualMachine './compute/virtual-machine/main.bicep' = {
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableAutomaticUpdates: true
@@ -2195,9 +2189,6 @@ module virtualMachine './compute/virtual-machine/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/compute/virtual-machine/main.bicep b/modules/compute/virtual-machine/main.bicep
index bc4327b6af..3cd09f6b51 100644
--- a/modules/compute/virtual-machine/main.bicep
+++ b/modules/compute/virtual-machine/main.bicep
@@ -223,11 +223,6 @@ param extensionCustomScriptProtectedSetting object = {}
@description('Optional. Location for all resources.')
param location string = resourceGroup().location
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -399,7 +394,6 @@ module vm_nic '.bicep/nested_networkInterface.bicep' = [for (nicConfiguration, i
ipConfigurations: nicConfiguration.ipConfigurations
lock: lock
diagnosticStorageAccountId: diagnosticStorageAccountId
- diagnosticLogsRetentionInDays: diagnosticLogsRetentionInDays
diagnosticWorkspaceId: diagnosticWorkspaceId
diagnosticEventHubAuthorizationRuleId: diagnosticEventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticEventHubName
diff --git a/modules/compute/virtual-machine/main.json b/modules/compute/virtual-machine/main.json
index 7f11506213..7c0d0faab1 100644
--- a/modules/compute/virtual-machine/main.json
+++ b/modules/compute/virtual-machine/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "16260888276391715225"
+ "templateHash": "6083372606537708604"
},
"name": "Virtual Machines",
"description": "This module deploys a Virtual Machine with one or multiple NICs and optionally one or multiple public IPs.",
@@ -432,15 +432,6 @@
"description": "Optional. Location for all resources."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -821,9 +812,6 @@
"diagnosticStorageAccountId": {
"value": "[parameters('diagnosticStorageAccountId')]"
},
- "diagnosticLogsRetentionInDays": {
- "value": "[parameters('diagnosticLogsRetentionInDays')]"
- },
"diagnosticWorkspaceId": {
"value": "[parameters('diagnosticWorkspaceId')]"
},
@@ -857,7 +845,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "2403050015173417412"
+ "templateHash": "18368167306058144977"
}
},
"parameters": {
@@ -902,9 +890,6 @@
"diagnosticStorageAccountId": {
"type": "string"
},
- "diagnosticLogsRetentionInDays": {
- "type": "int"
- },
"diagnosticWorkspaceId": {
"type": "string"
},
@@ -976,9 +961,6 @@
"diagnosticLogCategoriesToEnable": {
"value": "[parameters('pipdiagnosticLogCategoriesToEnable')]"
},
- "diagnosticLogsRetentionInDays": {
- "value": "[parameters('diagnosticLogsRetentionInDays')]"
- },
"diagnosticMetricsToEnable": {
"value": "[parameters('pipdiagnosticMetricsToEnable')]"
},
@@ -1018,7 +1000,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "1083592604266553783"
+ "templateHash": "7444990895328873286"
},
"name": "Public IP Addresses",
"description": "This module deploys a Public IP Address.",
@@ -1089,15 +1071,6 @@
"description": "Optional. IP address version."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -1244,11 +1217,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -1257,15 +1226,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
@@ -1586,9 +1551,6 @@
"diagnosticEventHubName": {
"value": "[parameters('diagnosticEventHubName')]"
},
- "diagnosticLogsRetentionInDays": {
- "value": "[parameters('diagnosticLogsRetentionInDays')]"
- },
"diagnosticStorageAccountId": {
"value": "[parameters('diagnosticStorageAccountId')]"
},
@@ -1624,7 +1586,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "16443618351676529498"
+ "templateHash": "4973390307671682303"
},
"name": "Network Interface",
"description": "This module deploys a Network Interface.",
@@ -1744,15 +1706,6 @@
"description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -1809,11 +1762,7 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
]
diff --git a/modules/container-registry/registry/.test/common/main.test.bicep b/modules/container-registry/registry/.test/common/main.test.bicep
index 8460898be1..a2086f2f12 100644
--- a/modules/container-registry/registry/.test/common/main.test.bicep
+++ b/modules/container-registry/registry/.test/common/main.test.bicep
@@ -66,7 +66,6 @@ module testDeployment '../../main.bicep' = {
name: '${namePrefix}${serviceShort}001'
acrAdminUserEnabled: false
acrSku: 'Premium'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/container-registry/registry/README.md b/modules/container-registry/registry/README.md
index c632c2be87..563a2e27b0 100644
--- a/modules/container-registry/registry/README.md
+++ b/modules/container-registry/registry/README.md
@@ -52,7 +52,6 @@ This module deploys an Azure Container Registry (ACR).
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, ContainerRegistryLoginEvents, ContainerRegistryRepositoryEvents]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -393,7 +392,6 @@ module registry './container-registry/registry/main.bicep' = {
azureADAuthenticationAsArmPolicyStatus: 'enabled'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -489,9 +487,6 @@ module registry './container-registry/registry/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/container-registry/registry/main.bicep b/modules/container-registry/registry/main.bicep
index 68f470fdf9..74989bd260 100644
--- a/modules/container-registry/registry/main.bicep
+++ b/modules/container-registry/registry/main.bicep
@@ -155,11 +155,6 @@ param diagnosticMetricsToEnable array = [
'AllMetrics'
]
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -193,20 +188,12 @@ param cMKUserAssignedIdentityResourceId string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -214,10 +201,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? (!empty(userAssignedIdentities) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned') : (!empty(userAssignedIdentities) ? 'UserAssigned' : 'None')
diff --git a/modules/container-registry/registry/main.json b/modules/container-registry/registry/main.json
index eda677a8c3..53c6af6abb 100644
--- a/modules/container-registry/registry/main.json
+++ b/modules/container-registry/registry/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "13310604617859412118"
+ "templateHash": "6969483115486766809"
},
"name": "Azure Container Registries (ACR)",
"description": "This module deploys an Azure Container Registry (ACR).",
@@ -280,15 +280,6 @@
"description": "Optional. The name of metrics that will be streamed."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -367,11 +358,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -380,15 +367,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]",
"enableReferencedModulesTelemetry": false
diff --git a/modules/container-service/managed-cluster/.test/azure/main.test.bicep b/modules/container-service/managed-cluster/.test/azure/main.test.bicep
index 53e453d441..ae463a55e5 100644
--- a/modules/container-service/managed-cluster/.test/azure/main.test.bicep
+++ b/modules/container-service/managed-cluster/.test/azure/main.test.bicep
@@ -147,7 +147,6 @@ module testDeployment '../../main.bicep' = {
}
]
aksClusterNetworkPlugin: 'azure'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/container-service/managed-cluster/.test/kubenet/main.test.bicep b/modules/container-service/managed-cluster/.test/kubenet/main.test.bicep
index 617ca20c95..5faf01208e 100644
--- a/modules/container-service/managed-cluster/.test/kubenet/main.test.bicep
+++ b/modules/container-service/managed-cluster/.test/kubenet/main.test.bicep
@@ -135,7 +135,6 @@ module testDeployment '../../main.bicep' = {
}
]
aksClusterNetworkPlugin: 'kubenet'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/container-service/managed-cluster/.test/priv/main.test.bicep b/modules/container-service/managed-cluster/.test/priv/main.test.bicep
index 13fb056ec4..c5ace56db5 100644
--- a/modules/container-service/managed-cluster/.test/priv/main.test.bicep
+++ b/modules/container-service/managed-cluster/.test/priv/main.test.bicep
@@ -142,7 +142,6 @@ module testDeployment '../../main.bicep' = {
aksClusterSkuTier: 'Standard'
aksClusterDnsServiceIP: '10.10.200.10'
aksClusterServiceCidr: '10.10.200.0/24'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/container-service/managed-cluster/README.md b/modules/container-service/managed-cluster/README.md
index a601b0f019..88b9e2c128 100644
--- a/modules/container-service/managed-cluster/README.md
+++ b/modules/container-service/managed-cluster/README.md
@@ -86,7 +86,6 @@ This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, cluster-autoscaler, guard, kube-apiserver, kube-audit, kube-audit-admin, kube-controller-manager, kube-scheduler]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -476,7 +475,6 @@ module managedCluster './container-service/managed-cluster/main.bicep' = {
aksClusterNetworkPlugin: 'azure'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
diskEncryptionSetID: ''
@@ -661,9 +659,6 @@ module managedCluster './container-service/managed-cluster/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -853,7 +848,6 @@ module managedCluster './container-service/managed-cluster/main.bicep' = {
aksClusterNetworkPlugin: 'kubenet'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -977,9 +971,6 @@ module managedCluster './container-service/managed-cluster/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -1176,7 +1167,6 @@ module managedCluster './container-service/managed-cluster/main.bicep' = {
aksClusterSkuTier: 'Standard'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -1304,9 +1294,6 @@ module managedCluster './container-service/managed-cluster/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/container-service/managed-cluster/main.bicep b/modules/container-service/managed-cluster/main.bicep
index 7a0abfa63f..a07026f84b 100644
--- a/modules/container-service/managed-cluster/main.bicep
+++ b/modules/container-service/managed-cluster/main.bicep
@@ -284,11 +284,6 @@ param diagnosticEventHubAuthorizationRuleId string = ''
@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category.')
param diagnosticEventHubName string = ''
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true
@@ -346,20 +341,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -367,10 +354,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? 'SystemAssigned' : (!empty(userAssignedIdentities) ? 'UserAssigned' : 'None')
diff --git a/modules/container-service/managed-cluster/main.json b/modules/container-service/managed-cluster/main.json
index 05c57f5b90..505ad190f3 100644
--- a/modules/container-service/managed-cluster/main.json
+++ b/modules/container-service/managed-cluster/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "14635294437728407087"
+ "templateHash": "2499528815561589714"
},
"name": "Azure Kubernetes Service (AKS) Managed Clusters",
"description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.",
@@ -601,15 +601,6 @@
"description": "Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"enableDefaultTelemetry": {
"type": "bool",
"defaultValue": true,
@@ -711,11 +702,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -724,15 +711,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), 'SystemAssigned', if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": {
"type": "[variables('identityType')]",
diff --git a/modules/data-factory/factory/.test/common/main.test.bicep b/modules/data-factory/factory/.test/common/main.test.bicep
index 5b1ea3f79e..522aa02ad1 100644
--- a/modules/data-factory/factory/.test/common/main.test.bicep
+++ b/modules/data-factory/factory/.test/common/main.test.bicep
@@ -69,7 +69,6 @@ module testDeployment '../../main.bicep' = {
cMKKeyName: nestedDependencies.outputs.keyVaultEncryptionKeyName
cMKKeyVaultResourceId: nestedDependencies.outputs.keyVaultResourceId
cMKUserAssignedIdentityResourceId: nestedDependencies.outputs.managedIdentityResourceId
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/data-factory/factory/README.md b/modules/data-factory/factory/README.md
index 0bd8772cbb..fedd12666c 100644
--- a/modules/data-factory/factory/README.md
+++ b/modules/data-factory/factory/README.md
@@ -48,7 +48,6 @@ This module deploys a Data Factory.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', ActivityRuns, allLogs, PipelineRuns, SSISIntegrationRuntimeLogs, SSISPackageEventMessageContext, SSISPackageEventMessages, SSISPackageExecutableStatistics, SSISPackageExecutionComponentPhases, SSISPackageExecutionDataStatistics, TriggerRuns]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -403,7 +402,6 @@ module factory './data-factory/factory/main.bicep' = {
cMKUserAssignedIdentityResourceId: ''
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -509,9 +507,6 @@ module factory './data-factory/factory/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/data-factory/factory/main.bicep b/modules/data-factory/factory/main.bicep
index f4a7ae7072..ad5acd0751 100644
--- a/modules/data-factory/factory/main.bicep
+++ b/modules/data-factory/factory/main.bicep
@@ -55,11 +55,6 @@ param gitHostName string = ''
@description('Optional. List of Global Parameters for the factory.')
param globalParameters object = {}
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -133,20 +128,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -154,10 +141,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalId\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
diff --git a/modules/data-factory/factory/main.json b/modules/data-factory/factory/main.json
index 369413d9e0..f6dcaebbfa 100644
--- a/modules/data-factory/factory/main.json
+++ b/modules/data-factory/factory/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "6436757773314352599"
+ "templateHash": "10840135215067371071"
},
"name": "Data Factories",
"description": "This module deploys a Data Factory.",
@@ -128,15 +128,6 @@
"description": "Optional. List of Global Parameters for the factory."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -296,11 +287,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -309,15 +296,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]",
"enableReferencedModulesTelemetry": false
diff --git a/modules/databricks/workspace/.test/common/main.test.bicep b/modules/databricks/workspace/.test/common/main.test.bicep
index cad178b102..ff502e457c 100644
--- a/modules/databricks/workspace/.test/common/main.test.bicep
+++ b/modules/databricks/workspace/.test/common/main.test.bicep
@@ -67,7 +67,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
lock: 'CanNotDelete'
roleAssignments: [
{
diff --git a/modules/databricks/workspace/README.md b/modules/databricks/workspace/README.md
index d8e0d0bd23..bb9d78a717 100644
--- a/modules/databricks/workspace/README.md
+++ b/modules/databricks/workspace/README.md
@@ -34,7 +34,6 @@ This module deploys an Azure Databricks Workspace.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', accounts, allLogs, clusters, dbfs, instancePools, jobs, notebook, secrets, sqlPermissions, ssh, workspace]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
@@ -248,7 +247,6 @@ module workspace './databricks/workspace/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -293,9 +291,6 @@ module workspace './databricks/workspace/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/databricks/workspace/main.bicep b/modules/databricks/workspace/main.bicep
index 5c306dbc5e..585ff24171 100644
--- a/modules/databricks/workspace/main.bicep
+++ b/modules/databricks/workspace/main.bicep
@@ -25,11 +25,6 @@ param roleAssignments array = []
@description('Optional. The workspace\'s custom parameters.')
param parameters object = {}
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -81,20 +76,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
diff --git a/modules/databricks/workspace/main.json b/modules/databricks/workspace/main.json
index 4262ec18c2..2c5e42b8c7 100644
--- a/modules/databricks/workspace/main.json
+++ b/modules/databricks/workspace/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "3914896258609999885"
+ "templateHash": "17661847744091981452"
},
"name": "Azure Databricks Workspaces",
"description": "This module deploys an Azure Databricks Workspace.",
@@ -58,15 +58,6 @@
"description": "Optional. The workspace's custom parameters."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -159,15 +150,11 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"managedResourceGroupName": "[format('{0}-rg', parameters('name'))]",
"managedResourceGroupIdVar": "[format('{0}/resourceGroups/{1}', subscription().id, variables('managedResourceGroupName'))]"
},
diff --git a/modules/db-for-my-sql/flexible-server/.test/private/main.test.bicep b/modules/db-for-my-sql/flexible-server/.test/private/main.test.bicep
index 7610bb027e..b231316e74 100644
--- a/modules/db-for-my-sql/flexible-server/.test/private/main.test.bicep
+++ b/modules/db-for-my-sql/flexible-server/.test/private/main.test.bicep
@@ -108,6 +108,5 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
}
}
diff --git a/modules/db-for-my-sql/flexible-server/.test/public/main.test.bicep b/modules/db-for-my-sql/flexible-server/.test/public/main.test.bicep
index 80e9fb5864..8c2c60ec0d 100644
--- a/modules/db-for-my-sql/flexible-server/.test/public/main.test.bicep
+++ b/modules/db-for-my-sql/flexible-server/.test/public/main.test.bicep
@@ -156,6 +156,5 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
}
}
diff --git a/modules/db-for-my-sql/flexible-server/README.md b/modules/db-for-my-sql/flexible-server/README.md
index b9be319b7a..f75e0ea4e7 100644
--- a/modules/db-for-my-sql/flexible-server/README.md
+++ b/modules/db-for-my-sql/flexible-server/README.md
@@ -61,7 +61,6 @@ This module deploys a DBforMySQL Flexible Server.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, MySqlAuditLogs, MySqlSlowLogs]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -324,7 +323,6 @@ module flexibleServer './db-for-my-sql/flexible-server/main.bicep' = {
delegatedSubnetResourceId: ''
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -404,9 +402,6 @@ module flexibleServer './db-for-my-sql/flexible-server/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -503,7 +498,6 @@ module flexibleServer './db-for-my-sql/flexible-server/main.bicep' = {
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -619,9 +613,6 @@ module flexibleServer './db-for-my-sql/flexible-server/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/db-for-my-sql/flexible-server/main.bicep b/modules/db-for-my-sql/flexible-server/main.bicep
index 17e2f6914d..1b2e3623cb 100644
--- a/modules/db-for-my-sql/flexible-server/main.bicep
+++ b/modules/db-for-my-sql/flexible-server/main.bicep
@@ -176,11 +176,6 @@ param firewallRules array = []
@description('Optional. Array of role assignment objects that contain the "roleDefinitionIdOrName" and "principalId" to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: "/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11".')
param roleAssignments array = []
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -218,20 +213,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -239,10 +226,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
diff --git a/modules/db-for-my-sql/flexible-server/main.json b/modules/db-for-my-sql/flexible-server/main.json
index 29bf3f0dc4..ecfa7bf36e 100644
--- a/modules/db-for-my-sql/flexible-server/main.json
+++ b/modules/db-for-my-sql/flexible-server/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "10319315630521368786"
+ "templateHash": "8843810505050220871"
},
"name": "DBforMySQL Flexible Servers",
"description": "This module deploys a DBforMySQL Flexible Server.",
@@ -324,15 +324,6 @@
"description": "Optional. Array of role assignment objects that contain the \"roleDefinitionIdOrName\" and \"principalId\" to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \"/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\"."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -410,11 +401,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -423,15 +410,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None')]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]",
"enableReferencedModulesTelemetry": false
diff --git a/modules/db-for-postgre-sql/flexible-server/.test/private/main.test.bicep b/modules/db-for-postgre-sql/flexible-server/.test/private/main.test.bicep
index d4655ce3d2..1cf97fb1dd 100644
--- a/modules/db-for-postgre-sql/flexible-server/.test/private/main.test.bicep
+++ b/modules/db-for-postgre-sql/flexible-server/.test/private/main.test.bicep
@@ -99,7 +99,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
geoRedundantBackup: 'Enabled'
privateDnsZoneArmResourceId: nestedDependencies.outputs.privateDNSResourceId
tags: {
diff --git a/modules/db-for-postgre-sql/flexible-server/.test/public/main.test.bicep b/modules/db-for-postgre-sql/flexible-server/.test/public/main.test.bicep
index 021cae61be..6738b412df 100644
--- a/modules/db-for-postgre-sql/flexible-server/.test/public/main.test.bicep
+++ b/modules/db-for-postgre-sql/flexible-server/.test/public/main.test.bicep
@@ -99,7 +99,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
firewallRules: [
{
endIpAddress: '0.0.0.0'
diff --git a/modules/db-for-postgre-sql/flexible-server/README.md b/modules/db-for-postgre-sql/flexible-server/README.md
index d6a9a3a6db..75d89467cf 100644
--- a/modules/db-for-postgre-sql/flexible-server/README.md
+++ b/modules/db-for-postgre-sql/flexible-server/README.md
@@ -59,7 +59,6 @@ This module deploys a DBforPostgreSQL Flexible Server.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, PostgreSQLFlexDatabaseXacts, PostgreSQLFlexQueryStoreRuntime, PostgreSQLFlexQueryStoreWaitStats, PostgreSQLFlexSessions, PostgreSQLFlexTableStats, PostgreSQLLogs]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -477,7 +476,6 @@ module flexibleServer './db-for-postgre-sql/flexible-server/main.bicep' = {
delegatedSubnetResourceId: ''
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -555,9 +553,6 @@ module flexibleServer './db-for-postgre-sql/flexible-server/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -627,7 +622,6 @@ module flexibleServer './db-for-postgre-sql/flexible-server/main.bicep' = {
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -735,9 +729,6 @@ module flexibleServer './db-for-postgre-sql/flexible-server/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/db-for-postgre-sql/flexible-server/main.bicep b/modules/db-for-postgre-sql/flexible-server/main.bicep
index 48ff43f1c2..ce8495ec2a 100644
--- a/modules/db-for-postgre-sql/flexible-server/main.bicep
+++ b/modules/db-for-postgre-sql/flexible-server/main.bicep
@@ -144,11 +144,6 @@ param tags object = {}
@description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).')
param enableDefaultTelemetry bool = true
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -190,20 +185,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -211,10 +198,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var enableReferencedModulesTelemetry = false
diff --git a/modules/db-for-postgre-sql/flexible-server/main.json b/modules/db-for-postgre-sql/flexible-server/main.json
index 5cf324dc40..64868b74c1 100644
--- a/modules/db-for-postgre-sql/flexible-server/main.json
+++ b/modules/db-for-postgre-sql/flexible-server/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "12231440430796984538"
+ "templateHash": "1801764410852262795"
},
"name": "DBforPostgreSQL Flexible Servers",
"description": "This module deploys a DBforPostgreSQL Flexible Server.",
@@ -268,15 +268,6 @@
"description": "Optional. Enable telemetry via a Globally Unique Identifier (GUID)."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -351,11 +342,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -364,15 +351,11 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"enableReferencedModulesTelemetry": false
},
"resources": [
diff --git a/modules/desktop-virtualization/application-group/.test/common/main.test.bicep b/modules/desktop-virtualization/application-group/.test/common/main.test.bicep
index 442aa41fdd..d49d0c91f9 100644
--- a/modules/desktop-virtualization/application-group/.test/common/main.test.bicep
+++ b/modules/desktop-virtualization/application-group/.test/common/main.test.bicep
@@ -85,7 +85,6 @@ module testDeployment '../../main.bicep' = {
}
]
description: 'This is my first Remote Applications bundle'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/desktop-virtualization/application-group/README.md b/modules/desktop-virtualization/application-group/README.md
index 36c167f77a..0ea6d2af56 100644
--- a/modules/desktop-virtualization/application-group/README.md
+++ b/modules/desktop-virtualization/application-group/README.md
@@ -39,7 +39,6 @@ This module deploys an Azure Virtual Desktop (AVD) Application Group.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, Checkpoint, Error, Management]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of log analytics. |
@@ -207,7 +206,6 @@ module applicationGroup './desktop-virtualization/application-group/main.bicep'
description: 'This is my first Remote Applications bundle'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -283,9 +281,6 @@ module applicationGroup './desktop-virtualization/application-group/main.bicep'
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/desktop-virtualization/application-group/main.bicep b/modules/desktop-virtualization/application-group/main.bicep
index 4039305515..1323b46739 100644
--- a/modules/desktop-virtualization/application-group/main.bicep
+++ b/modules/desktop-virtualization/application-group/main.bicep
@@ -28,11 +28,6 @@ param description string = ''
@sys.description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalIds\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
param roleAssignments array = []
-@sys.description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@sys.description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -80,20 +75,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
diff --git a/modules/desktop-virtualization/application-group/main.json b/modules/desktop-virtualization/application-group/main.json
index 170247e1f1..273ac199e1 100644
--- a/modules/desktop-virtualization/application-group/main.json
+++ b/modules/desktop-virtualization/application-group/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "4271142083769712326"
+ "templateHash": "14308484478858567050"
},
"name": "Azure Virtual Desktop (AVD) Application Groups",
"description": "This module deploys an Azure Virtual Desktop (AVD) Application Group.",
@@ -63,15 +63,6 @@
"description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalIds' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -164,15 +155,11 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"enableReferencedModulesTelemetry": false
},
"resources": [
diff --git a/modules/desktop-virtualization/host-pool/.test/common/main.test.bicep b/modules/desktop-virtualization/host-pool/.test/common/main.test.bicep
index 49e0912547..6fb06b4407 100644
--- a/modules/desktop-virtualization/host-pool/.test/common/main.test.bicep
+++ b/modules/desktop-virtualization/host-pool/.test/common/main.test.bicep
@@ -64,7 +64,6 @@ module testDeployment '../../main.bicep' = {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
customRdpProperty: 'audiocapturemode:i:1;audiomode:i:0;drivestoredirect:s:;redirectclipboard:i:1;redirectcomports:i:1;redirectprinters:i:1;redirectsmartcards:i:1;screen mode id:i:2;'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/desktop-virtualization/host-pool/README.md b/modules/desktop-virtualization/host-pool/README.md
index cf9fecd33d..d12faf2c33 100644
--- a/modules/desktop-virtualization/host-pool/README.md
+++ b/modules/desktop-virtualization/host-pool/README.md
@@ -43,7 +43,6 @@ This module deploys an Azure Virtual Desktop (AVD) Host Pool.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', AgentHealthStatus, allLogs, Checkpoint, Connection, Error, HostRegistration, Management]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
@@ -312,7 +311,6 @@ module hostPool './desktop-virtualization/host-pool/main.bicep' = {
description: 'My first AVD Host Pool'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -403,9 +401,6 @@ module hostPool './desktop-virtualization/host-pool/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/desktop-virtualization/host-pool/main.bicep b/modules/desktop-virtualization/host-pool/main.bicep
index 2d089de365..483e0faa44 100644
--- a/modules/desktop-virtualization/host-pool/main.bicep
+++ b/modules/desktop-virtualization/host-pool/main.bicep
@@ -56,11 +56,6 @@ param tokenValidityLength string = 'PT8H'
@sys.description('Generated. Do not provide a value! This date value is used to generate a registration token.')
param baseTime string = utcNow('u')
-@sys.description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@sys.description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -147,7 +142,6 @@ param agentUpdate object = {
useSessionHostLocalTime: agentUpdateUseSessionHostLocalTime
}
-
@sys.description('Optional. The ring number of HostPool.')
param ring int = -1
@@ -193,20 +187,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
diff --git a/modules/desktop-virtualization/host-pool/main.json b/modules/desktop-virtualization/host-pool/main.json
index 05c271e247..fa73ba0804 100644
--- a/modules/desktop-virtualization/host-pool/main.json
+++ b/modules/desktop-virtualization/host-pool/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "4343458638136186821"
+ "templateHash": "11648715346210984085"
},
"name": "Azure Virtual Desktop (AVD) Host Pools",
"description": "This module deploys an Azure Virtual Desktop (AVD) Host Pool.",
@@ -117,15 +117,6 @@
"description": "Generated. Do not provide a value! This date value is used to generate a registration token."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -356,15 +347,11 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"tokenExpirationTime": "[dateTimeAdd(parameters('baseTime'), parameters('tokenValidityLength'))]"
},
"resources": [
diff --git a/modules/desktop-virtualization/scaling-plan/.test/common/main.test.bicep b/modules/desktop-virtualization/scaling-plan/.test/common/main.test.bicep
index d89579726b..e2704b6908 100644
--- a/modules/desktop-virtualization/scaling-plan/.test/common/main.test.bicep
+++ b/modules/desktop-virtualization/scaling-plan/.test/common/main.test.bicep
@@ -72,7 +72,6 @@ module testDeployment '../../main.bicep' = {
principalType: 'ServicePrincipal'
}
]
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/desktop-virtualization/scaling-plan/README.md b/modules/desktop-virtualization/scaling-plan/README.md
index 28ec89ea82..b964c6f5bb 100644
--- a/modules/desktop-virtualization/scaling-plan/README.md
+++ b/modules/desktop-virtualization/scaling-plan/README.md
@@ -34,7 +34,6 @@ This module deploys an Azure Virtual Desktop (AVD) Scaling Plan.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, Autoscale]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
| `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). |
@@ -286,7 +285,6 @@ module scalingPlan './desktop-virtualization/scaling-plan/main.bicep' = {
description: 'My Scaling Plan Description'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -335,9 +333,6 @@ module scalingPlan './desktop-virtualization/scaling-plan/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/desktop-virtualization/scaling-plan/main.bicep b/modules/desktop-virtualization/scaling-plan/main.bicep
index aca6eb13b3..dab1c3fff6 100644
--- a/modules/desktop-virtualization/scaling-plan/main.bicep
+++ b/modules/desktop-virtualization/scaling-plan/main.bicep
@@ -75,11 +75,6 @@ param hostPoolReferences array = []
@sys.description('Optional. Tags of the resource.')
param tags object = {}
-@sys.description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@sys.description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -111,20 +106,12 @@ param diagnosticLogCategoriesToEnable array = [
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
diff --git a/modules/desktop-virtualization/scaling-plan/main.json b/modules/desktop-virtualization/scaling-plan/main.json
index 806e6ad673..de51fe69a8 100644
--- a/modules/desktop-virtualization/scaling-plan/main.json
+++ b/modules/desktop-virtualization/scaling-plan/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "12746369585397346808"
+ "templateHash": "10391957957992354423"
},
"name": "Azure Virtual Desktop (AVD) Scaling Plans",
"description": "This module deploys an Azure Virtual Desktop (AVD) Scaling Plan.",
@@ -124,15 +124,6 @@
"description": "Optional. Tags of the resource."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -197,15 +188,11 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
diff --git a/modules/desktop-virtualization/workspace/.test/common/main.test.bicep b/modules/desktop-virtualization/workspace/.test/common/main.test.bicep
index 8d0ec90d33..47db31d8fa 100644
--- a/modules/desktop-virtualization/workspace/.test/common/main.test.bicep
+++ b/modules/desktop-virtualization/workspace/.test/common/main.test.bicep
@@ -68,7 +68,6 @@ module testDeployment '../../main.bicep' = {
appGroupResourceIds: [
nestedDependencies.outputs.applicationGroupResourceId
]
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/desktop-virtualization/workspace/README.md b/modules/desktop-virtualization/workspace/README.md
index f1be8d6dec..dc530682df 100644
--- a/modules/desktop-virtualization/workspace/README.md
+++ b/modules/desktop-virtualization/workspace/README.md
@@ -36,7 +36,6 @@ This module deploys an Azure Virtual Desktop (AVD) Workspace.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, Checkpoint, Error, Feed, Management]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
| `diagnosticWorkspaceId` | string | `''` | | Resource ID of the diagnostic log analytics workspace. |
@@ -187,7 +186,6 @@ module workspace './desktop-virtualization/workspace/main.bicep' = {
description: 'This is my first AVD Workspace'
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -242,9 +240,6 @@ module workspace './desktop-virtualization/workspace/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/desktop-virtualization/workspace/main.bicep b/modules/desktop-virtualization/workspace/main.bicep
index c3a018fa0e..6cf547dee5 100644
--- a/modules/desktop-virtualization/workspace/main.bicep
+++ b/modules/desktop-virtualization/workspace/main.bicep
@@ -17,11 +17,6 @@ param friendlyName string = ''
@sys.description('Optional. The description of the Workspace to be created.')
param description string = ''
-@sys.description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@sys.description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -70,20 +65,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
diff --git a/modules/desktop-virtualization/workspace/main.json b/modules/desktop-virtualization/workspace/main.json
index e18453d7f2..04f72d5514 100644
--- a/modules/desktop-virtualization/workspace/main.json
+++ b/modules/desktop-virtualization/workspace/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "7035285655295461424"
+ "templateHash": "5583996217532008926"
},
"name": "Azure Virtual Desktop (AVD) Workspaces",
"description": "This module deploys an Azure Virtual Desktop (AVD) Workspace.",
@@ -46,15 +46,6 @@
"description": "Optional. The description of the Workspace to be created."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -148,15 +139,11 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
diff --git a/modules/digital-twins/digital-twins-instance/.test/common/main.test.bicep b/modules/digital-twins/digital-twins-instance/.test/common/main.test.bicep
index 02d6f60bdb..e40037c573 100644
--- a/modules/digital-twins/digital-twins-instance/.test/common/main.test.bicep
+++ b/modules/digital-twins/digital-twins-instance/.test/common/main.test.bicep
@@ -87,7 +87,6 @@ module testDeployment '../../main.bicep' = {
userAssignedIdentities: {
'${nestedDependencies.outputs.managedIdentityResourceId}': {}
}
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/digital-twins/digital-twins-instance/README.md b/modules/digital-twins/digital-twins-instance/README.md
index 7a0290e41c..43768dff83 100644
--- a/modules/digital-twins/digital-twins-instance/README.md
+++ b/modules/digital-twins/digital-twins-instance/README.md
@@ -38,7 +38,6 @@ This module deploys an Azure Digital Twins Instance.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, DataHistoryOperation, DigitalTwinsOperation, EventRoutesOperation, ModelsOperation, QueryOperation, ResourceProviderOperation]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `[format('{0}-diagnosticSettings', parameters('name'))]` | | The name of the diagnostic setting, if deployed. |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
@@ -458,7 +457,6 @@ module digitalTwinsInstance './digital-twins/digital-twins-instance/main.bicep'
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -533,9 +531,6 @@ module digitalTwinsInstance './digital-twins/digital-twins-instance/main.bicep'
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/digital-twins/digital-twins-instance/main.bicep b/modules/digital-twins/digital-twins-instance/main.bicep
index 63c51286ce..c2dd816a8d 100644
--- a/modules/digital-twins/digital-twins-instance/main.bicep
+++ b/modules/digital-twins/digital-twins-instance/main.bicep
@@ -53,11 +53,6 @@ param diagnosticSettingsName string = '${name}-diagnosticSettings'
@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
param diagnosticStorageAccountId string = ''
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
param diagnosticWorkspaceId string = ''
@@ -108,20 +103,12 @@ var identity = identityType != 'None' ? {
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -129,10 +116,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
diff --git a/modules/digital-twins/digital-twins-instance/main.json b/modules/digital-twins/digital-twins-instance/main.json
index 60cf590f99..3ea197b9bd 100644
--- a/modules/digital-twins/digital-twins-instance/main.json
+++ b/modules/digital-twins/digital-twins-instance/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "11002137237777155291"
+ "templateHash": "8772718651117933838"
},
"name": "Digital Twins Instances",
"description": "This module deploys an Azure Digital Twins Instance.",
@@ -114,15 +114,6 @@
"description": "Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticWorkspaceId": {
"type": "string",
"defaultValue": "",
@@ -197,11 +188,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -210,18 +197,14 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
"enableReferencedModulesTelemetry": false,
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned, UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]",
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
diff --git a/modules/document-db/database-account/.test/gremlindb/main.test.bicep b/modules/document-db/database-account/.test/gremlindb/main.test.bicep
index 8d67918a57..98abd55438 100644
--- a/modules/document-db/database-account/.test/gremlindb/main.test.bicep
+++ b/modules/document-db/database-account/.test/gremlindb/main.test.bicep
@@ -82,7 +82,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
gremlinDatabases: [
{
graphs: [
diff --git a/modules/document-db/database-account/.test/mongodb/main.test.bicep b/modules/document-db/database-account/.test/mongodb/main.test.bicep
index 287ff5759c..bd0e8f4fa8 100644
--- a/modules/document-db/database-account/.test/mongodb/main.test.bicep
+++ b/modules/document-db/database-account/.test/mongodb/main.test.bicep
@@ -79,7 +79,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
location: location
mongodbDatabases: [
{
diff --git a/modules/document-db/database-account/.test/plain/main.test.bicep b/modules/document-db/database-account/.test/plain/main.test.bicep
index d0a7345316..23071b8799 100644
--- a/modules/document-db/database-account/.test/plain/main.test.bicep
+++ b/modules/document-db/database-account/.test/plain/main.test.bicep
@@ -79,7 +79,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
lock: 'CanNotDelete'
roleAssignments: [
{
diff --git a/modules/document-db/database-account/.test/sqldb/main.test.bicep b/modules/document-db/database-account/.test/sqldb/main.test.bicep
index 711dfcf861..ba9288205b 100644
--- a/modules/document-db/database-account/.test/sqldb/main.test.bicep
+++ b/modules/document-db/database-account/.test/sqldb/main.test.bicep
@@ -80,7 +80,6 @@ module testDeployment '../../main.bicep' = {
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
- diagnosticLogsRetentionInDays: 7
location: location
privateEndpoints: [
{
diff --git a/modules/document-db/database-account/README.md b/modules/document-db/database-account/README.md
index ace60aa802..72f4640a8a 100644
--- a/modules/document-db/database-account/README.md
+++ b/modules/document-db/database-account/README.md
@@ -52,7 +52,6 @@ This module deploys a DocumentDB Database Account.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, CassandraRequests, ControlPlaneRequests, DataPlaneRequests, GremlinRequests, MongoRequests, PartitionKeyRUConsumption, PartitionKeyStatistics, QueryRuntimeStatistics, TableApiRequests]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[Requests]` | `[Requests]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -682,7 +681,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
]
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -795,9 +793,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -914,7 +909,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -1158,9 +1152,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -1413,7 +1404,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -1472,9 +1462,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
@@ -1538,7 +1525,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -1691,9 +1677,6 @@ module databaseAccount './document-db/database-account/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/document-db/database-account/main.bicep b/modules/document-db/database-account/main.bicep
index c4e5faface..9d148d775c 100644
--- a/modules/document-db/database-account/main.bicep
+++ b/modules/document-db/database-account/main.bicep
@@ -84,11 +84,6 @@ param lock string = ''
@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalIds\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
param roleAssignments array = []
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -179,20 +174,12 @@ param privateEndpoints array = []
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -200,10 +187,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var identityType = systemAssignedIdentity ? (!empty(userAssignedIdentities) ? 'SystemAssigned, UserAssigned' : 'SystemAssigned') : (!empty(userAssignedIdentities) ? 'UserAssigned' : 'None')
diff --git a/modules/document-db/database-account/main.json b/modules/document-db/database-account/main.json
index 7a022723c9..c5f9ce0bac 100644
--- a/modules/document-db/database-account/main.json
+++ b/modules/document-db/database-account/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "15745659203746227223"
+ "templateHash": "17230929813729114087"
},
"name": "DocumentDB Database Accounts",
"description": "This module deploys a DocumentDB Database Account.",
@@ -168,15 +168,6 @@
"description": "Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalIds' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -328,11 +319,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -341,11 +328,7 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -365,7 +348,7 @@
}
}
],
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]",
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned, UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]",
"consistencyPolicy": {
diff --git a/modules/event-grid/domain/.test/common/main.test.bicep b/modules/event-grid/domain/.test/common/main.test.bicep
index 062266742e..2bbe444ed6 100644
--- a/modules/event-grid/domain/.test/common/main.test.bicep
+++ b/modules/event-grid/domain/.test/common/main.test.bicep
@@ -64,7 +64,6 @@ module testDeployment '../../main.bicep' = {
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/event-grid/domain/README.md b/modules/event-grid/domain/README.md
index fded127219..97d325a857 100644
--- a/modules/event-grid/domain/README.md
+++ b/modules/event-grid/domain/README.md
@@ -39,7 +39,6 @@ This module deploys an Event Grid Domain.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, DeliveryFailures, PublishFailures]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -294,7 +293,6 @@ module domain './event-grid/domain/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -363,9 +361,6 @@ module domain './event-grid/domain/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/event-grid/domain/main.bicep b/modules/event-grid/domain/main.bicep
index 91dac314a3..853973234c 100644
--- a/modules/event-grid/domain/main.bicep
+++ b/modules/event-grid/domain/main.bicep
@@ -25,11 +25,6 @@ param autoDeleteTopicWithLastSubscription bool = true
@description('Optional. This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled.')
param inboundIpRules array = []
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -92,20 +87,12 @@ var enableReferencedModulesTelemetry = false
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -113,10 +100,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
diff --git a/modules/event-grid/domain/main.json b/modules/event-grid/domain/main.json
index bfac7ef678..3c01e2fcef 100644
--- a/modules/event-grid/domain/main.json
+++ b/modules/event-grid/domain/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "5956133578937811234"
+ "templateHash": "15864855878909112039"
},
"name": "Event Grid Domains",
"description": "This module deploys an Event Grid Domain.",
@@ -58,15 +58,6 @@
"description": "Optional. This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -184,11 +175,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -197,16 +184,12 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
"enableReferencedModulesTelemetry": false,
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
diff --git a/modules/event-grid/system-topic/.test/common/main.test.bicep b/modules/event-grid/system-topic/.test/common/main.test.bicep
index e115ce165c..3499151049 100644
--- a/modules/event-grid/system-topic/.test/common/main.test.bicep
+++ b/modules/event-grid/system-topic/.test/common/main.test.bicep
@@ -89,7 +89,6 @@ module testDeployment '../../main.bicep' = {
}
}
} ]
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/event-grid/system-topic/README.md b/modules/event-grid/system-topic/README.md
index cb654ff3eb..a2e2b0e2e0 100644
--- a/modules/event-grid/system-topic/README.md
+++ b/modules/event-grid/system-topic/README.md
@@ -37,7 +37,6 @@ This module deploys an Event Grid System Topic.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, DeliveryFailures]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -296,7 +295,6 @@ module systemTopic './event-grid/system-topic/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: ''
enableDefaultTelemetry: ''
@@ -371,9 +369,6 @@ module systemTopic './event-grid/system-topic/main.bicep' = {
"diagnosticEventHubName": {
"value": ""
},
- "diagnosticLogsRetentionInDays": {
- "value": 7
- },
"diagnosticStorageAccountId": {
"value": ""
},
diff --git a/modules/event-grid/system-topic/main.bicep b/modules/event-grid/system-topic/main.bicep
index 1b94c2cc93..5358a5ea6f 100644
--- a/modules/event-grid/system-topic/main.bicep
+++ b/modules/event-grid/system-topic/main.bicep
@@ -17,11 +17,6 @@ param topicType string
@description('Optional. Event subscriptions to deploy.')
param eventSubscriptions array = []
-@description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.')
-@minValue(0)
-@maxValue(365)
-param diagnosticLogsRetentionInDays int = 365
-
@description('Optional. Resource ID of the diagnostic storage account.')
param diagnosticStorageAccountId string = ''
@@ -88,20 +83,12 @@ param diagnosticSettingsName string = ''
var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs' && item != ''): {
category: category
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [
{
categoryGroup: 'allLogs'
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}
] : contains(diagnosticLogCategoriesToEnable, '') ? [] : diagnosticsLogsSpecified
@@ -109,10 +96,6 @@ var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: {
category: metric
timeGrain: null
enabled: true
- retentionPolicy: {
- enabled: true
- days: diagnosticLogsRetentionInDays
- }
}]
resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) {
diff --git a/modules/event-grid/system-topic/main.json b/modules/event-grid/system-topic/main.json
index 936282955d..a00048c3e8 100644
--- a/modules/event-grid/system-topic/main.json
+++ b/modules/event-grid/system-topic/main.json
@@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.20.4.51522",
- "templateHash": "7858603597475288436"
+ "templateHash": "16335082464583916112"
},
"name": "Event Grid System Topics",
"description": "This module deploys an Event Grid System Topic.",
@@ -44,15 +44,6 @@
"description": "Optional. Event subscriptions to deploy."
}
},
- "diagnosticLogsRetentionInDays": {
- "type": "int",
- "defaultValue": 365,
- "minValue": 0,
- "maxValue": 365,
- "metadata": {
- "description": "Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely."
- }
- },
"diagnosticStorageAccountId": {
"type": "string",
"defaultValue": "",
@@ -169,11 +160,7 @@
"count": "[length(filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), ''))))))]",
"input": {
"category": "[filter(parameters('diagnosticLogCategoriesToEnable'), lambda('item', and(not(equals(lambdaVariables('item'), 'allLogs')), not(equals(lambdaVariables('item'), '')))))[copyIndex('diagnosticsLogsSpecified')]]",
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
},
{
@@ -182,17 +169,13 @@
"input": {
"category": "[parameters('diagnosticMetricsToEnable')[copyIndex('diagnosticsMetrics')]]",
"timeGrain": null,
- "enabled": true,
- "retentionPolicy": {
- "enabled": true,
- "days": "[parameters('diagnosticLogsRetentionInDays')]"
- }
+ "enabled": true
}
}
],
"identityType": "[if(parameters('systemAssignedIdentity'), if(not(empty(parameters('userAssignedIdentities'))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(parameters('userAssignedIdentities'))), 'UserAssigned', 'None'))]",
"identity": "[if(not(equals(variables('identityType'), 'None')), createObject('type', variables('identityType'), 'userAssignedIdentities', if(not(empty(parameters('userAssignedIdentities'))), parameters('userAssignedIdentities'), null())), null())]",
- "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true(), 'retentionPolicy', createObject('enabled', true(), 'days', parameters('diagnosticLogsRetentionInDays')))), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
+ "diagnosticsLogs": "[if(contains(parameters('diagnosticLogCategoriesToEnable'), 'allLogs'), createArray(createObject('categoryGroup', 'allLogs', 'enabled', true())), if(contains(parameters('diagnosticLogCategoriesToEnable'), ''), createArray(), variables('diagnosticsLogsSpecified')))]"
},
"resources": [
{
diff --git a/modules/event-grid/topic/.test/common/main.test.bicep b/modules/event-grid/topic/.test/common/main.test.bicep
index 5bc6af6b1b..0b2f474962 100644
--- a/modules/event-grid/topic/.test/common/main.test.bicep
+++ b/modules/event-grid/topic/.test/common/main.test.bicep
@@ -66,7 +66,6 @@ module testDeployment '../../main.bicep' = {
params: {
enableDefaultTelemetry: enableDefaultTelemetry
name: '${namePrefix}${serviceShort}001'
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId
diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
diff --git a/modules/event-grid/topic/README.md b/modules/event-grid/topic/README.md
index 8f0ed6de87..f6adfeea5f 100644
--- a/modules/event-grid/topic/README.md
+++ b/modules/event-grid/topic/README.md
@@ -37,7 +37,6 @@ This module deploys an Event Grid Topic.
| `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
| `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. |
| `diagnosticLogCategoriesToEnable` | array | `[allLogs]` | `['', allLogs, DeliveryFailures, PublishFailures]` | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
-| `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. |
| `diagnosticMetricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. |
| `diagnosticSettingsName` | string | `''` | | The name of the diagnostic setting, if deployed. If left empty, it defaults to "-diagnosticSettings". |
| `diagnosticStorageAccountId` | string | `''` | | Resource ID of the diagnostic storage account. |
@@ -365,7 +364,6 @@ module topic './event-grid/topic/main.bicep' = {
// Non-required parameters
diagnosticEventHubAuthorizationRuleId: ''
diagnosticEventHubName: ''
- diagnosticLogsRetentionInDays: 7
diagnosticStorageAccountId: ''
diagnosticWorkspaceId: '