diff --git a/modules/Microsoft.Network/virtualNetworks/.test/common/deploy.test.bicep b/modules/Microsoft.Network/virtualNetworks/.test/common/deploy.test.bicep index 233a3ff05e..da6922faf7 100644 --- a/modules/Microsoft.Network/virtualNetworks/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Network/virtualNetworks/.test/common/deploy.test.bicep @@ -31,9 +31,9 @@ module resourceGroupResources 'dependencies.bicep' = { scope: resourceGroup name: '${uniqueString(deployment().name, location)}-paramNested' params: { - managedIdentityName: 'dep-<>-msi-${serviceShort}' - routeTableName: 'dep-<>-rt-${serviceShort}' - networkSecurityGroupName: 'dep-<>-nsg-${serviceShort}' + managedIdentityName: 'dep-ses-msi-${serviceShort}' + routeTableName: 'dep-ses-rt-${serviceShort}' + networkSecurityGroupName: 'dep-ses-nsg-${serviceShort}' } } @@ -43,10 +43,10 @@ module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnost scope: resourceGroup name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' params: { - storageAccountName: 'dep<>diasa${serviceShort}01' - logAnalyticsWorkspaceName: 'dep-<>-law-${serviceShort}' - eventHubNamespaceEventHubName: 'dep-<>-evh-${serviceShort}' - eventHubNamespaceName: 'dep-<>-evhns-${serviceShort}' + storageAccountName: 'depsesdiasa${serviceShort}01' + logAnalyticsWorkspaceName: 'dep-ses-law-${serviceShort}' + eventHubNamespaceEventHubName: 'dep-ses-evh-${serviceShort}' + eventHubNamespaceName: 'dep-ses-evhns-${serviceShort}' location: location } } @@ -60,7 +60,7 @@ module testDeployment '../../deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { enableDefaultTelemetry: enableDefaultTelemetry - name: '<>${serviceShort}001' + name: 'ses${serviceShort}001' addressPrefixes: [ '10.0.0.0/16' ] @@ -90,7 +90,7 @@ module testDeployment '../../deploy.bicep' = { } { addressPrefix: '10.0.0.0/24' - name: '<>-az-subnet-x-001' + name: 'ses-az-subnet-x-001' networkSecurityGroupId: resourceGroupResources.outputs.networkSecurityGroupResourceId roleAssignments: [ { @@ -121,11 +121,11 @@ module testDeployment '../../deploy.bicep' = { } } ] - name: '<>-az-subnet-x-002' + name: 'ses-az-subnet-x-002' } { addressPrefix: '10.0.6.0/24' - name: '<>-az-subnet-x-003' + name: 'ses-az-subnet-x-003' privateEndpointNetworkPolicies: 'Disabled' privateLinkServiceNetworkPolicies: 'Enabled' } diff --git a/modules/Microsoft.Network/virtualNetworks/.test/min/deploy.test.bicep b/modules/Microsoft.Network/virtualNetworks/.test/min/deploy.test.bicep index 3242dcac70..1655511ca2 100644 --- a/modules/Microsoft.Network/virtualNetworks/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/virtualNetworks/.test/min/deploy.test.bicep @@ -36,7 +36,7 @@ module testDeployment '../../deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { enableDefaultTelemetry: enableDefaultTelemetry - name: '<>${serviceShort}001' + name: 'ses${serviceShort}001' addressPrefixes: [ '10.0.0.0/16' ] diff --git a/modules/Microsoft.Network/virtualNetworks/deploy.bicep b/modules/Microsoft.Network/virtualNetworks/deploy.bicep index ad6bb6463c..cb033a85ed 100644 --- a/modules/Microsoft.Network/virtualNetworks/deploy.bicep +++ b/modules/Microsoft.Network/virtualNetworks/deploy.bicep @@ -53,12 +53,13 @@ param tags object = {} @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true -@description('Optional. The name of logs that will be streamed.') +@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource.') @allowed([ + 'allLogs' 'VMProtectionAlerts' ]) param diagnosticLogCategoriesToEnable array = [ - 'VMProtectionAlerts' + 'allLogs' ] @description('Optional. The name of metrics that will be streamed.') @@ -72,7 +73,7 @@ param diagnosticMetricsToEnable array = [ @description('Optional. The name of the diagnostic setting, if deployed.') param diagnosticSettingsName string = '${name}-diagnosticSettings' -var diagnosticsLogs = [for category in diagnosticLogCategoriesToEnable: { +var diagnosticsLogsSpecified = [for category in filter(diagnosticLogCategoriesToEnable, item => item != 'allLogs'): { category: category enabled: true retentionPolicy: { @@ -81,6 +82,17 @@ var diagnosticsLogs = [for category in diagnosticLogCategoriesToEnable: { } }] +var diagnosticsLogs = contains(diagnosticLogCategoriesToEnable, 'allLogs') ? [ + { + categoryGroup: 'allLogs' + enabled: true + retentionPolicy: { + enabled: true + days: diagnosticLogsRetentionInDays + } + } +] : diagnosticsLogsSpecified + var diagnosticsMetrics = [for metric in diagnosticMetricsToEnable: { category: metric timeGrain: null @@ -265,3 +277,5 @@ output subnetResourceIds array = [for subnet in subnets: az.resourceId('Microsof @description('The location the resource was deployed into.') output location string = virtualNetwork.location + +output diagnosticsLogs array = diagnosticsLogs