diff --git a/modules/aad/domain-service/README.md b/modules/aad/domain-service/README.md index f228fda2f2..1e6faab9e8 100644 --- a/modules/aad/domain-service/README.md +++ b/modules/aad/domain-service/README.md @@ -546,7 +546,6 @@ The value is to enable on-premises users to authenticate against managed domain. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `tlsV1` diff --git a/modules/aad/domain-service/main.bicep b/modules/aad/domain-service/main.bicep index 5a05dd6d1e..a8ded242da 100644 --- a/modules/aad/domain-service/main.bicep +++ b/modules/aad/domain-service/main.bicep @@ -119,7 +119,7 @@ param ldaps string = 'Enabled' param diagnosticSettings diagnosticSettingType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/aad/domain-service/main.json b/modules/aad/domain-service/main.json index f3f96a4b68..6e3976bfcc 100644 --- a/modules/aad/domain-service/main.json +++ b/modules/aad/domain-service/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3764501671926247856" + "templateHash": "10052117540394396974" }, "name": "Azure Active Directory Domain Services", "description": "This module deploys an Azure Active Directory Domain Services (AADDS).", @@ -390,7 +390,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/analysis-services/server/README.md b/modules/analysis-services/server/README.md index f5f30b2bdb..ded6d13e0a 100644 --- a/modules/analysis-services/server/README.md +++ b/modules/analysis-services/server/README.md @@ -625,7 +625,6 @@ The SKU name of the Azure Analysis Services server to create. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/analysis-services/server/main.bicep b/modules/analysis-services/server/main.bicep index 3bbaeaf07c..ef66dfa060 100644 --- a/modules/analysis-services/server/main.bicep +++ b/modules/analysis-services/server/main.bicep @@ -36,7 +36,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/analysis-services/server/main.json b/modules/analysis-services/server/main.json index ee85f05ff5..3066c30ae2 100644 --- a/modules/analysis-services/server/main.json +++ b/modules/analysis-services/server/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "7051724089747387450" + "templateHash": "17464709928355207715" }, "name": "Analysis Services Servers", "description": "This module deploys an Analysis Services Server.", @@ -275,7 +275,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/api-management/service/README.md b/modules/api-management/service/README.md index 8a7569241b..411ee60b8f 100644 --- a/modules/api-management/service/README.md +++ b/modules/api-management/service/README.md @@ -1115,7 +1115,6 @@ Subscriptions. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `virtualNetworkType` diff --git a/modules/api-management/service/main.bicep b/modules/api-management/service/main.bicep index 9d7119f4b8..596354a682 100644 --- a/modules/api-management/service/main.bicep +++ b/modules/api-management/service/main.bicep @@ -75,7 +75,7 @@ param skuCount int = 1 param subnetResourceId string = '' @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only.') @allowed([ @@ -330,7 +330,7 @@ module service_namedValues 'named-value/main.bicep' = [for (namedValue, index) i displayName: namedValue.displayName keyVault: contains(namedValue, 'keyVault') ? namedValue.keyVault : {} name: namedValue.name - tags: contains(namedValue, 'tags') ? namedValue.tags : [] + tags: namedValue.?tags // Note: these are not resource tags secret: contains(namedValue, 'secret') ? namedValue.secret : false value: contains(namedValue, 'value') ? namedValue.value : newGuidValue enableDefaultTelemetry: enableReferencedModulesTelemetry diff --git a/modules/api-management/service/main.json b/modules/api-management/service/main.json index 53e81dd1bd..fa27d9cfdc 100644 --- a/modules/api-management/service/main.json +++ b/modules/api-management/service/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3274387832095626640" + "templateHash": "10340171795894114862" }, "name": "API Management Services", "description": "This module deploys an API Management Service.", @@ -383,7 +383,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -2058,7 +2058,9 @@ "name": { "value": "[parameters('namedValues')[copyIndex()].name]" }, - "tags": "[if(contains(parameters('namedValues')[copyIndex()], 'tags'), createObject('value', parameters('namedValues')[copyIndex()].tags), createObject('value', createArray()))]", + "tags": { + "value": "[tryGet(parameters('namedValues')[copyIndex()], 'tags')]" + }, "secret": "[if(contains(parameters('namedValues')[copyIndex()], 'secret'), createObject('value', parameters('namedValues')[copyIndex()].secret), createObject('value', false()))]", "value": "[if(contains(parameters('namedValues')[copyIndex()], 'value'), createObject('value', parameters('namedValues')[copyIndex()].value), createObject('value', parameters('newGuidValue')))]", "enableDefaultTelemetry": { @@ -2067,12 +2069,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3581707708141744852" + "templateHash": "16893893897869493831" }, "name": "API Management Service Named Values", "description": "This module deploys an API Management Service Named Value.", @@ -2113,7 +2116,7 @@ }, "tags": { "type": "array", - "defaultValue": [], + "nullable": true, "metadata": { "description": "Optional. Tags that when provided can be used to filter the NamedValue list. - string." } @@ -2136,8 +2139,8 @@ "variables": { "keyVaultEmpty": "[empty(parameters('keyVault'))]" }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -2151,19 +2154,28 @@ } } }, - { + "service": { + "existing": true, + "type": "Microsoft.ApiManagement/service", + "apiVersion": "2021-08-01", + "name": "[parameters('apiManagementServiceName')]" + }, + "namedValue": { "type": "Microsoft.ApiManagement/service/namedValues", "apiVersion": "2021-08-01", "name": "[format('{0}/{1}', parameters('apiManagementServiceName'), parameters('name'))]", "properties": { - "tags": "[if(not(empty(parameters('tags'))), parameters('tags'), null())]", + "tags": "[parameters('tags')]", "secret": "[parameters('secret')]", "displayName": "[parameters('displayName')]", "value": "[if(variables('keyVaultEmpty'), parameters('value'), null())]", "keyVault": "[if(not(variables('keyVaultEmpty')), parameters('keyVault'), null())]" - } + }, + "dependsOn": [ + "service" + ] } - ], + }, "outputs": { "resourceId": { "type": "string", diff --git a/modules/api-management/service/named-value/README.md b/modules/api-management/service/named-value/README.md index d73832ca82..d82c7edbd3 100644 --- a/modules/api-management/service/named-value/README.md +++ b/modules/api-management/service/named-value/README.md @@ -85,7 +85,6 @@ Determines whether the value is a secret and should be encrypted or not. Default Tags that when provided can be used to filter the NamedValue list. - string. - Required: No - Type: array -- Default: `[]` ### Parameter: `value` diff --git a/modules/api-management/service/named-value/main.bicep b/modules/api-management/service/named-value/main.bicep index d180918e18..87e4c66e5c 100644 --- a/modules/api-management/service/named-value/main.bicep +++ b/modules/api-management/service/named-value/main.bicep @@ -18,7 +18,7 @@ param keyVault object = {} param name string @description('Optional. Tags that when provided can be used to filter the NamedValue list. - string.') -param tags array = [] +param tags array? @description('Optional. Determines whether the value is a secret and should be encrypted or not. Default value is false.') #disable-next-line secure-secrets-in-params // Not a secret @@ -49,7 +49,7 @@ resource namedValue 'Microsoft.ApiManagement/service/namedValues@2021-08-01' = { name: name parent: service properties: { - tags: !empty(tags) ? tags : null + tags: tags secret: secret displayName: displayName value: keyVaultEmpty ? value : null diff --git a/modules/api-management/service/named-value/main.json b/modules/api-management/service/named-value/main.json index f47f644953..9d72a76220 100644 --- a/modules/api-management/service/named-value/main.json +++ b/modules/api-management/service/named-value/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3581707708141744852" + "templateHash": "16893893897869493831" }, "name": "API Management Service Named Values", "description": "This module deploys an API Management Service Named Value.", @@ -46,7 +47,7 @@ }, "tags": { "type": "array", - "defaultValue": [], + "nullable": true, "metadata": { "description": "Optional. Tags that when provided can be used to filter the NamedValue list. - string." } @@ -69,8 +70,8 @@ "variables": { "keyVaultEmpty": "[empty(parameters('keyVault'))]" }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -84,19 +85,28 @@ } } }, - { + "service": { + "existing": true, + "type": "Microsoft.ApiManagement/service", + "apiVersion": "2021-08-01", + "name": "[parameters('apiManagementServiceName')]" + }, + "namedValue": { "type": "Microsoft.ApiManagement/service/namedValues", "apiVersion": "2021-08-01", "name": "[format('{0}/{1}', parameters('apiManagementServiceName'), parameters('name'))]", "properties": { - "tags": "[if(not(empty(parameters('tags'))), parameters('tags'), null())]", + "tags": "[parameters('tags')]", "secret": "[parameters('secret')]", "displayName": "[parameters('displayName')]", "value": "[if(variables('keyVaultEmpty'), parameters('value'), null())]", "keyVault": "[if(not(variables('keyVaultEmpty')), parameters('keyVault'), null())]" - } + }, + "dependsOn": [ + "service" + ] } - ], + }, "outputs": { "resourceId": { "type": "string", diff --git a/modules/app-configuration/configuration-store/README.md b/modules/app-configuration/configuration-store/README.md index 7e4babb679..66e086dda0 100644 --- a/modules/app-configuration/configuration-store/README.md +++ b/modules/app-configuration/configuration-store/README.md @@ -1050,7 +1050,6 @@ The amount of time in days that the configuration store will be retained when it Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/app-configuration/configuration-store/key-value/README.md b/modules/app-configuration/configuration-store/key-value/README.md index 3fb836e1b5..bf6dd94639 100644 --- a/modules/app-configuration/configuration-store/key-value/README.md +++ b/modules/app-configuration/configuration-store/key-value/README.md @@ -69,7 +69,6 @@ Name of the key. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `value` diff --git a/modules/app-configuration/configuration-store/key-value/main.bicep b/modules/app-configuration/configuration-store/key-value/main.bicep index 199bad6726..acc8bbc774 100644 --- a/modules/app-configuration/configuration-store/key-value/main.bicep +++ b/modules/app-configuration/configuration-store/key-value/main.bicep @@ -15,7 +15,7 @@ param appConfigurationName string param contentType string = '' @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') // update all the descriptions param enableDefaultTelemetry bool = true diff --git a/modules/app-configuration/configuration-store/key-value/main.json b/modules/app-configuration/configuration-store/key-value/main.json index 7737b18021..2893f5eb2f 100644 --- a/modules/app-configuration/configuration-store/key-value/main.json +++ b/modules/app-configuration/configuration-store/key-value/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16264229277476024063" + "templateHash": "5336531799585402354" }, "name": "App Configuration Stores Key Values", "description": "This module deploys an App Configuration Store Key Value.", @@ -39,7 +40,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -52,8 +53,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -67,7 +68,13 @@ } } }, - { + "appConfiguration": { + "existing": true, + "type": "Microsoft.AppConfiguration/configurationStores", + "apiVersion": "2023-03-01", + "name": "[parameters('appConfigurationName')]" + }, + "keyValues": { "type": "Microsoft.AppConfiguration/configurationStores/keyValues", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('appConfigurationName'), parameters('name'))]", @@ -75,9 +82,12 @@ "contentType": "[parameters('contentType')]", "tags": "[parameters('tags')]", "value": "[parameters('value')]" - } + }, + "dependsOn": [ + "appConfiguration" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/app-configuration/configuration-store/main.bicep b/modules/app-configuration/configuration-store/main.bicep index 605a827075..5d1521e212 100644 --- a/modules/app-configuration/configuration-store/main.bicep +++ b/modules/app-configuration/configuration-store/main.bicep @@ -69,7 +69,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true @@ -154,7 +154,7 @@ module configurationStore_keyValues 'key-value/main.bicep' = [for (keyValue, ind name: keyValue.name value: keyValue.value contentType: contains(keyValue, 'contentType') ? keyValue.contentType : '' - tags: contains(keyValue, 'tags') ? keyValue.tags : {} + tags: keyValue.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } }] diff --git a/modules/app-configuration/configuration-store/main.json b/modules/app-configuration/configuration-store/main.json index e5b8f23942..1063e16033 100644 --- a/modules/app-configuration/configuration-store/main.json +++ b/modules/app-configuration/configuration-store/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "5839345851698938345" + "templateHash": "6136989204056808614" }, "name": "App Configuration Stores", "description": "This module deploys an App Configuration Store.", @@ -515,7 +515,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -701,19 +701,22 @@ "value": "[parameters('keyValues')[copyIndex()].value]" }, "contentType": "[if(contains(parameters('keyValues')[copyIndex()], 'contentType'), createObject('value', parameters('keyValues')[copyIndex()].contentType), createObject('value', ''))]", - "tags": "[if(contains(parameters('keyValues')[copyIndex()], 'tags'), createObject('value', parameters('keyValues')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('keyValues')[copyIndex()], 'tags'), parameters('tags'))]" + }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16264229277476024063" + "templateHash": "5336531799585402354" }, "name": "App Configuration Stores Key Values", "description": "This module deploys an App Configuration Store Key Value.", @@ -747,7 +750,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -760,8 +763,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -775,7 +778,13 @@ } } }, - { + "appConfiguration": { + "existing": true, + "type": "Microsoft.AppConfiguration/configurationStores", + "apiVersion": "2023-03-01", + "name": "[parameters('appConfigurationName')]" + }, + "keyValues": { "type": "Microsoft.AppConfiguration/configurationStores/keyValues", "apiVersion": "2023-03-01", "name": "[format('{0}/{1}', parameters('appConfigurationName'), parameters('name'))]", @@ -783,9 +792,12 @@ "contentType": "[parameters('contentType')]", "tags": "[parameters('tags')]", "value": "[parameters('value')]" - } + }, + "dependsOn": [ + "appConfiguration" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/app/container-app/README.md b/modules/app/container-app/README.md index 4da6b25062..55ed899dc3 100644 --- a/modules/app/container-app/README.md +++ b/modules/app/container-app/README.md @@ -603,7 +603,6 @@ The secrets of the Container App. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `trafficLabel` diff --git a/modules/app/container-app/main.bicep b/modules/app/container-app/main.bicep index 6203e95475..58d88c45dc 100644 --- a/modules/app/container-app/main.bicep +++ b/modules/app/container-app/main.bicep @@ -49,7 +49,7 @@ param environmentId string param lock lockType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Collection of private container registry credentials for containers used by the Container app.') param registries array = [] diff --git a/modules/app/container-app/main.json b/modules/app/container-app/main.json index ee8c7769c7..f94f931610 100644 --- a/modules/app/container-app/main.json +++ b/modules/app/container-app/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "18263232031845288996" + "templateHash": "5881378126445701958" }, "name": "Container Apps", "description": "This module deploys a Container App.", @@ -222,7 +222,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/app/managed-environment/README.md b/modules/app/managed-environment/README.md index 9c41524275..5049cc48c6 100644 --- a/modules/app/managed-environment/README.md +++ b/modules/app/managed-environment/README.md @@ -428,7 +428,6 @@ Managed environment SKU. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `workloadProfiles` diff --git a/modules/app/managed-environment/main.bicep b/modules/app/managed-environment/main.bicep index 6e635bbab9..18bc3abed7 100644 --- a/modules/app/managed-environment/main.bicep +++ b/modules/app/managed-environment/main.bicep @@ -12,7 +12,7 @@ param logAnalyticsWorkspaceResourceId string param location string = resourceGroup().location @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @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 roleAssignmentType diff --git a/modules/app/managed-environment/main.json b/modules/app/managed-environment/main.json index 706f39cd1e..d8bb5e7173 100644 --- a/modules/app/managed-environment/main.json +++ b/modules/app/managed-environment/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "12554616847424518267" + "templateHash": "5686402227763337334" }, "name": "App ManagedEnvironments", "description": "This module deploys an App Managed Environment (also known as a Container App Environment).", @@ -127,7 +127,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/automation/automation-account/README.md b/modules/automation/automation-account/README.md index de8dee9816..3d282c8e14 100644 --- a/modules/automation/automation-account/README.md +++ b/modules/automation/automation-account/README.md @@ -1185,7 +1185,6 @@ List of softwareUpdateConfigurations to be created in the automation account. Tags of the Automation Account resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `variables` diff --git a/modules/automation/automation-account/main.bicep b/modules/automation/automation-account/main.bicep index 908b6b3811..c65959f494 100644 --- a/modules/automation/automation-account/main.bicep +++ b/modules/automation/automation-account/main.bicep @@ -78,7 +78,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the Automation Account resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true @@ -158,7 +158,7 @@ module automationAccount_modules 'module/main.bicep' = [for (module, index) in m version: module.version uri: module.uri location: location - tags: tags + tags: module.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } }] @@ -188,8 +188,10 @@ module automationAccount_runbooks 'runbook/main.bicep' = [for (runbook, index) i description: contains(runbook, 'description') ? runbook.description : '' uri: contains(runbook, 'uri') ? runbook.uri : '' version: contains(runbook, 'version') ? runbook.version : '' + sasTokenValidityLength: runbook.?sasTokenValidityLength + scriptStorageAccountResourceId: runbook.?scriptStorageAccountResourceId location: location - tags: tags + tags: runbook.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } }] @@ -233,7 +235,7 @@ module automationAccount_linkedService '../../operational-insights/workspace/lin } // This is to support linked services to law in different subscription and resource group than the automation account. // The current scope is used by default if no linked service is intended to be created. - scope: resourceGroup(!empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[2] : subscription().subscriptionId, !empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[4] : resourceGroup().name) + scope: resourceGroup((!empty(linkedWorkspaceResourceId) ? (split((!empty(linkedWorkspaceResourceId) ? linkedWorkspaceResourceId : '//'), '/')[2]) : subscription().subscriptionId), !empty(linkedWorkspaceResourceId) ? (split((!empty(linkedWorkspaceResourceId) ? linkedWorkspaceResourceId : '////'), '/')[4]) : resourceGroup().name) } module automationAccount_solutions '../../operations-management/solution/main.bicep' = [for (gallerySolution, index) in gallerySolutions: if (!empty(linkedWorkspaceResourceId)) { @@ -248,7 +250,7 @@ module automationAccount_solutions '../../operations-management/solution/main.bi } // This is to support solution to law in different subscription and resource group than the automation account. // The current scope is used by default if no linked service is intended to be created. - scope: resourceGroup(!empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[2] : subscription().subscriptionId, !empty(linkedWorkspaceResourceId) ? split(linkedWorkspaceResourceId, '/')[4] : resourceGroup().name) + scope: resourceGroup((!empty(linkedWorkspaceResourceId) ? (split((!empty(linkedWorkspaceResourceId) ? linkedWorkspaceResourceId : '//'), '/')[2]) : subscription().subscriptionId), !empty(linkedWorkspaceResourceId) ? (split((!empty(linkedWorkspaceResourceId) ? linkedWorkspaceResourceId : '////'), '/')[4]) : resourceGroup().name) dependsOn: [ automationAccount_linkedService ] diff --git a/modules/automation/automation-account/main.json b/modules/automation/automation-account/main.json index f6484661e3..9a0246ec97 100644 --- a/modules/automation/automation-account/main.json +++ b/modules/automation/automation-account/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "5962075210200629853" + "templateHash": "9488372689146469635" }, "name": "Automation Accounts", "description": "This module deploys an Azure Automation Account.", @@ -542,7 +542,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Automation Account resource." } @@ -715,7 +715,7 @@ "value": "[parameters('location')]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('modules')[copyIndex()], 'tags'), parameters('tags'))]" }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" @@ -723,12 +723,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15709477569881004771" + "templateHash": "18249732142000845439" }, "name": "Automation Account Modules", "description": "This module deploys an Azure Automation Account Module.", @@ -769,7 +770,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Automation Account resource." } @@ -782,8 +783,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -797,7 +798,13 @@ } } }, - { + "automationAccount": { + "existing": true, + "type": "Microsoft.Automation/automationAccounts", + "apiVersion": "2022-08-08", + "name": "[parameters('automationAccountName')]" + }, + "module": { "type": "Microsoft.Automation/automationAccounts/modules", "apiVersion": "2022-08-08", "name": "[format('{0}/{1}', parameters('automationAccountName'), parameters('name'))]", @@ -808,9 +815,12 @@ "uri": "[if(not(equals(parameters('version'), 'latest')), format('{0}/{1}/{2}', parameters('uri'), parameters('name'), parameters('version')), format('{0}/{1}', parameters('uri'), parameters('name')))]", "version": "[if(not(equals(parameters('version'), 'latest')), parameters('version'), null())]" } - } + }, + "dependsOn": [ + "automationAccount" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -838,7 +848,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Automation/automationAccounts/modules', parameters('automationAccountName'), parameters('name')), '2022-08-08', 'full').location]" + "value": "[reference('module', '2022-08-08', 'full').location]" } } } @@ -1064,11 +1074,17 @@ "description": "[if(contains(parameters('runbooks')[copyIndex()], 'description'), createObject('value', parameters('runbooks')[copyIndex()].description), createObject('value', ''))]", "uri": "[if(contains(parameters('runbooks')[copyIndex()], 'uri'), createObject('value', parameters('runbooks')[copyIndex()].uri), createObject('value', ''))]", "version": "[if(contains(parameters('runbooks')[copyIndex()], 'version'), createObject('value', parameters('runbooks')[copyIndex()].version), createObject('value', ''))]", + "sasTokenValidityLength": { + "value": "[tryGet(parameters('runbooks')[copyIndex()], 'sasTokenValidityLength')]" + }, + "scriptStorageAccountResourceId": { + "value": "[tryGet(parameters('runbooks')[copyIndex()], 'scriptStorageAccountResourceId')]" + }, "location": { "value": "[parameters('location')]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('runbooks')[copyIndex()], 'tags'), parameters('tags'))]" }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" @@ -1076,12 +1092,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "18248893160569507204" + "templateHash": "1833872657708381069" }, "name": "Automation Account Runbooks", "description": "This module deploys an Azure Automation Account Runbook.", @@ -1134,11 +1151,11 @@ "description": "Optional. The version of the runbook content." } }, - "scriptStorageAccountId": { + "scriptStorageAccountResourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { - "description": "Optional. ID of the runbook storage account." + "description": "Optional. Resource Id of the runbook storage account." } }, "baseTime": { @@ -1164,7 +1181,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Automation Account resource." } @@ -1186,8 +1203,8 @@ "signedProtocol": "https" } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -1201,7 +1218,22 @@ } } }, - { + "automationAccount": { + "existing": true, + "type": "Microsoft.Automation/automationAccounts", + "apiVersion": "2022-08-08", + "name": "[parameters('automationAccountName')]" + }, + "storageAccount": { + "condition": "[not(empty(parameters('scriptStorageAccountResourceId')))]", + "existing": true, + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2022-09-01", + "subscriptionId": "[split(coalesce(parameters('scriptStorageAccountResourceId'), '//'), '/')[2]]", + "resourceGroup": "[split(coalesce(parameters('scriptStorageAccountResourceId'), '////'), '/')[4]]", + "name": "[last(split(coalesce(parameters('scriptStorageAccountResourceId'), 'dummyVault'), '/'))]" + }, + "runbook": { "type": "Microsoft.Automation/automationAccounts/runbooks", "apiVersion": "2022-08-08", "name": "[format('{0}/{1}', parameters('automationAccountName'), parameters('name'))]", @@ -1210,10 +1242,14 @@ "properties": { "runbookType": "[parameters('type')]", "description": "[parameters('description')]", - "publishContentLink": "[if(not(empty(parameters('uri'))), if(empty(parameters('uri')), null(), createObject('uri', if(not(empty(parameters('uri'))), if(empty(parameters('scriptStorageAccountId')), parameters('uri'), format('{0}?{1}', parameters('uri'), listAccountSas(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(parameters('scriptStorageAccountId'), '/')[2], split(parameters('scriptStorageAccountId'), '/')[4]), 'Microsoft.Storage/storageAccounts', last(split(parameters('scriptStorageAccountId'), '/'))), '2021-04-01', variables('accountSasProperties')).accountSasToken)), null()), 'version', if(not(empty(parameters('version'))), parameters('version'), null()))), null())]" - } + "publishContentLink": "[if(not(empty(parameters('uri'))), if(empty(parameters('uri')), null(), createObject('uri', if(not(empty(parameters('uri'))), if(empty(parameters('scriptStorageAccountResourceId')), parameters('uri'), format('{0}?{1}', parameters('uri'), listAccountSas(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(coalesce(parameters('scriptStorageAccountResourceId'), '//'), '/')[2], split(coalesce(parameters('scriptStorageAccountResourceId'), '////'), '/')[4]), 'Microsoft.Storage/storageAccounts', last(split(coalesce(parameters('scriptStorageAccountResourceId'), 'dummyVault'), '/'))), '2021-04-01', variables('accountSasProperties')).accountSasToken)), null()), 'version', if(not(empty(parameters('version'))), parameters('version'), null()))), null())]" + }, + "dependsOn": [ + "automationAccount", + "storageAccount" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1241,7 +1277,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Automation/automationAccounts/runbooks', parameters('automationAccountName'), parameters('name')), '2022-08-08', 'full').location]" + "value": "[reference('runbook', '2022-08-08', 'full').location]" } } } @@ -1545,8 +1581,8 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[format('{0}-AutoAccount-LinkedService', uniqueString(deployment().name, parameters('location')))]", - "subscriptionId": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(parameters('linkedWorkspaceResourceId'), '/')[2], subscription().subscriptionId)]", - "resourceGroup": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(parameters('linkedWorkspaceResourceId'), '/')[4], resourceGroup().name)]", + "subscriptionId": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(if(not(empty(parameters('linkedWorkspaceResourceId'))), parameters('linkedWorkspaceResourceId'), '//'), '/')[2], subscription().subscriptionId)]", + "resourceGroup": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(if(not(empty(parameters('linkedWorkspaceResourceId'))), parameters('linkedWorkspaceResourceId'), '////'), '/')[4], resourceGroup().name)]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -1688,8 +1724,8 @@ "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", "name": "[format('{0}-AutoAccount-Solution-{1}', uniqueString(deployment().name, parameters('location')), copyIndex())]", - "subscriptionId": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(parameters('linkedWorkspaceResourceId'), '/')[2], subscription().subscriptionId)]", - "resourceGroup": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(parameters('linkedWorkspaceResourceId'), '/')[4], resourceGroup().name)]", + "subscriptionId": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(if(not(empty(parameters('linkedWorkspaceResourceId'))), parameters('linkedWorkspaceResourceId'), '//'), '/')[2], subscription().subscriptionId)]", + "resourceGroup": "[if(not(empty(parameters('linkedWorkspaceResourceId'))), split(if(not(empty(parameters('linkedWorkspaceResourceId'))), parameters('linkedWorkspaceResourceId'), '////'), '/')[4], resourceGroup().name)]", "properties": { "expressionEvaluationOptions": { "scope": "inner" diff --git a/modules/automation/automation-account/module/README.md b/modules/automation/automation-account/module/README.md index bba5a2892b..71d279aaf2 100644 --- a/modules/automation/automation-account/module/README.md +++ b/modules/automation/automation-account/module/README.md @@ -70,7 +70,6 @@ Name of the Automation Account module. Tags of the Automation Account resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `uri` diff --git a/modules/automation/automation-account/module/main.bicep b/modules/automation/automation-account/module/main.bicep index 1754a19f93..7af6b346bc 100644 --- a/modules/automation/automation-account/module/main.bicep +++ b/modules/automation/automation-account/module/main.bicep @@ -18,7 +18,7 @@ param version string = 'latest' param location string = resourceGroup().location @description('Optional. Tags of the Automation Account resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/automation/automation-account/module/main.json b/modules/automation/automation-account/module/main.json index bf3c18c30b..305926a6eb 100644 --- a/modules/automation/automation-account/module/main.json +++ b/modules/automation/automation-account/module/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15709477569881004771" + "templateHash": "18249732142000845439" }, "name": "Automation Account Modules", "description": "This module deploys an Azure Automation Account Module.", @@ -46,7 +47,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Automation Account resource." } @@ -59,8 +60,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -74,7 +75,13 @@ } } }, - { + "automationAccount": { + "existing": true, + "type": "Microsoft.Automation/automationAccounts", + "apiVersion": "2022-08-08", + "name": "[parameters('automationAccountName')]" + }, + "module": { "type": "Microsoft.Automation/automationAccounts/modules", "apiVersion": "2022-08-08", "name": "[format('{0}/{1}', parameters('automationAccountName'), parameters('name'))]", @@ -85,9 +92,12 @@ "uri": "[if(not(equals(parameters('version'), 'latest')), format('{0}/{1}/{2}', parameters('uri'), parameters('name'), parameters('version')), format('{0}/{1}', parameters('uri'), parameters('name')))]", "version": "[if(not(equals(parameters('version'), 'latest')), parameters('version'), null())]" } - } + }, + "dependsOn": [ + "automationAccount" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -115,7 +125,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Automation/automationAccounts/modules', parameters('automationAccountName'), parameters('name')), '2022-08-08', 'full').location]" + "value": "[reference('module', '2022-08-08', 'full').location]" } } } \ No newline at end of file diff --git a/modules/automation/automation-account/runbook/README.md b/modules/automation/automation-account/runbook/README.md index 8cb4f7f0c8..7858b8a994 100644 --- a/modules/automation/automation-account/runbook/README.md +++ b/modules/automation/automation-account/runbook/README.md @@ -38,7 +38,7 @@ This module deploys an Azure Automation Account Runbook. | [`enableDefaultTelemetry`](#parameter-enabledefaulttelemetry) | bool | Enable telemetry via a Globally Unique Identifier (GUID). | | [`location`](#parameter-location) | string | Location for all resources. | | [`sasTokenValidityLength`](#parameter-sastokenvaliditylength) | string | SAS token validity length. Usage: 'PT8H' - valid for 8 hours; 'P5D' - valid for 5 days; 'P1Y' - valid for 1 year. When not provided, the SAS token will be valid for 8 hours. | -| [`scriptStorageAccountId`](#parameter-scriptstorageaccountid) | string | ID of the runbook storage account. | +| [`scriptStorageAccountResourceId`](#parameter-scriptstorageaccountresourceid) | string | Resource Id of the runbook storage account. | | [`tags`](#parameter-tags) | object | Tags of the Automation Account resource. | | [`uri`](#parameter-uri) | string | The uri of the runbook content. | | [`version`](#parameter-version) | string | The version of the runbook content. | @@ -96,19 +96,17 @@ SAS token validity length. Usage: 'PT8H' - valid for 8 hours; 'P5D' - valid for - Type: string - Default: `'PT8H'` -### Parameter: `scriptStorageAccountId` +### Parameter: `scriptStorageAccountResourceId` -ID of the runbook storage account. +Resource Id of the runbook storage account. - Required: No - Type: string -- Default: `''` ### Parameter: `tags` Tags of the Automation Account resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `type` diff --git a/modules/automation/automation-account/runbook/main.bicep b/modules/automation/automation-account/runbook/main.bicep index 18df96ac91..992643abe4 100644 --- a/modules/automation/automation-account/runbook/main.bicep +++ b/modules/automation/automation-account/runbook/main.bicep @@ -27,8 +27,8 @@ param uri string = '' @sys.description('Optional. The version of the runbook content.') param version string = '' -@sys.description('Optional. ID of the runbook storage account.') -param scriptStorageAccountId string = '' +@sys.description('Optional. Resource Id of the runbook storage account.') +param scriptStorageAccountResourceId string? @sys.description('Generated. Time used as a basis for e.g. the schedule start date.') param baseTime string = utcNow('u') @@ -40,7 +40,7 @@ param sasTokenValidityLength string = 'PT8H' param location string = resourceGroup().location @sys.description('Optional. Tags of the Automation Account resource.') -param tags object = {} +param tags object? @sys.description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true @@ -69,13 +69,13 @@ resource automationAccount 'Microsoft.Automation/automationAccounts@2022-08-08' name: automationAccountName } -resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' existing = if (!empty(scriptStorageAccountId)) { - name: last(split(scriptStorageAccountId, '/'))! - scope: resourceGroup(split(scriptStorageAccountId, '/')[2], split(scriptStorageAccountId, '/')[4]) +resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' existing = if (!empty(scriptStorageAccountResourceId)) { + name: last(split((scriptStorageAccountResourceId ?? 'dummyVault'), '/')) + scope: resourceGroup(split((scriptStorageAccountResourceId ?? '//'), '/')[2], split((scriptStorageAccountResourceId ?? '////'), '/')[4]) } var publishContentLink = empty(uri) ? null : { - uri: !empty(uri) ? (empty(scriptStorageAccountId) ? uri : '${uri}?${storageAccount.listAccountSas('2021-04-01', accountSasProperties).accountSasToken}') : null + uri: !empty(uri) ? (empty(scriptStorageAccountResourceId) ? uri : '${uri}?${storageAccount.listAccountSas('2021-04-01', accountSasProperties).accountSasToken}') : null version: !empty(version) ? version : null } diff --git a/modules/automation/automation-account/runbook/main.json b/modules/automation/automation-account/runbook/main.json index 3a2f126c75..9d60de1b4d 100644 --- a/modules/automation/automation-account/runbook/main.json +++ b/modules/automation/automation-account/runbook/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "18248893160569507204" + "templateHash": "1833872657708381069" }, "name": "Automation Account Runbooks", "description": "This module deploys an Azure Automation Account Runbook.", @@ -58,11 +59,11 @@ "description": "Optional. The version of the runbook content." } }, - "scriptStorageAccountId": { + "scriptStorageAccountResourceId": { "type": "string", - "defaultValue": "", + "nullable": true, "metadata": { - "description": "Optional. ID of the runbook storage account." + "description": "Optional. Resource Id of the runbook storage account." } }, "baseTime": { @@ -88,7 +89,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Automation Account resource." } @@ -110,8 +111,8 @@ "signedProtocol": "https" } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -125,7 +126,22 @@ } } }, - { + "automationAccount": { + "existing": true, + "type": "Microsoft.Automation/automationAccounts", + "apiVersion": "2022-08-08", + "name": "[parameters('automationAccountName')]" + }, + "storageAccount": { + "condition": "[not(empty(parameters('scriptStorageAccountResourceId')))]", + "existing": true, + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2022-09-01", + "subscriptionId": "[split(coalesce(parameters('scriptStorageAccountResourceId'), '//'), '/')[2]]", + "resourceGroup": "[split(coalesce(parameters('scriptStorageAccountResourceId'), '////'), '/')[4]]", + "name": "[last(split(coalesce(parameters('scriptStorageAccountResourceId'), 'dummyVault'), '/'))]" + }, + "runbook": { "type": "Microsoft.Automation/automationAccounts/runbooks", "apiVersion": "2022-08-08", "name": "[format('{0}/{1}', parameters('automationAccountName'), parameters('name'))]", @@ -134,10 +150,14 @@ "properties": { "runbookType": "[parameters('type')]", "description": "[parameters('description')]", - "publishContentLink": "[if(not(empty(parameters('uri'))), if(empty(parameters('uri')), null(), createObject('uri', if(not(empty(parameters('uri'))), if(empty(parameters('scriptStorageAccountId')), parameters('uri'), format('{0}?{1}', parameters('uri'), listAccountSas(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(parameters('scriptStorageAccountId'), '/')[2], split(parameters('scriptStorageAccountId'), '/')[4]), 'Microsoft.Storage/storageAccounts', last(split(parameters('scriptStorageAccountId'), '/'))), '2021-04-01', variables('accountSasProperties')).accountSasToken)), null()), 'version', if(not(empty(parameters('version'))), parameters('version'), null()))), null())]" - } + "publishContentLink": "[if(not(empty(parameters('uri'))), if(empty(parameters('uri')), null(), createObject('uri', if(not(empty(parameters('uri'))), if(empty(parameters('scriptStorageAccountResourceId')), parameters('uri'), format('{0}?{1}', parameters('uri'), listAccountSas(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(coalesce(parameters('scriptStorageAccountResourceId'), '//'), '/')[2], split(coalesce(parameters('scriptStorageAccountResourceId'), '////'), '/')[4]), 'Microsoft.Storage/storageAccounts', last(split(coalesce(parameters('scriptStorageAccountResourceId'), 'dummyVault'), '/'))), '2021-04-01', variables('accountSasProperties')).accountSasToken)), null()), 'version', if(not(empty(parameters('version'))), parameters('version'), null()))), null())]" + }, + "dependsOn": [ + "automationAccount", + "storageAccount" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -165,7 +185,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Automation/automationAccounts/runbooks', parameters('automationAccountName'), parameters('name')), '2022-08-08', 'full').location]" + "value": "[reference('runbook', '2022-08-08', 'full').location]" } } } \ No newline at end of file diff --git a/modules/batch/batch-account/README.md b/modules/batch/batch-account/README.md index 0669214e97..f5faaa5dc8 100644 --- a/modules/batch/batch-account/README.md +++ b/modules/batch/batch-account/README.md @@ -948,7 +948,6 @@ The authentication mode which the Batch service will use to manage the auto-stor Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/batch/batch-account/main.bicep b/modules/batch/batch-account/main.bicep index 4c322f5d36..38306efc50 100644 --- a/modules/batch/batch-account/main.bicep +++ b/modules/batch/batch-account/main.bicep @@ -62,7 +62,7 @@ param diagnosticSettings diagnosticSettingType param lock lockType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @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 roleAssignmentType diff --git a/modules/batch/batch-account/main.json b/modules/batch/batch-account/main.json index 704866f515..3e0eebcb72 100644 --- a/modules/batch/batch-account/main.json +++ b/modules/batch/batch-account/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "8921010374521375351" + "templateHash": "8281874211111057324" }, "name": "Batch Accounts", "description": "This module deploys a Batch Account.", @@ -495,7 +495,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/cache/redis-enterprise/README.md b/modules/cache/redis-enterprise/README.md index 34dff8de72..a24e471cff 100644 --- a/modules/cache/redis-enterprise/README.md +++ b/modules/cache/redis-enterprise/README.md @@ -856,7 +856,6 @@ The type of Redis Enterprise Cluster to deploy. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `zoneRedundant` diff --git a/modules/cache/redis-enterprise/main.bicep b/modules/cache/redis-enterprise/main.bicep index dbcd72f0b7..ed004ca936 100644 --- a/modules/cache/redis-enterprise/main.bicep +++ b/modules/cache/redis-enterprise/main.bicep @@ -15,7 +15,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @allowed([ '1.0' diff --git a/modules/cache/redis-enterprise/main.json b/modules/cache/redis-enterprise/main.json index f73b1ecc4f..5fc8d2bf7c 100644 --- a/modules/cache/redis-enterprise/main.json +++ b/modules/cache/redis-enterprise/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "11394505445953439592" + "templateHash": "2411064933627030246" }, "name": "Redis Cache Enterprise", "description": "This module deploys a Redis Cache Enterprise.", @@ -388,7 +388,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/cache/redis/README.md b/modules/cache/redis/README.md index 580ce90db2..f397a8c197 100644 --- a/modules/cache/redis/README.md +++ b/modules/cache/redis/README.md @@ -818,7 +818,6 @@ The full resource ID of a subnet in a virtual network to deploy the Redis cache Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `tenantSettings` diff --git a/modules/cache/redis/main.bicep b/modules/cache/redis/main.bicep index f35bce1160..af3b549ba9 100644 --- a/modules/cache/redis/main.bicep +++ b/modules/cache/redis/main.bicep @@ -15,7 +15,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. The managed identity definition for this resource.') param managedIdentities managedIdentitiesType diff --git a/modules/cache/redis/main.json b/modules/cache/redis/main.json index 9a1a25ab90..fa2e2fe2d9 100644 --- a/modules/cache/redis/main.json +++ b/modules/cache/redis/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "10917457453871237653" + "templateHash": "9496315762768268" }, "name": "Redis Cache", "description": "This module deploys a Redis Cache.", @@ -411,7 +411,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/cdn/profile/README.md b/modules/cdn/profile/README.md index 1212e7e137..818f0ad16a 100644 --- a/modules/cdn/profile/README.md +++ b/modules/cdn/profile/README.md @@ -620,7 +620,6 @@ The pricing tier (defines a CDN provider, feature list and rate) of the CDN prof Endpoint tags. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/cdn/profile/afdEndpoint/README.md b/modules/cdn/profile/afdEndpoint/README.md index 6668c13e76..8ad17d959d 100644 --- a/modules/cdn/profile/afdEndpoint/README.md +++ b/modules/cdn/profile/afdEndpoint/README.md @@ -95,7 +95,6 @@ The list of routes for this AFD Endpoint. The tags of the AFD Endpoint. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/cdn/profile/afdEndpoint/main.bicep b/modules/cdn/profile/afdEndpoint/main.bicep index 83c9d667e0..92a40f407e 100644 --- a/modules/cdn/profile/afdEndpoint/main.bicep +++ b/modules/cdn/profile/afdEndpoint/main.bicep @@ -12,7 +12,7 @@ param profileName string param location string = resourceGroup().location @description('Optional. The tags of the AFD Endpoint.') -param tags object = {} +param tags object? @description('Optional. Indicates the endpoint name reuse scope. The default value is TenantReuse.') @allowed([ diff --git a/modules/cdn/profile/afdEndpoint/main.json b/modules/cdn/profile/afdEndpoint/main.json index e7cc491a6c..9d22cf48e7 100644 --- a/modules/cdn/profile/afdEndpoint/main.json +++ b/modules/cdn/profile/afdEndpoint/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "11941850826145778575" + "templateHash": "14944467223785761559" }, "name": "CDN Profiles AFD Endpoints", "description": "This module deploys a CDN Profile AFD Endpoint.", @@ -33,7 +34,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. The tags of the AFD Endpoint." } @@ -80,8 +81,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -95,7 +96,13 @@ } } }, - { + "profile": { + "existing": true, + "type": "Microsoft.Cdn/profiles", + "apiVersion": "2023-05-01", + "name": "[parameters('profileName')]" + }, + "afd_endpoint": { "type": "Microsoft.Cdn/profiles/afdEndpoints", "apiVersion": "2023-05-01", "name": "[format('{0}/{1}', parameters('profileName'), parameters('name'))]", @@ -104,9 +111,12 @@ "properties": { "autoGeneratedDomainNameLabelScope": "[parameters('autoGeneratedDomainNameLabelScope')]", "enabledState": "[parameters('enabledState')]" - } + }, + "dependsOn": [ + "profile" + ] }, - { + "afd_endpoint_route": { "copy": { "name": "afd_endpoint_route", "count": "[length(parameters('routes'))]" @@ -351,10 +361,11 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Cdn/profiles/afdEndpoints', parameters('profileName'), parameters('name'))]" + "afd_endpoint", + "profile" ] } - ], + }, "outputs": { "name": { "type": "string", @@ -382,7 +393,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Cdn/profiles/afdEndpoints', parameters('profileName'), parameters('name')), '2023-05-01', 'full').location]" + "value": "[reference('afd_endpoint', '2023-05-01', 'full').location]" } } } \ No newline at end of file diff --git a/modules/cdn/profile/endpoint/README.md b/modules/cdn/profile/endpoint/README.md index 7681a1e2f8..f1a4da9f0f 100644 --- a/modules/cdn/profile/endpoint/README.md +++ b/modules/cdn/profile/endpoint/README.md @@ -76,7 +76,6 @@ Endpoint properties (see https://learn.microsoft.com/en-us/azure/templates/micro Endpoint tags. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/cdn/profile/endpoint/main.bicep b/modules/cdn/profile/endpoint/main.bicep index 1168a8c3b9..c1ec5fe0e9 100644 --- a/modules/cdn/profile/endpoint/main.bicep +++ b/modules/cdn/profile/endpoint/main.bicep @@ -15,7 +15,7 @@ param location string = resourceGroup().location param properties object @description('Optional. Endpoint tags.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/cdn/profile/endpoint/main.json b/modules/cdn/profile/endpoint/main.json index d9184500e2..3c3bd432dc 100644 --- a/modules/cdn/profile/endpoint/main.json +++ b/modules/cdn/profile/endpoint/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "66122595863754952" + "templateHash": "4870857598190177606" }, "name": "CDN Profiles Endpoints", "description": "This module deploys a CDN Profile Endpoint.", @@ -39,7 +40,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Endpoint tags." } @@ -55,8 +56,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -70,15 +71,24 @@ } } }, - { + "profile": { + "existing": true, + "type": "Microsoft.Cdn/profiles", + "apiVersion": "2021-06-01", + "name": "[parameters('profileName')]" + }, + "endpoint": { "type": "Microsoft.Cdn/profiles/endpoints", "apiVersion": "2021-06-01", "name": "[format('{0}/{1}', parameters('profileName'), parameters('name'))]", "location": "[parameters('location')]", "properties": "[parameters('properties')]", - "tags": "[parameters('tags')]" + "tags": "[parameters('tags')]", + "dependsOn": [ + "profile" + ] }, - { + "endpoint_origins": { "copy": { "name": "endpoint_origins", "count": "[length(parameters('properties').origins)]" @@ -278,9 +288,12 @@ } } } - } + }, + "dependsOn": [ + "profile" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -308,14 +321,14 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Cdn/profiles/endpoints', parameters('profileName'), parameters('name')), '2021-06-01', 'full').location]" + "value": "[reference('endpoint', '2021-06-01', 'full').location]" }, "endpointProperties": { "type": "object", "metadata": { "description": "The properties of the endpoint." }, - "value": "[reference(resourceId('Microsoft.Cdn/profiles/endpoints', parameters('profileName'), parameters('name')), '2021-06-01')]" + "value": "[reference('endpoint')]" } } } \ No newline at end of file diff --git a/modules/cdn/profile/main.bicep b/modules/cdn/profile/main.bicep index c8371f87f5..b60ee123cd 100644 --- a/modules/cdn/profile/main.bicep +++ b/modules/cdn/profile/main.bicep @@ -51,7 +51,7 @@ param ruleSets array = [] param afdEndpoints array = [] @description('Optional. Endpoint tags.') -param tags object = {} +param tags object? @description('Optional. The lock settings of the service.') param lock lockType @@ -206,7 +206,7 @@ module profile_afdEndpoint 'afdEndpoint/main.bicep' = [for (afdEndpoint, index) enabledState: contains(afdEndpoint, 'enabledState') ? afdEndpoint.enabledState : 'Enabled' enableDefaultTelemetry: enableReferencedModulesTelemetry routes: contains(afdEndpoint, 'routes') ? afdEndpoint.routes : [] - tags: contains(afdEndpoint, 'tags') ? afdEndpoint.tags : {} + tags: afdEndpoint.?tags ?? tags } }] diff --git a/modules/cdn/profile/main.json b/modules/cdn/profile/main.json index a7c0699e0d..de8d882e50 100644 --- a/modules/cdn/profile/main.json +++ b/modules/cdn/profile/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "31081249188890418" + "templateHash": "2807663755404362270" }, "name": "CDN Profiles", "description": "This module deploys a CDN Profile.", @@ -198,7 +198,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Endpoint tags." } @@ -328,12 +328,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "66122595863754952" + "templateHash": "4870857598190177606" }, "name": "CDN Profiles Endpoints", "description": "This module deploys a CDN Profile Endpoint.", @@ -367,7 +368,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Endpoint tags." } @@ -383,8 +384,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -398,15 +399,24 @@ } } }, - { + "profile": { + "existing": true, + "type": "Microsoft.Cdn/profiles", + "apiVersion": "2021-06-01", + "name": "[parameters('profileName')]" + }, + "endpoint": { "type": "Microsoft.Cdn/profiles/endpoints", "apiVersion": "2021-06-01", "name": "[format('{0}/{1}', parameters('profileName'), parameters('name'))]", "location": "[parameters('location')]", "properties": "[parameters('properties')]", - "tags": "[parameters('tags')]" + "tags": "[parameters('tags')]", + "dependsOn": [ + "profile" + ] }, - { + "endpoint_origins": { "copy": { "name": "endpoint_origins", "count": "[length(parameters('properties').origins)]" @@ -606,9 +616,12 @@ } } } - } + }, + "dependsOn": [ + "profile" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -636,14 +649,14 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Cdn/profiles/endpoints', parameters('profileName'), parameters('name')), '2021-06-01', 'full').location]" + "value": "[reference('endpoint', '2021-06-01', 'full').location]" }, "endpointProperties": { "type": "object", "metadata": { "description": "The properties of the endpoint." }, - "value": "[reference(resourceId('Microsoft.Cdn/profiles/endpoints', parameters('profileName'), parameters('name')), '2021-06-01')]" + "value": "[reference('endpoint')]" } } } @@ -1685,16 +1698,19 @@ "value": "[variables('enableReferencedModulesTelemetry')]" }, "routes": "[if(contains(parameters('afdEndpoints')[copyIndex()], 'routes'), createObject('value', parameters('afdEndpoints')[copyIndex()].routes), createObject('value', createArray()))]", - "tags": "[if(contains(parameters('afdEndpoints')[copyIndex()], 'tags'), createObject('value', parameters('afdEndpoints')[copyIndex()].tags), createObject('value', createObject()))]" + "tags": { + "value": "[coalesce(tryGet(parameters('afdEndpoints')[copyIndex()], 'tags'), parameters('tags'))]" + } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "11941850826145778575" + "templateHash": "14944467223785761559" }, "name": "CDN Profiles AFD Endpoints", "description": "This module deploys a CDN Profile AFD Endpoint.", @@ -1722,7 +1738,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. The tags of the AFD Endpoint." } @@ -1769,8 +1785,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -1784,7 +1800,13 @@ } } }, - { + "profile": { + "existing": true, + "type": "Microsoft.Cdn/profiles", + "apiVersion": "2023-05-01", + "name": "[parameters('profileName')]" + }, + "afd_endpoint": { "type": "Microsoft.Cdn/profiles/afdEndpoints", "apiVersion": "2023-05-01", "name": "[format('{0}/{1}', parameters('profileName'), parameters('name'))]", @@ -1793,9 +1815,12 @@ "properties": { "autoGeneratedDomainNameLabelScope": "[parameters('autoGeneratedDomainNameLabelScope')]", "enabledState": "[parameters('enabledState')]" - } + }, + "dependsOn": [ + "profile" + ] }, - { + "afd_endpoint_route": { "copy": { "name": "afd_endpoint_route", "count": "[length(parameters('routes'))]" @@ -2040,10 +2065,11 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.Cdn/profiles/afdEndpoints', parameters('profileName'), parameters('name'))]" + "afd_endpoint", + "profile" ] } - ], + }, "outputs": { "name": { "type": "string", @@ -2071,7 +2097,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Cdn/profiles/afdEndpoints', parameters('profileName'), parameters('name')), '2023-05-01', 'full').location]" + "value": "[reference('afd_endpoint', '2023-05-01', 'full').location]" } } } diff --git a/modules/cognitive-services/account/README.md b/modules/cognitive-services/account/README.md index e68d966293..fe726037e1 100644 --- a/modules/cognitive-services/account/README.md +++ b/modules/cognitive-services/account/README.md @@ -1074,7 +1074,6 @@ SKU of the Cognitive Services resource. Use 'Get-AzCognitiveServicesAccountSku' Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `userOwnedStorage` diff --git a/modules/cognitive-services/account/main.bicep b/modules/cognitive-services/account/main.bicep index 395cd07b2e..d610ca257a 100644 --- a/modules/cognitive-services/account/main.bicep +++ b/modules/cognitive-services/account/main.bicep @@ -87,7 +87,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. List of allowed FQDN.') param allowedFqdnList array = [] diff --git a/modules/cognitive-services/account/main.json b/modules/cognitive-services/account/main.json index 8921181da9..edead294ff 100644 --- a/modules/cognitive-services/account/main.json +++ b/modules/cognitive-services/account/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "12216590154280005113" + "templateHash": "4580837563605630694" }, "name": "Cognitive Services", "description": "This module deploys a Cognitive Service.", @@ -511,7 +511,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/compute/availability-set/README.md b/modules/compute/availability-set/README.md index 0b835022f9..3f66218b6c 100644 --- a/modules/compute/availability-set/README.md +++ b/modules/compute/availability-set/README.md @@ -338,7 +338,6 @@ SKU of the availability set.

- Use 'Aligned' for virtual machines with manage Tags of the availability set resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/compute/availability-set/main.bicep b/modules/compute/availability-set/main.bicep index eb7de3b390..81ac15ab0a 100644 --- a/modules/compute/availability-set/main.bicep +++ b/modules/compute/availability-set/main.bicep @@ -27,7 +27,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the availability set resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/compute/availability-set/main.json b/modules/compute/availability-set/main.json index 36fcd16020..fec33868ce 100644 --- a/modules/compute/availability-set/main.json +++ b/modules/compute/availability-set/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "9800465206429537522" + "templateHash": "1732304861308894467" }, "name": "Availability Sets", "description": "This module deploys an Availability Set.", @@ -161,7 +161,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the availability set resource." } diff --git a/modules/compute/disk-encryption-set/README.md b/modules/compute/disk-encryption-set/README.md index c089521965..71674ef593 100644 --- a/modules/compute/disk-encryption-set/README.md +++ b/modules/compute/disk-encryption-set/README.md @@ -445,7 +445,6 @@ Set this flag to true to enable auto-updating of this disk encryption set to the Tags of the disk encryption resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/compute/disk-encryption-set/main.bicep b/modules/compute/disk-encryption-set/main.bicep index d58f341dcb..97ee119695 100644 --- a/modules/compute/disk-encryption-set/main.bicep +++ b/modules/compute/disk-encryption-set/main.bicep @@ -42,7 +42,7 @@ param managedIdentities managedIdentitiesType = { param roleAssignments roleAssignmentType @description('Optional. Tags of the disk encryption resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/compute/disk-encryption-set/main.json b/modules/compute/disk-encryption-set/main.json index bc9dabcebb..ea392d6920 100644 --- a/modules/compute/disk-encryption-set/main.json +++ b/modules/compute/disk-encryption-set/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "18120106263067507123" + "templateHash": "8371597260084065156" }, "name": "Disk Encryption Sets", "description": "This module deploys a Disk Encryption Set.", @@ -208,7 +208,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the disk encryption resource." } diff --git a/modules/compute/disk/README.md b/modules/compute/disk/README.md index 69240d24d3..80142db63b 100644 --- a/modules/compute/disk/README.md +++ b/modules/compute/disk/README.md @@ -694,7 +694,6 @@ The resource ID of the storage account containing the blob to import as a disk. Tags of the availability set resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `uploadSizeBytes` diff --git a/modules/compute/disk/main.bicep b/modules/compute/disk/main.bicep index 97763d0072..53c193e794 100644 --- a/modules/compute/disk/main.bicep +++ b/modules/compute/disk/main.bicep @@ -125,7 +125,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the availability set resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/compute/disk/main.json b/modules/compute/disk/main.json index 13b6907981..83bb0e27a3 100644 --- a/modules/compute/disk/main.json +++ b/modules/compute/disk/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "11610180604623373886" + "templateHash": "4197028586802526466" }, "name": "Compute Disks", "description": "This module deploys a Compute Disk", @@ -330,7 +330,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the availability set resource." } diff --git a/modules/compute/gallery/README.md b/modules/compute/gallery/README.md index af9c047b55..83e56b75e2 100644 --- a/modules/compute/gallery/README.md +++ b/modules/compute/gallery/README.md @@ -566,7 +566,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags for all resources. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/compute/gallery/application/README.md b/modules/compute/gallery/application/README.md index 1c393f79b8..d49ba7327a 100644 --- a/modules/compute/gallery/application/README.md +++ b/modules/compute/gallery/application/README.md @@ -196,7 +196,6 @@ This property allows you to specify the supported type of the OS that applicatio Tags for all resources. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/compute/gallery/application/main.bicep b/modules/compute/gallery/application/main.bicep index 7ba3361d61..eda8727a21 100644 --- a/modules/compute/gallery/application/main.bicep +++ b/modules/compute/gallery/application/main.bicep @@ -41,7 +41,7 @@ param endOfLifeDate string = '' param roleAssignments roleAssignmentType @sys.description('Optional. Tags for all resources.') -param tags object = {} +param tags object? @sys.description('Optional. A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application.') param customActions array = [] diff --git a/modules/compute/gallery/application/main.json b/modules/compute/gallery/application/main.json index 31d60925d6..ffc09df846 100644 --- a/modules/compute/gallery/application/main.json +++ b/modules/compute/gallery/application/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "13186916483114520290" + "templateHash": "4468420728204112478" }, "name": "Compute Galleries Applications", "description": "This module deploys an Azure Compute Gallery Application.", @@ -162,7 +162,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags for all resources." } diff --git a/modules/compute/gallery/image/README.md b/modules/compute/gallery/image/README.md index 1bba091667..5c489dcbe1 100644 --- a/modules/compute/gallery/image/README.md +++ b/modules/compute/gallery/image/README.md @@ -320,7 +320,6 @@ The name of the gallery Image Definition SKU. Tags for all resources. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/compute/gallery/image/main.bicep b/modules/compute/gallery/image/main.bicep index e9e349d0db..c46910a248 100644 --- a/modules/compute/gallery/image/main.bicep +++ b/modules/compute/gallery/image/main.bicep @@ -120,7 +120,7 @@ param excludedDiskTypes array = [] param roleAssignments roleAssignmentType @sys.description('Optional. Tags for all resources.') -param tags object = {} +param tags object? var builtInRoleNames = { 'Compute Gallery Sharing Admin': subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '1ef6a3be-d0ac-425d-8c01-acb62866290b') diff --git a/modules/compute/gallery/image/main.json b/modules/compute/gallery/image/main.json index b823bbfc2d..9c37688f70 100644 --- a/modules/compute/gallery/image/main.json +++ b/modules/compute/gallery/image/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "13132790244989513026" + "templateHash": "12640831453229356933" }, "name": "Compute Galleries Image Definitions", "description": "This module deploys an Azure Compute Gallery Image Definition.", @@ -305,7 +305,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags for all resources." } diff --git a/modules/compute/gallery/main.bicep b/modules/compute/gallery/main.bicep index 46be75d168..0a284f8096 100644 --- a/modules/compute/gallery/main.bicep +++ b/modules/compute/gallery/main.bicep @@ -25,7 +25,7 @@ param lock lockType param roleAssignments roleAssignmentType @sys.description('Optional. Tags for all resources.') -param tags object = {} +param tags object? @sys.description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true @@ -100,7 +100,7 @@ module galleries_applications 'application/main.bicep' = [for (application, inde endOfLifeDate: contains(application, 'endOfLifeDate') ? application.endOfLifeDate : '' roleAssignments: contains(application, 'roleAssignments') ? application.roleAssignments : [] customActions: contains(application, 'customActions') ? application.customActions : [] - tags: contains(application, 'tags') ? application.tags : {} + tags: application.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } }] @@ -132,7 +132,7 @@ module galleries_images 'image/main.bicep' = [for (image, index) in images: { endOfLife: contains(image, 'endOfLife') ? image.endOfLife : '' excludedDiskTypes: contains(image, 'excludedDiskTypes') ? image.excludedDiskTypes : [] roleAssignments: contains(image, 'roleAssignments') ? image.roleAssignments : [] - tags: contains(image, 'tags') ? image.tags : {} + tags: image.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } }] diff --git a/modules/compute/gallery/main.json b/modules/compute/gallery/main.json index 49c768695e..3994fa8cb5 100644 --- a/modules/compute/gallery/main.json +++ b/modules/compute/gallery/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "17534490293657424034" + "templateHash": "3058018993104486515" }, "name": "Azure Compute Galleries", "description": "This module deploys an Azure Compute Gallery (formerly known as Shared Image Gallery).", @@ -155,7 +155,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags for all resources." } @@ -269,7 +269,9 @@ "endOfLifeDate": "[if(contains(parameters('applications')[copyIndex()], 'endOfLifeDate'), createObject('value', parameters('applications')[copyIndex()].endOfLifeDate), createObject('value', ''))]", "roleAssignments": "[if(contains(parameters('applications')[copyIndex()], 'roleAssignments'), createObject('value', parameters('applications')[copyIndex()].roleAssignments), createObject('value', createArray()))]", "customActions": "[if(contains(parameters('applications')[copyIndex()], 'customActions'), createObject('value', parameters('applications')[copyIndex()].customActions), createObject('value', createArray()))]", - "tags": "[if(contains(parameters('applications')[copyIndex()], 'tags'), createObject('value', parameters('applications')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('applications')[copyIndex()], 'tags'), parameters('tags'))]" + }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" } @@ -282,7 +284,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "13186916483114520290" + "templateHash": "4468420728204112478" }, "name": "Compute Galleries Applications", "description": "This module deploys an Azure Compute Gallery Application.", @@ -438,7 +440,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags for all resources." } @@ -601,7 +603,9 @@ "endOfLife": "[if(contains(parameters('images')[copyIndex()], 'endOfLife'), createObject('value', parameters('images')[copyIndex()].endOfLife), createObject('value', ''))]", "excludedDiskTypes": "[if(contains(parameters('images')[copyIndex()], 'excludedDiskTypes'), createObject('value', parameters('images')[copyIndex()].excludedDiskTypes), createObject('value', createArray()))]", "roleAssignments": "[if(contains(parameters('images')[copyIndex()], 'roleAssignments'), createObject('value', parameters('images')[copyIndex()].roleAssignments), createObject('value', createArray()))]", - "tags": "[if(contains(parameters('images')[copyIndex()], 'tags'), createObject('value', parameters('images')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('images')[copyIndex()], 'tags'), parameters('tags'))]" + }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" } @@ -614,7 +618,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "13132790244989513026" + "templateHash": "12640831453229356933" }, "name": "Compute Galleries Image Definitions", "description": "This module deploys an Azure Compute Gallery Image Definition.", @@ -913,7 +917,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags for all resources." } diff --git a/modules/compute/image/README.md b/modules/compute/image/README.md index 20977af57d..4d8ffaa7a3 100644 --- a/modules/compute/image/README.md +++ b/modules/compute/image/README.md @@ -352,7 +352,6 @@ The source virtual machine from which Image is created. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `zoneResilient` diff --git a/modules/compute/image/main.bicep b/modules/compute/image/main.bicep index 203a121a09..2fedc3882d 100644 --- a/modules/compute/image/main.bicep +++ b/modules/compute/image/main.bicep @@ -30,7 +30,7 @@ param hyperVGeneration string = 'V1' param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. The extended location of the Image.') param extendedLocation object = {} diff --git a/modules/compute/image/main.json b/modules/compute/image/main.json index 2c9b478e60..bcbe6df5a3 100644 --- a/modules/compute/image/main.json +++ b/modules/compute/image/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15652042467625410891" + "templateHash": "9558360786962697877" }, "name": "Images", "description": "This module deploys a Compute Image.", @@ -140,7 +140,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/compute/proximity-placement-group/README.md b/modules/compute/proximity-placement-group/README.md index 44c419f431..e41f19400b 100644 --- a/modules/compute/proximity-placement-group/README.md +++ b/modules/compute/proximity-placement-group/README.md @@ -360,7 +360,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the proximity placement group resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `type` diff --git a/modules/compute/proximity-placement-group/main.bicep b/modules/compute/proximity-placement-group/main.bicep index 363c1885ac..d8c925de6f 100644 --- a/modules/compute/proximity-placement-group/main.bicep +++ b/modules/compute/proximity-placement-group/main.bicep @@ -22,7 +22,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the proximity placement group resource.') -param tags object = {} +param tags object? @description('Optional. Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the proximity placement group can be created.') param zones array = [] diff --git a/modules/compute/proximity-placement-group/main.json b/modules/compute/proximity-placement-group/main.json index 213b46fea4..36747472f3 100644 --- a/modules/compute/proximity-placement-group/main.json +++ b/modules/compute/proximity-placement-group/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "7967405335324639786" + "templateHash": "11278878938849478552" }, "name": "Proximity Placement Groups", "description": "This module deploys a Proximity Placement Group.", @@ -144,7 +144,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the proximity placement group resource." } diff --git a/modules/compute/ssh-public-key/README.md b/modules/compute/ssh-public-key/README.md index 45ffe72032..054808608c 100644 --- a/modules/compute/ssh-public-key/README.md +++ b/modules/compute/ssh-public-key/README.md @@ -280,7 +280,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the availability set resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/compute/ssh-public-key/main.bicep b/modules/compute/ssh-public-key/main.bicep index e32c99c496..0d5e181de1 100644 --- a/modules/compute/ssh-public-key/main.bicep +++ b/modules/compute/ssh-public-key/main.bicep @@ -20,7 +20,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the availability set resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/compute/ssh-public-key/main.json b/modules/compute/ssh-public-key/main.json index 943b880282..d71da3411e 100644 --- a/modules/compute/ssh-public-key/main.json +++ b/modules/compute/ssh-public-key/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15947534421126412986" + "templateHash": "12563605105819727190" }, "name": "Public SSH Keys", "description": "This module deploys a Public SSH Key.\r\n\r\n> Note: The resource does not auto-generate the key for you.", @@ -140,7 +140,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the availability set resource." } diff --git a/modules/compute/virtual-machine-scale-set/README.md b/modules/compute/virtual-machine-scale-set/README.md index 6835718941..d7421e7061 100644 --- a/modules/compute/virtual-machine-scale-set/README.md +++ b/modules/compute/virtual-machine-scale-set/README.md @@ -1894,7 +1894,6 @@ The SKU size of the VMs. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `timeZone` diff --git a/modules/compute/virtual-machine-scale-set/main.bicep b/modules/compute/virtual-machine-scale-set/main.bicep index cecffd62dd..e7a0a46271 100644 --- a/modules/compute/virtual-machine-scale-set/main.bicep +++ b/modules/compute/virtual-machine-scale-set/main.bicep @@ -235,7 +235,7 @@ param skuCapacity int = 1 param availabilityZones array = [] @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/compute/virtual-machine-scale-set/main.json b/modules/compute/virtual-machine-scale-set/main.json index e6a0a04847..03a37d7d22 100644 --- a/modules/compute/virtual-machine-scale-set/main.json +++ b/modules/compute/virtual-machine-scale-set/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "9859921411818274686" + "templateHash": "8263419365447007923" }, "name": "Virtual Machine Scale Sets", "description": "This module deploys a Virtual Machine Scale Set.", @@ -682,7 +682,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/compute/virtual-machine/README.md b/modules/compute/virtual-machine/README.md index 4b20b053d4..879a36149b 100644 --- a/modules/compute/virtual-machine/README.md +++ b/modules/compute/virtual-machine/README.md @@ -2505,7 +2505,6 @@ Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `timeZone` diff --git a/modules/compute/virtual-machine/extension/README.md b/modules/compute/virtual-machine/extension/README.md index 761c7b4d27..89e5dc338f 100644 --- a/modules/compute/virtual-machine/extension/README.md +++ b/modules/compute/virtual-machine/extension/README.md @@ -117,7 +117,6 @@ Indicates whether failures stemming from the extension will be suppressed (Opera Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `type` diff --git a/modules/compute/virtual-machine/extension/main.bicep b/modules/compute/virtual-machine/extension/main.bicep index c8a191f1c9..909805fe1c 100644 --- a/modules/compute/virtual-machine/extension/main.bicep +++ b/modules/compute/virtual-machine/extension/main.bicep @@ -43,7 +43,7 @@ param enableAutomaticUpgrade bool param enableDefaultTelemetry bool = true @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name, location)}' diff --git a/modules/compute/virtual-machine/extension/main.json b/modules/compute/virtual-machine/extension/main.json index 782a6fa1ff..50534220f0 100644 --- a/modules/compute/virtual-machine/extension/main.json +++ b/modules/compute/virtual-machine/extension/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -98,14 +99,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -119,7 +120,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -135,9 +142,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -165,7 +175,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } \ No newline at end of file diff --git a/modules/compute/virtual-machine/main.bicep b/modules/compute/virtual-machine/main.bicep index d90fbc7fff..0fa3b644a9 100644 --- a/modules/compute/virtual-machine/main.bicep +++ b/modules/compute/virtual-machine/main.bicep @@ -193,7 +193,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true @@ -343,15 +343,15 @@ module vm_nic 'modules/nested_networkInterface.bicep' = [for (nicConfiguration, networkInterfaceName: '${name}${nicConfiguration.nicSuffix}' virtualMachineName: name location: location - tags: tags enableIPForwarding: contains(nicConfiguration, 'enableIPForwarding') ? (!empty(nicConfiguration.enableIPForwarding) ? nicConfiguration.enableIPForwarding : false) : false enableAcceleratedNetworking: contains(nicConfiguration, 'enableAcceleratedNetworking') ? nicConfiguration.enableAcceleratedNetworking : true dnsServers: contains(nicConfiguration, 'dnsServers') ? (!empty(nicConfiguration.dnsServers) ? nicConfiguration.dnsServers : []) : [] networkSecurityGroupResourceId: contains(nicConfiguration, 'networkSecurityGroupResourceId') ? nicConfiguration.networkSecurityGroupResourceId : '' ipConfigurations: nicConfiguration.ipConfigurations - lock: lock + lock: nicConfiguration.?lock ?? lock + tags: nicConfiguration.?tags ?? tags diagnosticSettings: nicConfiguration.?diagnosticSettings - roleAssignments: contains(nicConfiguration, 'roleAssignments') ? (!empty(nicConfiguration.roleAssignments) ? nicConfiguration.roleAssignments : []) : [] + roleAssignments: nicConfiguration.?roleAssignments } }] @@ -472,7 +472,7 @@ module vm_aadJoinExtension 'extension/main.bicep' = if (extensionAadJoinConfig.e autoUpgradeMinorVersion: contains(extensionAadJoinConfig, 'autoUpgradeMinorVersion') ? extensionAadJoinConfig.autoUpgradeMinorVersion : true enableAutomaticUpgrade: contains(extensionAadJoinConfig, 'enableAutomaticUpgrade') ? extensionAadJoinConfig.enableAutomaticUpgrade : false settings: contains(extensionAadJoinConfig, 'settings') ? extensionAadJoinConfig.settings : {} - tags: contains(extensionAadJoinConfig, 'tags') ? extensionAadJoinConfig.tags : {} + tags: extensionAadJoinConfig.?tags ?? tags } } @@ -487,7 +487,7 @@ module vm_domainJoinExtension 'extension/main.bicep' = if (extensionDomainJoinCo autoUpgradeMinorVersion: contains(extensionDomainJoinConfig, 'autoUpgradeMinorVersion') ? extensionDomainJoinConfig.autoUpgradeMinorVersion : true enableAutomaticUpgrade: contains(extensionDomainJoinConfig, 'enableAutomaticUpgrade') ? extensionDomainJoinConfig.enableAutomaticUpgrade : false settings: extensionDomainJoinConfig.settings - tags: contains(extensionDomainJoinConfig, 'tags') ? extensionDomainJoinConfig.tags : {} + tags: extensionDomainJoinConfig.?tags ?? tags protectedSettings: { Password: extensionDomainJoinPassword } @@ -506,7 +506,7 @@ module vm_microsoftAntiMalwareExtension 'extension/main.bicep' = if (extensionAn autoUpgradeMinorVersion: contains(extensionAntiMalwareConfig, 'autoUpgradeMinorVersion') ? extensionAntiMalwareConfig.autoUpgradeMinorVersion : true enableAutomaticUpgrade: contains(extensionAntiMalwareConfig, 'enableAutomaticUpgrade') ? extensionAntiMalwareConfig.enableAutomaticUpgrade : false settings: extensionAntiMalwareConfig.settings - tags: contains(extensionAntiMalwareConfig, 'tags') ? extensionAntiMalwareConfig.tags : {} + tags: extensionAntiMalwareConfig.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } } @@ -529,7 +529,7 @@ module vm_microsoftMonitoringAgentExtension 'extension/main.bicep' = if (extensi settings: { workspaceId: !empty(monitoringWorkspaceId) ? vm_logAnalyticsWorkspace.properties.customerId : '' } - tags: contains(extensionMonitoringAgentConfig, 'tags') ? extensionMonitoringAgentConfig.tags : {} + tags: extensionMonitoringAgentConfig.?tags ?? tags protectedSettings: { workspaceKey: !empty(monitoringWorkspaceId) ? vm_logAnalyticsWorkspace.listKeys().primarySharedKey : '' } @@ -548,7 +548,7 @@ module vm_dependencyAgentExtension 'extension/main.bicep' = if (extensionDepende autoUpgradeMinorVersion: contains(extensionDependencyAgentConfig, 'autoUpgradeMinorVersion') ? extensionDependencyAgentConfig.autoUpgradeMinorVersion : true enableAutomaticUpgrade: contains(extensionDependencyAgentConfig, 'enableAutomaticUpgrade') ? extensionDependencyAgentConfig.enableAutomaticUpgrade : true enableDefaultTelemetry: enableReferencedModulesTelemetry - tags: contains(extensionDependencyAgentConfig, 'tags') ? extensionDependencyAgentConfig.tags : {} + tags: extensionDependencyAgentConfig.?tags ?? tags } } @@ -563,7 +563,7 @@ module vm_networkWatcherAgentExtension 'extension/main.bicep' = if (extensionNet autoUpgradeMinorVersion: contains(extensionNetworkWatcherAgentConfig, 'autoUpgradeMinorVersion') ? extensionNetworkWatcherAgentConfig.autoUpgradeMinorVersion : true enableAutomaticUpgrade: contains(extensionNetworkWatcherAgentConfig, 'enableAutomaticUpgrade') ? extensionNetworkWatcherAgentConfig.enableAutomaticUpgrade : false enableDefaultTelemetry: enableReferencedModulesTelemetry - tags: contains(extensionNetworkWatcherAgentConfig, 'tags') ? extensionNetworkWatcherAgentConfig.tags : {} + tags: extensionNetworkWatcherAgentConfig.?tags ?? tags } } @@ -578,7 +578,7 @@ module vm_desiredStateConfigurationExtension 'extension/main.bicep' = if (extens autoUpgradeMinorVersion: contains(extensionDSCConfig, 'autoUpgradeMinorVersion') ? extensionDSCConfig.autoUpgradeMinorVersion : true enableAutomaticUpgrade: contains(extensionDSCConfig, 'enableAutomaticUpgrade') ? extensionDSCConfig.enableAutomaticUpgrade : false settings: contains(extensionDSCConfig, 'settings') ? extensionDSCConfig.settings : {} - tags: contains(extensionDSCConfig, 'tags') ? extensionDSCConfig.tags : {} + tags: extensionDSCConfig.?tags ?? tags protectedSettings: contains(extensionDSCConfig, 'protectedSettings') ? extensionDSCConfig.protectedSettings : {} enableDefaultTelemetry: enableReferencedModulesTelemetry } @@ -597,7 +597,7 @@ module vm_customScriptExtension 'extension/main.bicep' = if (extensionCustomScri settings: { fileUris: [for fileData in extensionCustomScriptConfig.fileData: contains(fileData, 'storageAccountId') ? '${fileData.uri}?${listAccountSas(fileData.storageAccountId, '2019-04-01', accountSasProperties).accountSasToken}' : fileData.uri] } - tags: contains(extensionCustomScriptConfig, 'tags') ? extensionCustomScriptConfig.tags : {} + tags: extensionCustomScriptConfig.?tags ?? tags protectedSettings: extensionCustomScriptProtectedSetting enableDefaultTelemetry: enableReferencedModulesTelemetry } @@ -618,7 +618,7 @@ module vm_azureDiskEncryptionExtension 'extension/main.bicep' = if (extensionAzu enableAutomaticUpgrade: contains(extensionAzureDiskEncryptionConfig, 'enableAutomaticUpgrade') ? extensionAzureDiskEncryptionConfig.enableAutomaticUpgrade : false forceUpdateTag: contains(extensionAzureDiskEncryptionConfig, 'forceUpdateTag') ? extensionAzureDiskEncryptionConfig.forceUpdateTag : '1.0' settings: extensionAzureDiskEncryptionConfig.settings - tags: contains(extensionAzureDiskEncryptionConfig, 'tags') ? extensionAzureDiskEncryptionConfig.tags : {} + tags: extensionAzureDiskEncryptionConfig.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } dependsOn: [ diff --git a/modules/compute/virtual-machine/main.json b/modules/compute/virtual-machine/main.json index cb4a01ea7c..bc357c1252 100644 --- a/modules/compute/virtual-machine/main.json +++ b/modules/compute/virtual-machine/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "10963953838389818589" + "templateHash": "13033892292472228031" }, "name": "Virtual Machines", "description": "This module deploys a Virtual Machine with one or multiple NICs and optionally one or multiple public IPs.", @@ -607,7 +607,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -973,9 +973,6 @@ "location": { "value": "[parameters('location')]" }, - "tags": { - "value": "[parameters('tags')]" - }, "enableIPForwarding": "[if(contains(parameters('nicConfigurations')[copyIndex()], 'enableIPForwarding'), if(not(empty(parameters('nicConfigurations')[copyIndex()].enableIPForwarding)), createObject('value', parameters('nicConfigurations')[copyIndex()].enableIPForwarding), createObject('value', false())), createObject('value', false()))]", "enableAcceleratedNetworking": "[if(contains(parameters('nicConfigurations')[copyIndex()], 'enableAcceleratedNetworking'), createObject('value', parameters('nicConfigurations')[copyIndex()].enableAcceleratedNetworking), createObject('value', true()))]", "dnsServers": "[if(contains(parameters('nicConfigurations')[copyIndex()], 'dnsServers'), if(not(empty(parameters('nicConfigurations')[copyIndex()].dnsServers)), createObject('value', parameters('nicConfigurations')[copyIndex()].dnsServers), createObject('value', createArray())), createObject('value', createArray()))]", @@ -984,12 +981,17 @@ "value": "[parameters('nicConfigurations')[copyIndex()].ipConfigurations]" }, "lock": { - "value": "[parameters('lock')]" + "value": "[coalesce(tryGet(parameters('nicConfigurations')[copyIndex()], 'lock'), parameters('lock'))]" + }, + "tags": { + "value": "[coalesce(tryGet(parameters('nicConfigurations')[copyIndex()], 'tags'), parameters('tags'))]" }, "diagnosticSettings": { "value": "[tryGet(parameters('nicConfigurations')[copyIndex()], 'diagnosticSettings')]" }, - "roleAssignments": "[if(contains(parameters('nicConfigurations')[copyIndex()], 'roleAssignments'), if(not(empty(parameters('nicConfigurations')[copyIndex()].roleAssignments)), createObject('value', parameters('nicConfigurations')[copyIndex()].roleAssignments), createObject('value', createArray())), createObject('value', createArray()))]" + "roleAssignments": { + "value": "[tryGet(parameters('nicConfigurations')[copyIndex()], 'roleAssignments')]" + } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", @@ -999,7 +1001,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "17831295506111976442" + "templateHash": "2272323782582357015" } }, "definitions": { @@ -1133,6 +1135,72 @@ } }, "nullable": true + }, + "roleAssignmentType": { + "type": "array", + "items": { + "type": "object", + "properties": { + "roleDefinitionIdOrName": { + "type": "string", + "metadata": { + "description": "Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead." + } + }, + "principalId": { + "type": "string", + "metadata": { + "description": "Required. The principal ID of the principal (user/group/identity) to assign the role to." + } + }, + "principalType": { + "type": "string", + "allowedValues": [ + "Device", + "ForeignGroup", + "Group", + "ServicePrincipal", + "User" + ], + "nullable": true, + "metadata": { + "description": "Optional. The principal type of the assigned principal ID." + } + }, + "description": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The description of the role assignment." + } + }, + "condition": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"" + } + }, + "conditionVersion": { + "type": "string", + "allowedValues": [ + "2.0" + ], + "nullable": true, + "metadata": { + "description": "Optional. Version of the condition." + } + }, + "delegatedManagedIdentityResourceId": { + "type": "string", + "nullable": true, + "metadata": { + "description": "Optional. The Resource Id of the delegated managed identity resource." + } + } + } + }, + "nullable": true } }, "parameters": { @@ -1146,7 +1214,8 @@ "type": "string" }, "tags": { - "type": "object" + "type": "object", + "nullable": true }, "enableIPForwarding": { "type": "bool", @@ -1180,8 +1249,7 @@ } }, "roleAssignments": { - "type": "array", - "defaultValue": [], + "$ref": "#/definitions/roleAssignmentType", "metadata": { "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'." } @@ -1225,7 +1293,7 @@ "skuName": "[if(contains(parameters('ipConfigurations')[copyIndex()], 'skuName'), createObject('value', parameters('ipConfigurations')[copyIndex()].skuName), createObject('value', 'Standard'))]", "skuTier": "[if(contains(parameters('ipConfigurations')[copyIndex()], 'skuTier'), createObject('value', parameters('ipConfigurations')[copyIndex()].skuTier), createObject('value', 'Regional'))]", "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('ipConfigurations')[copyIndex()], 'tags'), parameters('tags'))]" }, "zones": "[if(contains(parameters('ipConfigurations')[copyIndex()], 'zones'), createObject('value', parameters('ipConfigurations')[copyIndex()].zones), createObject('value', createArray()))]" }, @@ -2265,16 +2333,19 @@ "autoUpgradeMinorVersion": "[if(contains(parameters('extensionAadJoinConfig'), 'autoUpgradeMinorVersion'), createObject('value', parameters('extensionAadJoinConfig').autoUpgradeMinorVersion), createObject('value', true()))]", "enableAutomaticUpgrade": "[if(contains(parameters('extensionAadJoinConfig'), 'enableAutomaticUpgrade'), createObject('value', parameters('extensionAadJoinConfig').enableAutomaticUpgrade), createObject('value', false()))]", "settings": "[if(contains(parameters('extensionAadJoinConfig'), 'settings'), createObject('value', parameters('extensionAadJoinConfig').settings), createObject('value', createObject()))]", - "tags": "[if(contains(parameters('extensionAadJoinConfig'), 'tags'), createObject('value', parameters('extensionAadJoinConfig').tags), createObject('value', createObject()))]" + "tags": { + "value": "[coalesce(tryGet(parameters('extensionAadJoinConfig'), 'tags'), parameters('tags'))]" + } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -2367,14 +2438,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -2388,7 +2459,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -2404,9 +2481,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -2434,7 +2514,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -2472,7 +2552,9 @@ "settings": { "value": "[parameters('extensionDomainJoinConfig').settings]" }, - "tags": "[if(contains(parameters('extensionDomainJoinConfig'), 'tags'), createObject('value', parameters('extensionDomainJoinConfig').tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('extensionDomainJoinConfig'), 'tags'), parameters('tags'))]" + }, "protectedSettings": { "value": { "Password": "[parameters('extensionDomainJoinPassword')]" @@ -2484,12 +2566,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -2582,14 +2665,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -2603,7 +2686,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -2619,9 +2708,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -2649,7 +2741,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -2687,19 +2779,22 @@ "settings": { "value": "[parameters('extensionAntiMalwareConfig').settings]" }, - "tags": "[if(contains(parameters('extensionAntiMalwareConfig'), 'tags'), createObject('value', parameters('extensionAntiMalwareConfig').tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('extensionAntiMalwareConfig'), 'tags'), parameters('tags'))]" + }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -2792,14 +2887,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -2813,7 +2908,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -2829,9 +2930,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -2859,7 +2963,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -2897,7 +3001,9 @@ "workspaceId": "[if(not(empty(parameters('monitoringWorkspaceId'))), reference('vm_logAnalyticsWorkspace').customerId, '')]" } }, - "tags": "[if(contains(parameters('extensionMonitoringAgentConfig'), 'tags'), createObject('value', parameters('extensionMonitoringAgentConfig').tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('extensionMonitoringAgentConfig'), 'tags'), parameters('tags'))]" + }, "protectedSettings": { "value": { "workspaceKey": "[if(not(empty(parameters('monitoringWorkspaceId'))), listKeys(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', split(if(not(empty(parameters('monitoringWorkspaceId'))), parameters('monitoringWorkspaceId'), '//'), '/')[2], split(if(not(empty(parameters('monitoringWorkspaceId'))), parameters('monitoringWorkspaceId'), '////'), '/')[4]), 'Microsoft.OperationalInsights/workspaces', last(split(if(not(empty(parameters('monitoringWorkspaceId'))), parameters('monitoringWorkspaceId'), 'law'), '/'))), '2021-06-01').primarySharedKey, '')]" @@ -2909,12 +3015,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -3007,14 +3114,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -3028,7 +3135,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -3044,9 +3157,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -3074,7 +3190,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -3111,16 +3227,19 @@ "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" }, - "tags": "[if(contains(parameters('extensionDependencyAgentConfig'), 'tags'), createObject('value', parameters('extensionDependencyAgentConfig').tags), createObject('value', createObject()))]" + "tags": { + "value": "[coalesce(tryGet(parameters('extensionDependencyAgentConfig'), 'tags'), parameters('tags'))]" + } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -3213,14 +3332,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -3234,7 +3353,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -3250,9 +3375,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -3280,7 +3408,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -3316,16 +3444,19 @@ "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" }, - "tags": "[if(contains(parameters('extensionNetworkWatcherAgentConfig'), 'tags'), createObject('value', parameters('extensionNetworkWatcherAgentConfig').tags), createObject('value', createObject()))]" + "tags": { + "value": "[coalesce(tryGet(parameters('extensionNetworkWatcherAgentConfig'), 'tags'), parameters('tags'))]" + } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -3418,14 +3549,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -3439,7 +3570,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -3455,9 +3592,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -3485,7 +3625,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -3521,7 +3661,9 @@ "autoUpgradeMinorVersion": "[if(contains(parameters('extensionDSCConfig'), 'autoUpgradeMinorVersion'), createObject('value', parameters('extensionDSCConfig').autoUpgradeMinorVersion), createObject('value', true()))]", "enableAutomaticUpgrade": "[if(contains(parameters('extensionDSCConfig'), 'enableAutomaticUpgrade'), createObject('value', parameters('extensionDSCConfig').enableAutomaticUpgrade), createObject('value', false()))]", "settings": "[if(contains(parameters('extensionDSCConfig'), 'settings'), createObject('value', parameters('extensionDSCConfig').settings), createObject('value', createObject()))]", - "tags": "[if(contains(parameters('extensionDSCConfig'), 'tags'), createObject('value', parameters('extensionDSCConfig').tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('extensionDSCConfig'), 'tags'), parameters('tags'))]" + }, "protectedSettings": "[if(contains(parameters('extensionDSCConfig'), 'protectedSettings'), createObject('value', parameters('extensionDSCConfig').protectedSettings), createObject('value', createObject()))]", "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" @@ -3529,12 +3671,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -3627,14 +3770,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -3648,7 +3791,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -3664,9 +3813,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -3694,7 +3846,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -3736,7 +3888,9 @@ ] } }, - "tags": "[if(contains(parameters('extensionCustomScriptConfig'), 'tags'), createObject('value', parameters('extensionCustomScriptConfig').tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('extensionCustomScriptConfig'), 'tags'), parameters('tags'))]" + }, "protectedSettings": { "value": "[parameters('extensionCustomScriptProtectedSetting')]" }, @@ -3746,12 +3900,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -3844,14 +3999,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -3865,7 +4020,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -3881,9 +4042,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -3911,7 +4075,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } @@ -3949,19 +4113,22 @@ "settings": { "value": "[parameters('extensionAzureDiskEncryptionConfig').settings]" }, - "tags": "[if(contains(parameters('extensionAzureDiskEncryptionConfig'), 'tags'), createObject('value', parameters('extensionAzureDiskEncryptionConfig').tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('extensionAzureDiskEncryptionConfig'), 'tags'), parameters('tags'))]" + }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16166330808348655128" + "templateHash": "9638144716839375831" }, "name": "Virtual Machine Extensions", "description": "This module deploys a Virtual Machine Extension.", @@ -4054,14 +4221,14 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -4075,7 +4242,13 @@ } } }, - { + "virtualMachine": { + "existing": true, + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2022-11-01", + "name": "[parameters('virtualMachineName')]" + }, + "extension": { "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2022-11-01", "name": "[format('{0}/{1}', parameters('virtualMachineName'), parameters('name'))]", @@ -4091,9 +4264,12 @@ "settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]", "protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]", "suppressFailures": "[parameters('supressFailures')]" - } + }, + "dependsOn": [ + "virtualMachine" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -4121,7 +4297,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('virtualMachineName'), parameters('name')), '2022-11-01', 'full').location]" + "value": "[reference('extension', '2022-11-01', 'full').location]" } } } diff --git a/modules/compute/virtual-machine/modules/nested_networkInterface.bicep b/modules/compute/virtual-machine/modules/nested_networkInterface.bicep index 87ba4a986a..133483d231 100644 --- a/modules/compute/virtual-machine/modules/nested_networkInterface.bicep +++ b/modules/compute/virtual-machine/modules/nested_networkInterface.bicep @@ -1,7 +1,7 @@ param networkInterfaceName string param virtualMachineName string param location string -param tags object +param tags object? param enableIPForwarding bool = false param enableAcceleratedNetworking bool = false param dnsServers array = [] @@ -16,7 +16,7 @@ param lock lockType param diagnosticSettings diagnosticSettingType @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 = [] +param roleAssignments roleAssignmentType var enableReferencedModulesTelemetry = false @@ -33,7 +33,7 @@ module networkInterface_publicIPAddresses '../../../network/public-ip-address/ma roleAssignments: contains(ipConfiguration, 'roleAssignments') ? ipConfiguration.roleAssignments : [] skuName: contains(ipConfiguration, 'skuName') ? ipConfiguration.skuName : 'Standard' skuTier: contains(ipConfiguration, 'skuTier') ? ipConfiguration.skuTier : 'Regional' - tags: tags + tags: ipConfiguration.?tags ?? tags zones: contains(ipConfiguration, 'zones') ? ipConfiguration.zones : [] } }] @@ -122,3 +122,26 @@ type diagnosticSettingType = { @description('Optional. The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.') marketplacePartnerResourceId: string? }[]? + +type roleAssignmentType = { + @description('Required. The name of the role to assign. If it cannot be found you can specify the role definition ID instead.') + roleDefinitionIdOrName: string + + @description('Required. The principal ID of the principal (user/group/identity) to assign the role to.') + principalId: string + + @description('Optional. The principal type of the assigned principal ID.') + principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device' | null)? + + @description('Optional. The description of the role assignment.') + description: string? + + @description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container"') + condition: string? + + @description('Optional. Version of the condition.') + conditionVersion: '2.0'? + + @description('Optional. The Resource Id of the delegated managed identity resource.') + delegatedManagedIdentityResourceId: string? +}[]? diff --git a/modules/container-instance/container-group/README.md b/modules/container-instance/container-group/README.md index 21ae59f1f7..aadba485c5 100644 --- a/modules/container-instance/container-group/README.md +++ b/modules/container-instance/container-group/README.md @@ -1025,7 +1025,6 @@ Resource ID of the subnet. Only specify when ipAddressType is Private. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `volumes` diff --git a/modules/container-instance/container-group/main.bicep b/modules/container-instance/container-group/main.bicep index ca4a2b89f7..e2dbd5acf4 100644 --- a/modules/container-instance/container-group/main.bicep +++ b/modules/container-instance/container-group/main.bicep @@ -70,7 +70,7 @@ param lock lockType param managedIdentities managedIdentitiesType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/container-instance/container-group/main.json b/modules/container-instance/container-group/main.json index 5cbac36a8f..9b3e6173ad 100644 --- a/modules/container-instance/container-group/main.json +++ b/modules/container-instance/container-group/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15669079272755728924" + "templateHash": "15985356083477047348" }, "name": "Container Instances Container Groups", "description": "This module deploys a Container Instance Container Group.", @@ -196,7 +196,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/container-registry/registry/README.md b/modules/container-registry/registry/README.md index 562b218164..a0116062d8 100644 --- a/modules/container-registry/registry/README.md +++ b/modules/container-registry/registry/README.md @@ -1155,7 +1155,6 @@ Soft Delete policy status. Default is disabled. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `trustPolicyStatus` diff --git a/modules/container-registry/registry/main.bicep b/modules/container-registry/registry/main.bicep index d936cb3207..bcd5d249c5 100644 --- a/modules/container-registry/registry/main.bicep +++ b/modules/container-registry/registry/main.bicep @@ -123,7 +123,7 @@ param lock lockType param managedIdentities managedIdentitiesType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true @@ -258,7 +258,7 @@ module registry_replications 'replication/main.bicep' = [for (replication, index location: replication.location regionEndpointEnabled: contains(replication, 'regionEndpointEnabled') ? replication.regionEndpointEnabled : true zoneRedundancy: contains(replication, 'zoneRedundancy') ? replication.zoneRedundancy : 'Disabled' - tags: contains(replication, 'tags') ? replication.tags : {} + tags: replication.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } }] @@ -292,7 +292,7 @@ module registry_webhooks 'webhook/main.bicep' = [for (webhook, index) in webhook scope: contains(webhook, 'scope') ? webhook.scope : '' status: contains(webhook, 'status') ? webhook.status : 'enabled' serviceUri: webhook.serviceUri - tags: contains(webhook, 'tags') ? webhook.tags : {} + tags: webhook.?tags ?? tags enableDefaultTelemetry: enableReferencedModulesTelemetry } }] diff --git a/modules/container-registry/registry/main.json b/modules/container-registry/registry/main.json index 1a70288241..f7d3b0e0b4 100644 --- a/modules/container-registry/registry/main.json +++ b/modules/container-registry/registry/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "5299367951340146796" + "templateHash": "4552885966837623579" }, "name": "Azure Container Registries (ACR)", "description": "This module deploys an Azure Container Registry (ACR).", @@ -597,7 +597,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -848,19 +848,22 @@ }, "regionEndpointEnabled": "[if(contains(parameters('replications')[copyIndex()], 'regionEndpointEnabled'), createObject('value', parameters('replications')[copyIndex()].regionEndpointEnabled), createObject('value', true()))]", "zoneRedundancy": "[if(contains(parameters('replications')[copyIndex()], 'zoneRedundancy'), createObject('value', parameters('replications')[copyIndex()].zoneRedundancy), createObject('value', 'Disabled'))]", - "tags": "[if(contains(parameters('replications')[copyIndex()], 'tags'), createObject('value', parameters('replications')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('replications')[copyIndex()], 'tags'), parameters('tags'))]" + }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3105247041693395359" + "templateHash": "12719783741437890545" }, "name": "Azure Container Registry (ACR) Replications", "description": "This module deploys an Azure Container Registry (ACR) Replication.", @@ -888,7 +891,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -919,8 +922,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -934,7 +937,13 @@ } } }, - { + "registry": { + "existing": true, + "type": "Microsoft.ContainerRegistry/registries", + "apiVersion": "2023-06-01-preview", + "name": "[parameters('registryName')]" + }, + "replication": { "type": "Microsoft.ContainerRegistry/registries/replications", "apiVersion": "2023-06-01-preview", "name": "[format('{0}/{1}', parameters('registryName'), parameters('name'))]", @@ -943,9 +952,12 @@ "properties": { "regionEndpointEnabled": "[parameters('regionEndpointEnabled')]", "zoneRedundancy": "[parameters('zoneRedundancy')]" - } + }, + "dependsOn": [ + "registry" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -973,7 +985,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/replications', parameters('registryName'), parameters('name')), '2023-06-01-preview', 'full').location]" + "value": "[reference('replication', '2023-06-01-preview', 'full').location]" } } } @@ -1147,19 +1159,22 @@ "serviceUri": { "value": "[parameters('webhooks')[copyIndex()].serviceUri]" }, - "tags": "[if(contains(parameters('webhooks')[copyIndex()], 'tags'), createObject('value', parameters('webhooks')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('webhooks')[copyIndex()], 'tags'), parameters('tags'))]" + }, "enableDefaultTelemetry": { "value": "[variables('enableReferencedModulesTelemetry')]" } }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "6585565654056170037" + "templateHash": "17193481488069435754" }, "name": "Azure Container Registry (ACR) Webhooks", "description": "This module deploys an Azure Container Registry (ACR) Webhook.", @@ -1220,7 +1235,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1247,8 +1262,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -1262,7 +1277,13 @@ } } }, - { + "registry": { + "existing": true, + "type": "Microsoft.ContainerRegistry/registries", + "apiVersion": "2023-06-01-preview", + "name": "[parameters('registryName')]" + }, + "webhook": { "type": "Microsoft.ContainerRegistry/registries/webhooks", "apiVersion": "2023-06-01-preview", "name": "[format('{0}/{1}', parameters('registryName'), parameters('name'))]", @@ -1274,9 +1295,12 @@ "scope": "[parameters('scope')]", "serviceUri": "[parameters('serviceUri')]", "status": "[parameters('status')]" - } + }, + "dependsOn": [ + "registry" + ] } - ], + }, "outputs": { "resourceId": { "type": "string", @@ -1304,28 +1328,28 @@ "metadata": { "description": "The actions of the webhook." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview').actions]" + "value": "[reference('webhook').actions]" }, "status": { "type": "string", "metadata": { "description": "The status of the webhook." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview').status]" + "value": "[reference('webhook').status]" }, "provistioningState": { "type": "string", "metadata": { "description": "The provisioning state of the webhook." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview').provisioningState]" + "value": "[reference('webhook').provisioningState]" }, "location": { "type": "string", "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview', 'full').location]" + "value": "[reference('webhook', '2023-06-01-preview', 'full').location]" } } } diff --git a/modules/container-registry/registry/replication/README.md b/modules/container-registry/registry/replication/README.md index 186c4b5e69..90104f8954 100644 --- a/modules/container-registry/registry/replication/README.md +++ b/modules/container-registry/registry/replication/README.md @@ -77,7 +77,6 @@ The name of the parent registry. Required if the template is used in a standalon Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `zoneRedundancy` diff --git a/modules/container-registry/registry/replication/main.bicep b/modules/container-registry/registry/replication/main.bicep index e3895d9d97..a382a85fc0 100644 --- a/modules/container-registry/registry/replication/main.bicep +++ b/modules/container-registry/registry/replication/main.bicep @@ -12,7 +12,7 @@ param name string param location string = resourceGroup().location @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Specifies whether the replication regional endpoint is enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue to be synced with other replications.') param regionEndpointEnabled bool = true diff --git a/modules/container-registry/registry/replication/main.json b/modules/container-registry/registry/replication/main.json index 4e38206ba4..599a9db03f 100644 --- a/modules/container-registry/registry/replication/main.json +++ b/modules/container-registry/registry/replication/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3105247041693395359" + "templateHash": "12719783741437890545" }, "name": "Azure Container Registry (ACR) Replications", "description": "This module deploys an Azure Container Registry (ACR) Replication.", @@ -33,7 +34,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -64,8 +65,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -79,7 +80,13 @@ } } }, - { + "registry": { + "existing": true, + "type": "Microsoft.ContainerRegistry/registries", + "apiVersion": "2023-06-01-preview", + "name": "[parameters('registryName')]" + }, + "replication": { "type": "Microsoft.ContainerRegistry/registries/replications", "apiVersion": "2023-06-01-preview", "name": "[format('{0}/{1}', parameters('registryName'), parameters('name'))]", @@ -88,9 +95,12 @@ "properties": { "regionEndpointEnabled": "[parameters('regionEndpointEnabled')]", "zoneRedundancy": "[parameters('zoneRedundancy')]" - } + }, + "dependsOn": [ + "registry" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -118,7 +128,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/replications', parameters('registryName'), parameters('name')), '2023-06-01-preview', 'full').location]" + "value": "[reference('replication', '2023-06-01-preview', 'full').location]" } } } \ No newline at end of file diff --git a/modules/container-registry/registry/webhook/README.md b/modules/container-registry/registry/webhook/README.md index a44a03ca55..978954919c 100644 --- a/modules/container-registry/registry/webhook/README.md +++ b/modules/container-registry/registry/webhook/README.md @@ -109,7 +109,6 @@ The status of the webhook at the time the operation was called. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/container-registry/registry/webhook/main.bicep b/modules/container-registry/registry/webhook/main.bicep index 6440840785..c537ad5153 100644 --- a/modules/container-registry/registry/webhook/main.bicep +++ b/modules/container-registry/registry/webhook/main.bicep @@ -33,7 +33,7 @@ param action array = [ param location string = resourceGroup().location @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Custom headers that will be added to the webhook notifications.') param customHeaders object = {} diff --git a/modules/container-registry/registry/webhook/main.json b/modules/container-registry/registry/webhook/main.json index 13ceaa13ed..3d462e11c7 100644 --- a/modules/container-registry/registry/webhook/main.json +++ b/modules/container-registry/registry/webhook/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "6585565654056170037" + "templateHash": "17193481488069435754" }, "name": "Azure Container Registry (ACR) Webhooks", "description": "This module deploys an Azure Container Registry (ACR) Webhook.", @@ -66,7 +67,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -93,8 +94,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -108,7 +109,13 @@ } } }, - { + "registry": { + "existing": true, + "type": "Microsoft.ContainerRegistry/registries", + "apiVersion": "2023-06-01-preview", + "name": "[parameters('registryName')]" + }, + "webhook": { "type": "Microsoft.ContainerRegistry/registries/webhooks", "apiVersion": "2023-06-01-preview", "name": "[format('{0}/{1}', parameters('registryName'), parameters('name'))]", @@ -120,9 +127,12 @@ "scope": "[parameters('scope')]", "serviceUri": "[parameters('serviceUri')]", "status": "[parameters('status')]" - } + }, + "dependsOn": [ + "registry" + ] } - ], + }, "outputs": { "resourceId": { "type": "string", @@ -150,28 +160,28 @@ "metadata": { "description": "The actions of the webhook." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview').actions]" + "value": "[reference('webhook').actions]" }, "status": { "type": "string", "metadata": { "description": "The status of the webhook." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview').status]" + "value": "[reference('webhook').status]" }, "provistioningState": { "type": "string", "metadata": { "description": "The provisioning state of the webhook." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview').provisioningState]" + "value": "[reference('webhook').provisioningState]" }, "location": { "type": "string", "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference(resourceId('Microsoft.ContainerRegistry/registries/webhooks', parameters('registryName'), parameters('name')), '2023-06-01-preview', 'full').location]" + "value": "[reference('webhook', '2023-06-01-preview', 'full').location]" } } } \ No newline at end of file diff --git a/modules/container-service/managed-cluster/README.md b/modules/container-service/managed-cluster/README.md index 0f65581013..b9d850bd99 100644 --- a/modules/container-service/managed-cluster/README.md +++ b/modules/container-service/managed-cluster/README.md @@ -2080,7 +2080,6 @@ The support plan for the Managed Cluster. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `webApplicationRoutingEnabled` diff --git a/modules/container-service/managed-cluster/agent-pool/README.md b/modules/container-service/managed-cluster/agent-pool/README.md index 860074f5aa..c2dda9f91f 100644 --- a/modules/container-service/managed-cluster/agent-pool/README.md +++ b/modules/container-service/managed-cluster/agent-pool/README.md @@ -303,7 +303,6 @@ Possible values are any decimal value greater than zero or -1 which indicates th Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `type` diff --git a/modules/container-service/managed-cluster/agent-pool/main.bicep b/modules/container-service/managed-cluster/agent-pool/main.bicep index f1ea13e08b..aae427dcdc 100644 --- a/modules/container-service/managed-cluster/agent-pool/main.bicep +++ b/modules/container-service/managed-cluster/agent-pool/main.bicep @@ -133,7 +133,7 @@ param scaleSetPriority string = '' param spotMaxPrice int = -1 @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. The type of Agent Pool.') param type string = '' diff --git a/modules/container-service/managed-cluster/agent-pool/main.json b/modules/container-service/managed-cluster/agent-pool/main.json index e1b8d0e5e8..878796aeb1 100644 --- a/modules/container-service/managed-cluster/agent-pool/main.json +++ b/modules/container-service/managed-cluster/agent-pool/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "14295298572292657386" + "templateHash": "15823498371287518640" }, "name": "Azure Kubernetes Service (AKS) Managed Cluster Agent Pools", "description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster Agent Pool.", @@ -262,7 +263,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -318,8 +319,8 @@ "maxSurge": "[parameters('maxSurge')]" } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -333,7 +334,13 @@ } } }, - { + "managedCluster": { + "existing": true, + "type": "Microsoft.ContainerService/managedClusters", + "apiVersion": "2023-07-02-preview", + "name": "[parameters('managedClusterName')]" + }, + "agentPool": { "type": "Microsoft.ContainerService/managedClusters/agentPools", "apiVersion": "2023-07-02-preview", "name": "[format('{0}/{1}', parameters('managedClusterName'), parameters('name'))]", @@ -372,9 +379,12 @@ "vmSize": "[parameters('vmSize')]", "vnetSubnetID": "[parameters('vnetSubnetId')]", "workloadRuntime": "[parameters('workloadRuntime')]" - } + }, + "dependsOn": [ + "managedCluster" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/container-service/managed-cluster/main.bicep b/modules/container-service/managed-cluster/main.bicep index b9f7f16414..5808b8d313 100644 --- a/modules/container-service/managed-cluster/main.bicep +++ b/modules/container-service/managed-cluster/main.bicep @@ -330,7 +330,7 @@ param roleAssignments roleAssignmentType param lock lockType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. The resource ID of the disc encryption set to apply to the cluster. For security reasons, this value should be provided.') param diskEncryptionSetID string = '' @@ -600,7 +600,7 @@ module managedCluster_agentPools 'agent-pool/main.bicep' = [for (agentPool, inde scaleSetEvictionPolicy: contains(agentPool, 'scaleSetEvictionPolicy') ? agentPool.scaleSetEvictionPolicy : 'Delete' scaleSetPriority: contains(agentPool, 'scaleSetPriority') ? agentPool.scaleSetPriority : '' spotMaxPrice: contains(agentPool, 'spotMaxPrice') ? agentPool.spotMaxPrice : -1 - tags: contains(agentPool, 'tags') ? agentPool.tags : {} + tags: agentPool.?tags ?? tags type: contains(agentPool, 'type') ? agentPool.type : '' maxSurge: contains(agentPool, 'maxSurge') ? agentPool.maxSurge : '' vmSize: contains(agentPool, 'vmSize') ? agentPool.vmSize : 'Standard_D2s_v3' diff --git a/modules/container-service/managed-cluster/main.json b/modules/container-service/managed-cluster/main.json index b35df3cf30..552037b85f 100644 --- a/modules/container-service/managed-cluster/main.json +++ b/modules/container-service/managed-cluster/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "10186677383934049186" + "templateHash": "15042684995150005891" }, "name": "Azure Kubernetes Service (AKS) Managed Clusters", "description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.", @@ -899,7 +899,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1266,7 +1266,9 @@ "scaleSetEvictionPolicy": "[if(contains(parameters('agentPools')[copyIndex()], 'scaleSetEvictionPolicy'), createObject('value', parameters('agentPools')[copyIndex()].scaleSetEvictionPolicy), createObject('value', 'Delete'))]", "scaleSetPriority": "[if(contains(parameters('agentPools')[copyIndex()], 'scaleSetPriority'), createObject('value', parameters('agentPools')[copyIndex()].scaleSetPriority), createObject('value', ''))]", "spotMaxPrice": "[if(contains(parameters('agentPools')[copyIndex()], 'spotMaxPrice'), createObject('value', parameters('agentPools')[copyIndex()].spotMaxPrice), createObject('value', -1))]", - "tags": "[if(contains(parameters('agentPools')[copyIndex()], 'tags'), createObject('value', parameters('agentPools')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('agentPools')[copyIndex()], 'tags'), parameters('tags'))]" + }, "type": "[if(contains(parameters('agentPools')[copyIndex()], 'type'), createObject('value', parameters('agentPools')[copyIndex()].type), createObject('value', ''))]", "maxSurge": "[if(contains(parameters('agentPools')[copyIndex()], 'maxSurge'), createObject('value', parameters('agentPools')[copyIndex()].maxSurge), createObject('value', ''))]", "vmSize": "[if(contains(parameters('agentPools')[copyIndex()], 'vmSize'), createObject('value', parameters('agentPools')[copyIndex()].vmSize), createObject('value', 'Standard_D2s_v3'))]", @@ -1278,12 +1280,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "14295298572292657386" + "templateHash": "15823498371287518640" }, "name": "Azure Kubernetes Service (AKS) Managed Cluster Agent Pools", "description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster Agent Pool.", @@ -1540,7 +1543,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1596,8 +1599,8 @@ "maxSurge": "[parameters('maxSurge')]" } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -1611,7 +1614,13 @@ } } }, - { + "managedCluster": { + "existing": true, + "type": "Microsoft.ContainerService/managedClusters", + "apiVersion": "2023-07-02-preview", + "name": "[parameters('managedClusterName')]" + }, + "agentPool": { "type": "Microsoft.ContainerService/managedClusters/agentPools", "apiVersion": "2023-07-02-preview", "name": "[format('{0}/{1}', parameters('managedClusterName'), parameters('name'))]", @@ -1650,9 +1659,12 @@ "vmSize": "[parameters('vmSize')]", "vnetSubnetID": "[parameters('vnetSubnetId')]", "workloadRuntime": "[parameters('workloadRuntime')]" - } + }, + "dependsOn": [ + "managedCluster" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/data-factory/factory/README.md b/modules/data-factory/factory/README.md index cae941fa39..8b1c5eb5c7 100644 --- a/modules/data-factory/factory/README.md +++ b/modules/data-factory/factory/README.md @@ -931,7 +931,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/data-factory/factory/main.bicep b/modules/data-factory/factory/main.bicep index b8cce9bea8..ef4b508dae 100644 --- a/modules/data-factory/factory/main.bicep +++ b/modules/data-factory/factory/main.bicep @@ -83,7 +83,7 @@ param cMKUserAssignedIdentityResourceId string = '' param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/data-factory/factory/main.json b/modules/data-factory/factory/main.json index 11658501f0..bbb370ff4e 100644 --- a/modules/data-factory/factory/main.json +++ b/modules/data-factory/factory/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "4712647299782394769" + "templateHash": "11806238755138054005" }, "name": "Data Factories", "description": "This module deploys a Data Factory.", @@ -560,7 +560,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/data-protection/backup-vault/README.md b/modules/data-protection/backup-vault/README.md index 94825fc794..68efc247f0 100644 --- a/modules/data-protection/backup-vault/README.md +++ b/modules/data-protection/backup-vault/README.md @@ -504,7 +504,6 @@ Security settings for the backup vault. Tags of the Recovery Service Vault resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `type` diff --git a/modules/data-protection/backup-vault/main.bicep b/modules/data-protection/backup-vault/main.bicep index 042be9825e..63aa54ac3d 100644 --- a/modules/data-protection/backup-vault/main.bicep +++ b/modules/data-protection/backup-vault/main.bicep @@ -21,7 +21,7 @@ param lock lockType param managedIdentities managedIdentitiesType @description('Optional. Tags of the Recovery Service Vault resource.') -param tags object = {} +param tags object? @description('Optional. The datastore type to use. ArchiveStore does not support ZoneRedundancy.') @allowed([ diff --git a/modules/data-protection/backup-vault/main.json b/modules/data-protection/backup-vault/main.json index 9db6f483b0..12f17aebcc 100644 --- a/modules/data-protection/backup-vault/main.json +++ b/modules/data-protection/backup-vault/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "11392074106571494077" + "templateHash": "8040175372523410173" }, "name": "Data Protection Backup Vaults", "description": "This module deploys a Data Protection Backup Vault.", @@ -159,7 +159,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Recovery Service Vault resource." } diff --git a/modules/databricks/access-connector/README.md b/modules/databricks/access-connector/README.md index 796b14a8bf..91fdd3ebdd 100644 --- a/modules/databricks/access-connector/README.md +++ b/modules/databricks/access-connector/README.md @@ -347,7 +347,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/databricks/access-connector/main.bicep b/modules/databricks/access-connector/main.bicep index d8ce4aeee9..4f0c6ed5bc 100644 --- a/modules/databricks/access-connector/main.bicep +++ b/modules/databricks/access-connector/main.bicep @@ -6,7 +6,7 @@ metadata owner = 'Azure/module-maintainers' param name string @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Location for all Resources.') param location string = resourceGroup().location diff --git a/modules/databricks/access-connector/main.json b/modules/databricks/access-connector/main.json index 5e8014b2f2..800ffae040 100644 --- a/modules/databricks/access-connector/main.json +++ b/modules/databricks/access-connector/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "9757807827728921562" + "templateHash": "11594689977563461718" }, "name": "Azure Databricks Access Connectors", "description": "This module deploys an Azure Databricks Access Connector.", @@ -137,7 +137,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/databricks/workspace/README.md b/modules/databricks/workspace/README.md index da7f3e5281..12e776c7f6 100644 --- a/modules/databricks/workspace/README.md +++ b/modules/databricks/workspace/README.md @@ -930,7 +930,6 @@ Storage account SKU name. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `vnetAddressPrefix` diff --git a/modules/databricks/workspace/main.bicep b/modules/databricks/workspace/main.bicep index 7db11dae62..1468f38d16 100644 --- a/modules/databricks/workspace/main.bicep +++ b/modules/databricks/workspace/main.bicep @@ -29,7 +29,7 @@ param diagnosticSettings diagnosticSettingType param lock lockType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/databricks/workspace/main.json b/modules/databricks/workspace/main.json index 50c3564b16..ec49639153 100644 --- a/modules/databricks/workspace/main.json +++ b/modules/databricks/workspace/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "13163681429252258069" + "templateHash": "19156344202796197" }, "name": "Azure Databricks Workspaces", "description": "This module deploys an Azure Databricks Workspace.", @@ -395,7 +395,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/db-for-my-sql/flexible-server/README.md b/modules/db-for-my-sql/flexible-server/README.md index ac8fa8150a..7d4bbf44bf 100644 --- a/modules/db-for-my-sql/flexible-server/README.md +++ b/modules/db-for-my-sql/flexible-server/README.md @@ -1088,7 +1088,6 @@ Max storage allowed for a server. In all compute tiers, the minimum storage supp Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `tier` diff --git a/modules/db-for-my-sql/flexible-server/main.bicep b/modules/db-for-my-sql/flexible-server/main.bicep index 9df9e895a6..110a710c26 100644 --- a/modules/db-for-my-sql/flexible-server/main.bicep +++ b/modules/db-for-my-sql/flexible-server/main.bicep @@ -12,7 +12,7 @@ param lock lockType param location string = resourceGroup().location @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. The administrator login name of a server. Can only be specified when the MySQL server is being created.') param administratorLogin string = '' diff --git a/modules/db-for-my-sql/flexible-server/main.json b/modules/db-for-my-sql/flexible-server/main.json index de8040ea03..45a154ff53 100644 --- a/modules/db-for-my-sql/flexible-server/main.json +++ b/modules/db-for-my-sql/flexible-server/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "1179455125587700731" + "templateHash": "2940458480347427239" }, "name": "DBforMySQL Flexible Servers", "description": "This module deploys a DBforMySQL Flexible Server.", @@ -248,7 +248,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/db-for-postgre-sql/flexible-server/README.md b/modules/db-for-postgre-sql/flexible-server/README.md index 2e29c62ecd..30db670f19 100644 --- a/modules/db-for-postgre-sql/flexible-server/README.md +++ b/modules/db-for-postgre-sql/flexible-server/README.md @@ -979,7 +979,6 @@ Max storage allowed for a server. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `tenantId` diff --git a/modules/db-for-postgre-sql/flexible-server/main.bicep b/modules/db-for-postgre-sql/flexible-server/main.bicep index 3df7813d86..84bb983ea8 100644 --- a/modules/db-for-postgre-sql/flexible-server/main.bicep +++ b/modules/db-for-postgre-sql/flexible-server/main.bicep @@ -156,7 +156,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/db-for-postgre-sql/flexible-server/main.json b/modules/db-for-postgre-sql/flexible-server/main.json index fb07682a43..74d5498241 100644 --- a/modules/db-for-postgre-sql/flexible-server/main.json +++ b/modules/db-for-postgre-sql/flexible-server/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "2134307033398708647" + "templateHash": "2281015287111582702" }, "name": "DBforPostgreSQL Flexible Servers", "description": "This module deploys a DBforPostgreSQL Flexible Server.", @@ -502,7 +502,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/desktop-virtualization/application-group/README.md b/modules/desktop-virtualization/application-group/README.md index 985cff6a86..400891b5b2 100644 --- a/modules/desktop-virtualization/application-group/README.md +++ b/modules/desktop-virtualization/application-group/README.md @@ -525,7 +525,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/desktop-virtualization/application-group/main.bicep b/modules/desktop-virtualization/application-group/main.bicep index f1adcbb932..1e18d25925 100644 --- a/modules/desktop-virtualization/application-group/main.bicep +++ b/modules/desktop-virtualization/application-group/main.bicep @@ -35,7 +35,7 @@ param diagnosticSettings diagnosticSettingType param lock lockType @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/desktop-virtualization/application-group/main.json b/modules/desktop-virtualization/application-group/main.json index 905491e364..bd2466264e 100644 --- a/modules/desktop-virtualization/application-group/main.json +++ b/modules/desktop-virtualization/application-group/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3165107620977984204" + "templateHash": "14729705419389731754" }, "name": "Azure Virtual Desktop (AVD) Application Groups", "description": "This module deploys an Azure Virtual Desktop (AVD) Application Group.", @@ -258,7 +258,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/desktop-virtualization/host-pool/README.md b/modules/desktop-virtualization/host-pool/README.md index ce070fc3ec..be6dc2e213 100644 --- a/modules/desktop-virtualization/host-pool/README.md +++ b/modules/desktop-virtualization/host-pool/README.md @@ -702,7 +702,6 @@ Enable Start VM on connect to allow users to start the virtual machine from a de Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `tokenValidityLength` diff --git a/modules/desktop-virtualization/host-pool/main.bicep b/modules/desktop-virtualization/host-pool/main.bicep index cb7f44a990..031b3b5b9e 100644 --- a/modules/desktop-virtualization/host-pool/main.bicep +++ b/modules/desktop-virtualization/host-pool/main.bicep @@ -63,7 +63,7 @@ param diagnosticSettings diagnosticSettingType param lock lockType @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/desktop-virtualization/host-pool/main.json b/modules/desktop-virtualization/host-pool/main.json index b2d0786145..5759d9b41e 100644 --- a/modules/desktop-virtualization/host-pool/main.json +++ b/modules/desktop-virtualization/host-pool/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16828620493021839895" + "templateHash": "2287776590285678937" }, "name": "Azure Virtual Desktop (AVD) Host Pools", "description": "This module deploys an Azure Virtual Desktop (AVD) Host Pool.", @@ -313,7 +313,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/desktop-virtualization/scaling-plan/README.md b/modules/desktop-virtualization/scaling-plan/README.md index 58447da84f..dae9ec2b75 100644 --- a/modules/desktop-virtualization/scaling-plan/README.md +++ b/modules/desktop-virtualization/scaling-plan/README.md @@ -524,7 +524,6 @@ The schedules related to this scaling plan. If no value is provided a default sc Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `timeZone` diff --git a/modules/desktop-virtualization/scaling-plan/main.bicep b/modules/desktop-virtualization/scaling-plan/main.bicep index 34f3f687f3..51d609016c 100644 --- a/modules/desktop-virtualization/scaling-plan/main.bicep +++ b/modules/desktop-virtualization/scaling-plan/main.bicep @@ -73,7 +73,7 @@ param schedules array = [ param hostPoolReferences array = [] @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. The diagnostic settings of the service.') param diagnosticSettings diagnosticSettingType diff --git a/modules/desktop-virtualization/scaling-plan/main.json b/modules/desktop-virtualization/scaling-plan/main.json index f392334372..16160093bf 100644 --- a/modules/desktop-virtualization/scaling-plan/main.json +++ b/modules/desktop-virtualization/scaling-plan/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "9923356797606121055" + "templateHash": "17057413050702654038" }, "name": "Azure Virtual Desktop (AVD) Scaling Plans", "description": "This module deploys an Azure Virtual Desktop (AVD) Scaling Plan.", @@ -276,7 +276,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/desktop-virtualization/workspace/README.md b/modules/desktop-virtualization/workspace/README.md index 6ba2e77ef0..35f5ec4422 100644 --- a/modules/desktop-virtualization/workspace/README.md +++ b/modules/desktop-virtualization/workspace/README.md @@ -463,7 +463,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/desktop-virtualization/workspace/main.bicep b/modules/desktop-virtualization/workspace/main.bicep index a3c050f19b..f566fe1e80 100644 --- a/modules/desktop-virtualization/workspace/main.bicep +++ b/modules/desktop-virtualization/workspace/main.bicep @@ -24,7 +24,7 @@ param diagnosticSettings diagnosticSettingType param lock lockType @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/desktop-virtualization/workspace/main.json b/modules/desktop-virtualization/workspace/main.json index 27edea5a4f..b05e7c83d5 100644 --- a/modules/desktop-virtualization/workspace/main.json +++ b/modules/desktop-virtualization/workspace/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "10079774519163544161" + "templateHash": "17022699140829235991" }, "name": "Azure Virtual Desktop (AVD) Workspaces", "description": "This module deploys an Azure Virtual Desktop (AVD) Workspace.", @@ -242,7 +242,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/dev-test-lab/lab/README.md b/modules/dev-test-lab/lab/README.md index af50afe9e9..e506fa7f34 100644 --- a/modules/dev-test-lab/lab/README.md +++ b/modules/dev-test-lab/lab/README.md @@ -956,7 +956,6 @@ The properties of any lab support message associated with this lab. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `virtualnetworks` diff --git a/modules/dev-test-lab/lab/artifactsource/README.md b/modules/dev-test-lab/lab/artifactsource/README.md index 26aa3c0d4f..f2ac68cd9a 100644 --- a/modules/dev-test-lab/lab/artifactsource/README.md +++ b/modules/dev-test-lab/lab/artifactsource/README.md @@ -121,7 +121,6 @@ Indicates if the artifact source is enabled (values: Enabled, Disabled). Default Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `uri` diff --git a/modules/dev-test-lab/lab/artifactsource/main.bicep b/modules/dev-test-lab/lab/artifactsource/main.bicep index c57f78c6b9..e2c5e2f540 100644 --- a/modules/dev-test-lab/lab/artifactsource/main.bicep +++ b/modules/dev-test-lab/lab/artifactsource/main.bicep @@ -11,7 +11,7 @@ param labName string param name string @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. The artifact source\'s display name. Default is the name of the artifact source.') param displayName string = name diff --git a/modules/dev-test-lab/lab/artifactsource/main.json b/modules/dev-test-lab/lab/artifactsource/main.json index 946b4a505a..734c1e482d 100644 --- a/modules/dev-test-lab/lab/artifactsource/main.json +++ b/modules/dev-test-lab/lab/artifactsource/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "4180084937723506143" + "templateHash": "12165020180713564819" }, "name": "DevTest Lab Artifact Sources", "description": "This module deploys a DevTest Lab Artifact Source.\r\n\r\nAn artifact source allows you to create custom artifacts for the VMs in the lab, or use Azure Resource Manager templates to create a custom test environment. You must add a private Git repository for the artifacts or Resource Manager templates that your team creates. The repository can be hosted on GitHub or on Azure DevOps Services.", @@ -26,7 +27,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -104,8 +105,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -119,7 +120,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "artifactsource": { "type": "Microsoft.DevTestLab/labs/artifactsources", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -133,9 +140,12 @@ "sourceType": "[if(not(empty(parameters('sourceType'))), parameters('sourceType'), null())]", "status": "[parameters('status')]", "uri": "[parameters('uri')]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/dev-test-lab/lab/cost/README.md b/modules/dev-test-lab/lab/cost/README.md index 69d66fdbc7..51d6302f23 100644 --- a/modules/dev-test-lab/lab/cost/README.md +++ b/modules/dev-test-lab/lab/cost/README.md @@ -107,7 +107,6 @@ Target cost status. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `target` diff --git a/modules/dev-test-lab/lab/cost/main.bicep b/modules/dev-test-lab/lab/cost/main.bicep index a11795399e..c0e7f7cb18 100644 --- a/modules/dev-test-lab/lab/cost/main.bicep +++ b/modules/dev-test-lab/lab/cost/main.bicep @@ -15,7 +15,7 @@ param labName string param cycleType string @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Conditional. Reporting cycle start date in the zulu time format (e.g. 2023-12-01T00:00:00.000Z). Required if cycleType is set to "Custom".') param cycleStartDateTime string = '' diff --git a/modules/dev-test-lab/lab/cost/main.json b/modules/dev-test-lab/lab/cost/main.json index 89f70cfd1f..3ec2b33776 100644 --- a/modules/dev-test-lab/lab/cost/main.json +++ b/modules/dev-test-lab/lab/cost/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "17587308196408831883" + "templateHash": "12104430168487418019" }, "name": "DevTest Lab Costs", "description": "This module deploys a DevTest Lab Cost.\r\n\r\nManage lab costs by setting a spending target that can be viewed in the Monthly Estimated Cost Trend chart. DevTest Labs can send a notification when spending reaches the specified target threshold.", @@ -30,7 +31,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -192,8 +193,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -207,7 +208,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "cost": { "type": "Microsoft.DevTestLab/labs/costs", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), 'targetCost')]", @@ -265,9 +272,12 @@ } ] } - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/dev-test-lab/lab/main.bicep b/modules/dev-test-lab/lab/main.bicep index 2d52f27d29..1b54432e6d 100644 --- a/modules/dev-test-lab/lab/main.bicep +++ b/modules/dev-test-lab/lab/main.bicep @@ -15,7 +15,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. The properties of any lab announcement associated with this lab.') param announcement object = {} @@ -188,7 +188,7 @@ module lab_virtualNetworks 'virtualnetwork/main.bicep' = [for (virtualNetwork, i params: { labName: lab.name name: virtualNetwork.name - tags: tags + tags: virtualNetwork.?tags ?? tags externalProviderResourceId: virtualNetwork.externalProviderResourceId description: contains(virtualNetwork, 'description') ? virtualNetwork.description : '' allowedSubnets: contains(virtualNetwork, 'allowedSubnets') ? virtualNetwork.allowedSubnets : [] @@ -202,7 +202,7 @@ module lab_policies 'policyset/policy/main.bicep' = [for (policy, index) in poli params: { labName: lab.name name: policy.name - tags: tags + tags: policy.?tags ?? tags description: contains(policy, 'description') ? policy.description : '' evaluatorType: policy.evaluatorType factData: contains(policy, 'factData') ? policy.factData : '' @@ -218,7 +218,7 @@ module lab_schedules 'schedule/main.bicep' = [for (schedule, index) in schedules params: { labName: lab.name name: schedule.name - tags: tags + tags: schedule.?tags ?? tags taskType: schedule.taskType dailyRecurrence: contains(schedule, 'dailyRecurrence') ? schedule.dailyRecurrence : {} hourlyRecurrence: contains(schedule, 'hourlyRecurrence') ? schedule.hourlyRecurrence : {} @@ -237,7 +237,7 @@ module lab_notificationChannels 'notificationchannel/main.bicep' = [for (notific params: { labName: lab.name name: notificationChannel.name - tags: tags + tags: notificationChannel.?tags ?? tags description: contains(notificationChannel, 'description') ? notificationChannel.description : '' events: notificationChannel.events emailRecipient: contains(notificationChannel, 'emailRecipient') ? notificationChannel.emailRecipient : '' @@ -252,7 +252,7 @@ module lab_artifactSources 'artifactsource/main.bicep' = [for (artifactSource, i params: { labName: lab.name name: artifactSource.name - tags: tags + tags: artifactSource.?tags ?? tags displayName: contains(artifactSource, 'displayName') ? artifactSource.displayName : artifactSource.name branchRef: contains(artifactSource, 'branchRef') ? artifactSource.branchRef : '' folderPath: contains(artifactSource, 'folderPath') ? artifactSource.folderPath : '' @@ -268,7 +268,7 @@ module lab_costs 'cost/main.bicep' = if (!empty(costs)) { name: '${uniqueString(deployment().name, location)}-Lab-Costs' params: { labName: lab.name - tags: tags + tags: costs.?tags ?? tags currencyCode: contains(costs, 'currencyCode') ? costs.currencyCode : 'USD' cycleType: costs.cycleType cycleStartDateTime: contains(costs, 'cycleStartDateTime') ? costs.cycleStartDateTime : '' diff --git a/modules/dev-test-lab/lab/main.json b/modules/dev-test-lab/lab/main.json index 0e566cecde..f7339163ff 100644 --- a/modules/dev-test-lab/lab/main.json +++ b/modules/dev-test-lab/lab/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15532963443565749928" + "templateHash": "14947280208542929227" }, "name": "DevTest Labs", "description": "This module deploys a DevTest Lab.", @@ -148,7 +148,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -464,7 +464,7 @@ "value": "[parameters('virtualnetworks')[copyIndex()].name]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('virtualnetworks')[copyIndex()], 'tags'), parameters('tags'))]" }, "externalProviderResourceId": { "value": "[parameters('virtualnetworks')[copyIndex()].externalProviderResourceId]" @@ -478,12 +478,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "5213684482874022181" + "templateHash": "8382075673072622254" }, "name": "DevTest Lab Virtual Networks", "description": "This module deploys a DevTest Lab Virtual Network.\r\n\r\nLab virtual machines must be deployed into a virtual network. This resource type allows configuring the virtual network and subnet settings used for the lab virtual machines.", @@ -510,7 +511,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -544,8 +545,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -559,7 +560,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "virtualNetwork": { "type": "Microsoft.DevTestLab/labs/virtualnetworks", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -569,9 +576,12 @@ "externalProviderResourceId": "[parameters('externalProviderResourceId')]", "allowedSubnets": "[parameters('allowedSubnets')]", "subnetOverrides": "[parameters('subnetOverrides')]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -622,7 +632,7 @@ "value": "[parameters('policies')[copyIndex()].name]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('policies')[copyIndex()], 'tags'), parameters('tags'))]" }, "description": "[if(contains(parameters('policies')[copyIndex()], 'description'), createObject('value', parameters('policies')[copyIndex()].description), createObject('value', ''))]", "evaluatorType": { @@ -827,7 +837,7 @@ "value": "[parameters('schedules')[copyIndex()].name]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('schedules')[copyIndex()], 'tags'), parameters('tags'))]" }, "taskType": { "value": "[parameters('schedules')[copyIndex()].taskType]" @@ -846,12 +856,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "853057685884144049" + "templateHash": "10592511541548002212" }, "name": "DevTest Lab Schedules", "description": "This module deploys a DevTest Lab Schedule.\r\n\r\nLab schedules are used to modify the settings for auto-shutdown, auto-start for lab virtual machines.", @@ -886,7 +897,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -963,8 +974,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -978,7 +989,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "schedule": { "type": "Microsoft.DevTestLab/labs/schedules", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -992,9 +1009,12 @@ "targetResourceId": "[if(not(empty(parameters('targetResourceId'))), parameters('targetResourceId'), null())]", "timeZoneId": "[parameters('timeZoneId')]", "notificationSettings": "[if(equals(parameters('notificationSettingsStatus'), 'Enabled'), createObject('status', parameters('notificationSettingsStatus'), 'timeInMinutes', parameters('notificationSettingsTimeInMinutes')), createObject())]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1045,7 +1065,7 @@ "value": "[parameters('notificationchannels')[copyIndex()].name]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('notificationchannels')[copyIndex()], 'tags'), parameters('tags'))]" }, "description": "[if(contains(parameters('notificationchannels')[copyIndex()], 'description'), createObject('value', parameters('notificationchannels')[copyIndex()].description), createObject('value', ''))]", "events": { @@ -1060,12 +1080,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "7575060424945865003" + "templateHash": "5225332129791836269" }, "name": "DevTest Lab Notification Channels", "description": "This module deploys a DevTest Lab Notification Channel.\r\n\r\nNotification channels are used by the schedule resource type in order to send notifications or events to email addresses and/or webhooks.", @@ -1090,7 +1111,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1138,8 +1159,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -1153,7 +1174,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "notificationChannel": { "type": "Microsoft.DevTestLab/labs/notificationchannels", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -1164,9 +1191,12 @@ "emailRecipient": "[parameters('emailRecipient')]", "webHookUrl": "[parameters('webHookUrl')]", "notificationLocale": "[parameters('notificationLocale')]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1217,7 +1247,7 @@ "value": "[parameters('artifactsources')[copyIndex()].name]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('artifactsources')[copyIndex()], 'tags'), parameters('tags'))]" }, "displayName": "[if(contains(parameters('artifactsources')[copyIndex()], 'displayName'), createObject('value', parameters('artifactsources')[copyIndex()].displayName), createObject('value', parameters('artifactsources')[copyIndex()].name))]", "branchRef": "[if(contains(parameters('artifactsources')[copyIndex()], 'branchRef'), createObject('value', parameters('artifactsources')[copyIndex()].branchRef), createObject('value', ''))]", @@ -1234,12 +1264,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "4180084937723506143" + "templateHash": "12165020180713564819" }, "name": "DevTest Lab Artifact Sources", "description": "This module deploys a DevTest Lab Artifact Source.\r\n\r\nAn artifact source allows you to create custom artifacts for the VMs in the lab, or use Azure Resource Manager templates to create a custom test environment. You must add a private Git repository for the artifacts or Resource Manager templates that your team creates. The repository can be hosted on GitHub or on Azure DevOps Services.", @@ -1260,7 +1291,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1338,8 +1369,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -1353,7 +1384,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "artifactsource": { "type": "Microsoft.DevTestLab/labs/artifactsources", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -1367,9 +1404,12 @@ "sourceType": "[if(not(empty(parameters('sourceType'))), parameters('sourceType'), null())]", "status": "[parameters('status')]", "uri": "[parameters('uri')]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1414,7 +1454,7 @@ "value": "[parameters('name')]" }, "tags": { - "value": "[parameters('tags')]" + "value": "[coalesce(tryGet(parameters('costs'), 'tags'), parameters('tags'))]" }, "currencyCode": "[if(contains(parameters('costs'), 'currencyCode'), createObject('value', parameters('costs').currencyCode), createObject('value', 'USD'))]", "cycleType": { @@ -1440,12 +1480,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "17587308196408831883" + "templateHash": "12104430168487418019" }, "name": "DevTest Lab Costs", "description": "This module deploys a DevTest Lab Cost.\r\n\r\nManage lab costs by setting a spending target that can be viewed in the Monthly Estimated Cost Trend chart. DevTest Labs can send a notification when spending reaches the specified target threshold.", @@ -1470,7 +1511,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1632,8 +1673,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -1647,7 +1688,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "cost": { "type": "Microsoft.DevTestLab/labs/costs", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), 'targetCost')]", @@ -1705,9 +1752,12 @@ } ] } - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/dev-test-lab/lab/notificationchannel/README.md b/modules/dev-test-lab/lab/notificationchannel/README.md index d78d419ad8..45abfc2693 100644 --- a/modules/dev-test-lab/lab/notificationchannel/README.md +++ b/modules/dev-test-lab/lab/notificationchannel/README.md @@ -96,7 +96,6 @@ The locale to use when sending a notification (fallback for unsupported language Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `webHookUrl` diff --git a/modules/dev-test-lab/lab/notificationchannel/main.bicep b/modules/dev-test-lab/lab/notificationchannel/main.bicep index 4cf83f60ae..cae5615737 100644 --- a/modules/dev-test-lab/lab/notificationchannel/main.bicep +++ b/modules/dev-test-lab/lab/notificationchannel/main.bicep @@ -15,7 +15,7 @@ param labName string param name string @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. Description of notification.') param description string = '' diff --git a/modules/dev-test-lab/lab/notificationchannel/main.json b/modules/dev-test-lab/lab/notificationchannel/main.json index 6251464ffc..bfab5a4069 100644 --- a/modules/dev-test-lab/lab/notificationchannel/main.json +++ b/modules/dev-test-lab/lab/notificationchannel/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "7575060424945865003" + "templateHash": "5225332129791836269" }, "name": "DevTest Lab Notification Channels", "description": "This module deploys a DevTest Lab Notification Channel.\r\n\r\nNotification channels are used by the schedule resource type in order to send notifications or events to email addresses and/or webhooks.", @@ -30,7 +31,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -78,8 +79,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -93,7 +94,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "notificationChannel": { "type": "Microsoft.DevTestLab/labs/notificationchannels", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -104,9 +111,12 @@ "emailRecipient": "[parameters('emailRecipient')]", "webHookUrl": "[parameters('webHookUrl')]", "notificationLocale": "[parameters('notificationLocale')]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/dev-test-lab/lab/schedule/README.md b/modules/dev-test-lab/lab/schedule/README.md index 5d197319c3..293747d728 100644 --- a/modules/dev-test-lab/lab/schedule/README.md +++ b/modules/dev-test-lab/lab/schedule/README.md @@ -109,7 +109,6 @@ The status of the schedule (i.e. Enabled, Disabled). Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `targetResourceId` diff --git a/modules/dev-test-lab/lab/schedule/main.bicep b/modules/dev-test-lab/lab/schedule/main.bicep index a2254c5c5c..7b4df85c7b 100644 --- a/modules/dev-test-lab/lab/schedule/main.bicep +++ b/modules/dev-test-lab/lab/schedule/main.bicep @@ -22,7 +22,7 @@ param name string param taskType string @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. If the schedule will occur once each day of the week, specify the daily recurrence.') param dailyRecurrence object = {} diff --git a/modules/dev-test-lab/lab/schedule/main.json b/modules/dev-test-lab/lab/schedule/main.json index 96c2fa8537..dbbccd0c7e 100644 --- a/modules/dev-test-lab/lab/schedule/main.json +++ b/modules/dev-test-lab/lab/schedule/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "853057685884144049" + "templateHash": "10592511541548002212" }, "name": "DevTest Lab Schedules", "description": "This module deploys a DevTest Lab Schedule.\r\n\r\nLab schedules are used to modify the settings for auto-shutdown, auto-start for lab virtual machines.", @@ -40,7 +41,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -117,8 +118,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -132,7 +133,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "schedule": { "type": "Microsoft.DevTestLab/labs/schedules", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -146,9 +153,12 @@ "targetResourceId": "[if(not(empty(parameters('targetResourceId'))), parameters('targetResourceId'), null())]", "timeZoneId": "[parameters('timeZoneId')]", "notificationSettings": "[if(equals(parameters('notificationSettingsStatus'), 'Enabled'), createObject('status', parameters('notificationSettingsStatus'), 'timeInMinutes', parameters('notificationSettingsTimeInMinutes')), createObject())]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/dev-test-lab/lab/virtualnetwork/README.md b/modules/dev-test-lab/lab/virtualnetwork/README.md index c2eaf8a2bc..494fe14296 100644 --- a/modules/dev-test-lab/lab/virtualnetwork/README.md +++ b/modules/dev-test-lab/lab/virtualnetwork/README.md @@ -93,7 +93,6 @@ The subnet overrides of the virtual network. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/dev-test-lab/lab/virtualnetwork/main.bicep b/modules/dev-test-lab/lab/virtualnetwork/main.bicep index 79ac891df0..c4076627d9 100644 --- a/modules/dev-test-lab/lab/virtualnetwork/main.bicep +++ b/modules/dev-test-lab/lab/virtualnetwork/main.bicep @@ -14,7 +14,7 @@ param name string param externalProviderResourceId string @sys.description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @sys.description('Optional. The description of the virtual network.') param description string = '' diff --git a/modules/dev-test-lab/lab/virtualnetwork/main.json b/modules/dev-test-lab/lab/virtualnetwork/main.json index 71e0cb54e5..0f32f00fd3 100644 --- a/modules/dev-test-lab/lab/virtualnetwork/main.json +++ b/modules/dev-test-lab/lab/virtualnetwork/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "5213684482874022181" + "templateHash": "8382075673072622254" }, "name": "DevTest Lab Virtual Networks", "description": "This module deploys a DevTest Lab Virtual Network.\r\n\r\nLab virtual machines must be deployed into a virtual network. This resource type allows configuring the virtual network and subnet settings used for the lab virtual machines.", @@ -32,7 +33,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -66,8 +67,8 @@ } } }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2021-04-01", @@ -81,7 +82,13 @@ } } }, - { + "lab": { + "existing": true, + "type": "Microsoft.DevTestLab/labs", + "apiVersion": "2018-09-15", + "name": "[parameters('labName')]" + }, + "virtualNetwork": { "type": "Microsoft.DevTestLab/labs/virtualnetworks", "apiVersion": "2018-09-15", "name": "[format('{0}/{1}', parameters('labName'), parameters('name'))]", @@ -91,9 +98,12 @@ "externalProviderResourceId": "[parameters('externalProviderResourceId')]", "allowedSubnets": "[parameters('allowedSubnets')]", "subnetOverrides": "[parameters('subnetOverrides')]" - } + }, + "dependsOn": [ + "lab" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/digital-twins/digital-twins-instance/README.md b/modules/digital-twins/digital-twins-instance/README.md index 0c42034c49..dcf0765ad2 100644 --- a/modules/digital-twins/digital-twins-instance/README.md +++ b/modules/digital-twins/digital-twins-instance/README.md @@ -727,7 +727,6 @@ Enables system assigned managed identity on the resource. Resource tags. - Required: No - Type: object -- Default: `{object}` ### Parameter: `userAssignedIdentities` diff --git a/modules/digital-twins/digital-twins-instance/main.bicep b/modules/digital-twins/digital-twins-instance/main.bicep index b7d3117847..8ff9c75278 100644 --- a/modules/digital-twins/digital-twins-instance/main.bicep +++ b/modules/digital-twins/digital-twins-instance/main.bicep @@ -11,7 +11,7 @@ param name string param location string = resourceGroup().location @description('Optional. Resource tags.') -param tags object = {} +param tags object? @description('Optional. The lock settings of the service.') param lock lockType diff --git a/modules/digital-twins/digital-twins-instance/main.json b/modules/digital-twins/digital-twins-instance/main.json index f7f565c333..d770a0e408 100644 --- a/modules/digital-twins/digital-twins-instance/main.json +++ b/modules/digital-twins/digital-twins-instance/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "3851102361558562054" + "templateHash": "12569577248629110844" }, "name": "Digital Twins Instances", "description": "This module deploys an Azure Digital Twins Instance.", @@ -378,7 +378,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Resource tags." } diff --git a/modules/document-db/database-account/README.md b/modules/document-db/database-account/README.md index 87ab27ddef..6891ab0f3d 100644 --- a/modules/document-db/database-account/README.md +++ b/modules/document-db/database-account/README.md @@ -1859,7 +1859,6 @@ SQL Databases configurations. Tags of the Database Account resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/document-db/database-account/gremlin-database/README.md b/modules/document-db/database-account/gremlin-database/README.md index 7436326970..da1fb97246 100644 --- a/modules/document-db/database-account/gremlin-database/README.md +++ b/modules/document-db/database-account/gremlin-database/README.md @@ -79,7 +79,6 @@ Name of the Gremlin database. Tags of the Gremlin database resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `throughput` diff --git a/modules/document-db/database-account/gremlin-database/graph/README.md b/modules/document-db/database-account/gremlin-database/graph/README.md index 9bd3196bdc..b682df47c6 100644 --- a/modules/document-db/database-account/gremlin-database/graph/README.md +++ b/modules/document-db/database-account/gremlin-database/graph/README.md @@ -84,7 +84,6 @@ List of paths using which data within the container can be partitioned. Tags of the Gremlin graph resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/document-db/database-account/gremlin-database/graph/main.bicep b/modules/document-db/database-account/gremlin-database/graph/main.bicep index 9606717456..2aa31f8ffb 100644 --- a/modules/document-db/database-account/gremlin-database/graph/main.bicep +++ b/modules/document-db/database-account/gremlin-database/graph/main.bicep @@ -6,7 +6,7 @@ metadata owner = 'Azure/module-maintainers' param name string @description('Optional. Tags of the Gremlin graph resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/document-db/database-account/gremlin-database/graph/main.json b/modules/document-db/database-account/gremlin-database/graph/main.json index ac3ab15bde..140ebcbb80 100644 --- a/modules/document-db/database-account/gremlin-database/graph/main.json +++ b/modules/document-db/database-account/gremlin-database/graph/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "18333404401527081455" + "templateHash": "16432474498986701571" }, "name": "DocumentDB Database Accounts Gremlin Databases Graphs", "description": "This module deploys a DocumentDB Database Accounts Gremlin Database Graph.", @@ -20,7 +21,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Gremlin graph resource." } @@ -59,8 +60,17 @@ } } }, - "resources": [ - { + "resources": { + "databaseAccount::gremlinDatabase": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases", + "apiVersion": "2023-04-15", + "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('gremlinDatabaseName'))]", + "dependsOn": [ + "databaseAccount" + ] + }, + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -74,7 +84,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "gremlinGraph": { "type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}/{2}', parameters('databaseAccountName'), parameters('gremlinDatabaseName'), parameters('name'))]", @@ -87,9 +103,12 @@ "paths": "[if(not(empty(parameters('partitionKeyPaths'))), parameters('partitionKeyPaths'), null())]" } } - } + }, + "dependsOn": [ + "databaseAccount::gremlinDatabase" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/document-db/database-account/gremlin-database/main.bicep b/modules/document-db/database-account/gremlin-database/main.bicep index bef3ca7288..1c2718c46e 100644 --- a/modules/document-db/database-account/gremlin-database/main.bicep +++ b/modules/document-db/database-account/gremlin-database/main.bicep @@ -6,7 +6,7 @@ metadata owner = 'Azure/module-maintainers' param name string @description('Optional. Tags of the Gremlin database resource.') -param tags object = {} +param tags object? @description('Conditional. The name of the parent Gremlin database. Required if the template is used in a standalone deployment.') param databaseAccountName string diff --git a/modules/document-db/database-account/gremlin-database/main.json b/modules/document-db/database-account/gremlin-database/main.json index aef7829f15..7d513e6420 100644 --- a/modules/document-db/database-account/gremlin-database/main.json +++ b/modules/document-db/database-account/gremlin-database/main.json @@ -46,7 +46,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Gremlin database resource." } @@ -156,12 +156,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "18333404401527081455" + "templateHash": "16432474498986701571" }, "name": "DocumentDB Database Accounts Gremlin Databases Graphs", "description": "This module deploys a DocumentDB Database Accounts Gremlin Database Graph.", @@ -176,7 +177,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Gremlin graph resource." } @@ -215,8 +216,17 @@ } } }, - "resources": [ - { + "resources": { + "databaseAccount::gremlinDatabase": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases", + "apiVersion": "2023-04-15", + "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('gremlinDatabaseName'))]", + "dependsOn": [ + "databaseAccount" + ] + }, + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -230,7 +240,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "gremlinGraph": { "type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}/{2}', parameters('databaseAccountName'), parameters('gremlinDatabaseName'), parameters('name'))]", @@ -243,9 +259,12 @@ "paths": "[if(not(empty(parameters('partitionKeyPaths'))), parameters('partitionKeyPaths'), null())]" } } - } + }, + "dependsOn": [ + "databaseAccount::gremlinDatabase" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -299,4 +318,4 @@ "value": "[resourceGroup().name]" } } -} \ No newline at end of file +} diff --git a/modules/document-db/database-account/main.bicep b/modules/document-db/database-account/main.bicep index 3ac93fcc6a..ee19348385 100644 --- a/modules/document-db/database-account/main.bicep +++ b/modules/document-db/database-account/main.bicep @@ -9,7 +9,7 @@ param name string param location string = resourceGroup().location @description('Optional. Tags of the Database Account resource.') -param tags object = {} +param tags object? @description('Optional. The managed identity definition for this resource.') param managedIdentities managedIdentitiesType diff --git a/modules/document-db/database-account/main.json b/modules/document-db/database-account/main.json index 47d04e5c6f..761eb727b6 100644 --- a/modules/document-db/database-account/main.json +++ b/modules/document-db/database-account/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15206663104495888656" + "templateHash": "13265582198003672508" }, "name": "DocumentDB Database Accounts", "description": "This module deploys a DocumentDB Database Account.", @@ -398,7 +398,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Database Account resource." } @@ -774,12 +774,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "11353697729412779140" + "templateHash": "10948740009827102632" }, "name": "DocumentDB Database Account SQL Databases", "description": "This module deploys a SQL Database in a CosmosDB Account.", @@ -821,7 +822,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the SQL database resource." } @@ -837,8 +838,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -852,7 +853,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "sqlDatabase": { "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('name'))]", @@ -861,10 +868,13 @@ "resource": { "id": "[parameters('name')]" }, - "options": "[if(contains(reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName')), '2023-04-15').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" - } + "options": "[if(contains(reference('databaseAccount').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" + }, + "dependsOn": [ + "databaseAccount" + ] }, - { + "container": { "copy": { "name": "container", "count": "[length(parameters('containers'))]" @@ -902,12 +912,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "8116399669974678281" + "templateHash": "5628064493958565248" }, "name": "DocumentDB Database Account SQL Database Containers", "description": "This module deploys a SQL Database Container in a CosmosDB Account.", @@ -972,7 +983,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the SQL Database resource." } @@ -1018,8 +1029,17 @@ } } }, - "resources": [ - { + "resources": { + "databaseAccount::sqlDatabase": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", + "apiVersion": "2023-04-15", + "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('sqlDatabaseName'))]", + "dependsOn": [ + "databaseAccount" + ] + }, + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -1033,7 +1053,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "container": { "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}/{2}', parameters('databaseAccountName'), parameters('sqlDatabaseName'), parameters('name'))]", @@ -1051,10 +1077,13 @@ }, "uniqueKeyPolicy": "[if(not(empty(parameters('uniqueKeyPolicyKeys'))), createObject('uniqueKeys', parameters('uniqueKeyPolicyKeys')), null())]" }, - "options": "[if(contains(reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName')), '2023-04-15').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" - } + "options": "[if(contains(reference('databaseAccount').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" + }, + "dependsOn": [ + "databaseAccount::sqlDatabase" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1081,10 +1110,10 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.DocumentDB/databaseAccounts/sqlDatabases', parameters('databaseAccountName'), parameters('name'))]" + "sqlDatabase" ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1141,12 +1170,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "1822071123668929932" + "templateHash": "18265317713061610546" }, "name": "DocumentDB Database Account MongoDB Databases", "description": "This module deploys a MongoDB Database within a CosmosDB Account.", @@ -1181,7 +1211,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1197,8 +1227,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -1212,7 +1242,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "mongodbDatabase": { "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('name'))]", @@ -1221,10 +1257,13 @@ "resource": { "id": "[parameters('name')]" }, - "options": "[if(contains(reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName')), '2023-04-15').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', parameters('throughput')))]" - } + "options": "[if(contains(reference('databaseAccount').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', parameters('throughput')))]" + }, + "dependsOn": [ + "databaseAccount" + ] }, - { + "mongodbDatabase_collections": { "copy": { "name": "mongodbDatabase_collections", "count": "[length(parameters('collections'))]" @@ -1371,10 +1410,10 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.DocumentDB/databaseAccounts/mongodbDatabases', parameters('databaseAccountName'), parameters('name'))]" + "mongodbDatabase" ] } - ], + }, "outputs": { "name": { "type": "string", @@ -1437,7 +1476,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "1439508098279696940" + "templateHash": "9027351090124444562" }, "name": "DocumentDB Database Account Gremlin Databases", "description": "This module deploys a Gremlin Database within a CosmosDB Account.", @@ -1477,7 +1516,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Gremlin database resource." } @@ -1587,12 +1626,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "18333404401527081455" + "templateHash": "16432474498986701571" }, "name": "DocumentDB Database Accounts Gremlin Databases Graphs", "description": "This module deploys a DocumentDB Database Accounts Gremlin Database Graph.", @@ -1607,7 +1647,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the Gremlin graph resource." } @@ -1646,8 +1686,17 @@ } } }, - "resources": [ - { + "resources": { + "databaseAccount::gremlinDatabase": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases", + "apiVersion": "2023-04-15", + "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('gremlinDatabaseName'))]", + "dependsOn": [ + "databaseAccount" + ] + }, + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -1661,7 +1710,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "gremlinGraph": { "type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}/{2}', parameters('databaseAccountName'), parameters('gremlinDatabaseName'), parameters('name'))]", @@ -1674,9 +1729,12 @@ "paths": "[if(not(empty(parameters('partitionKeyPaths'))), parameters('partitionKeyPaths'), null())]" } } - } + }, + "dependsOn": [ + "databaseAccount::gremlinDatabase" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/document-db/database-account/mongodb-database/README.md b/modules/document-db/database-account/mongodb-database/README.md index 93ddb86a7f..330081f50e 100644 --- a/modules/document-db/database-account/mongodb-database/README.md +++ b/modules/document-db/database-account/mongodb-database/README.md @@ -70,7 +70,6 @@ Name of the mongodb database. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `throughput` diff --git a/modules/document-db/database-account/mongodb-database/main.bicep b/modules/document-db/database-account/mongodb-database/main.bicep index 4598238f0d..a66e001038 100644 --- a/modules/document-db/database-account/mongodb-database/main.bicep +++ b/modules/document-db/database-account/mongodb-database/main.bicep @@ -15,7 +15,7 @@ param throughput int = 400 param collections array = [] @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/document-db/database-account/mongodb-database/main.json b/modules/document-db/database-account/mongodb-database/main.json index ac1f8b3634..ea41158c15 100644 --- a/modules/document-db/database-account/mongodb-database/main.json +++ b/modules/document-db/database-account/mongodb-database/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "1822071123668929932" + "templateHash": "18265317713061610546" }, "name": "DocumentDB Database Account MongoDB Databases", "description": "This module deploys a MongoDB Database within a CosmosDB Account.", @@ -40,7 +41,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -56,8 +57,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -71,7 +72,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "mongodbDatabase": { "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('name'))]", @@ -80,10 +87,13 @@ "resource": { "id": "[parameters('name')]" }, - "options": "[if(contains(reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName')), '2023-04-15').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', parameters('throughput')))]" - } + "options": "[if(contains(reference('databaseAccount').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', parameters('throughput')))]" + }, + "dependsOn": [ + "databaseAccount" + ] }, - { + "mongodbDatabase_collections": { "copy": { "name": "mongodbDatabase_collections", "count": "[length(parameters('collections'))]" @@ -230,10 +240,10 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.DocumentDB/databaseAccounts/mongodbDatabases', parameters('databaseAccountName'), parameters('name'))]" + "mongodbDatabase" ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/document-db/database-account/sql-database/README.md b/modules/document-db/database-account/sql-database/README.md index 83def7fb2b..bb5beed3eb 100644 --- a/modules/document-db/database-account/sql-database/README.md +++ b/modules/document-db/database-account/sql-database/README.md @@ -78,7 +78,6 @@ Name of the SQL database . Tags of the SQL database resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `throughput` diff --git a/modules/document-db/database-account/sql-database/container/README.md b/modules/document-db/database-account/sql-database/container/README.md index a090b1fe3f..a6621174f4 100644 --- a/modules/document-db/database-account/sql-database/container/README.md +++ b/modules/document-db/database-account/sql-database/container/README.md @@ -127,7 +127,6 @@ The name of the parent SQL Database. Required if the template is used in a stand Tags of the SQL Database resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `throughput` diff --git a/modules/document-db/database-account/sql-database/container/main.bicep b/modules/document-db/database-account/sql-database/container/main.bicep index 2219191720..003b8dc007 100644 --- a/modules/document-db/database-account/sql-database/container/main.bicep +++ b/modules/document-db/database-account/sql-database/container/main.bicep @@ -30,7 +30,7 @@ param throughput int = 400 param autoscaleSettingsMaxThroughput int = -1 @description('Optional. Tags of the SQL Database resource.') -param tags object = {} +param tags object? @description('Optional. List of paths using which data within the container can be partitioned.') param paths array = [] diff --git a/modules/document-db/database-account/sql-database/container/main.json b/modules/document-db/database-account/sql-database/container/main.json index 0975283cf0..4f00fe50ef 100644 --- a/modules/document-db/database-account/sql-database/container/main.json +++ b/modules/document-db/database-account/sql-database/container/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "8116399669974678281" + "templateHash": "5628064493958565248" }, "name": "DocumentDB Database Account SQL Database Containers", "description": "This module deploys a SQL Database Container in a CosmosDB Account.", @@ -70,7 +71,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the SQL Database resource." } @@ -116,8 +117,17 @@ } } }, - "resources": [ - { + "resources": { + "databaseAccount::sqlDatabase": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", + "apiVersion": "2023-04-15", + "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('sqlDatabaseName'))]", + "dependsOn": [ + "databaseAccount" + ] + }, + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -131,7 +141,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "container": { "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}/{2}', parameters('databaseAccountName'), parameters('sqlDatabaseName'), parameters('name'))]", @@ -149,10 +165,13 @@ }, "uniqueKeyPolicy": "[if(not(empty(parameters('uniqueKeyPolicyKeys'))), createObject('uniqueKeys', parameters('uniqueKeyPolicyKeys')), null())]" }, - "options": "[if(contains(reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName')), '2023-04-15').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" - } + "options": "[if(contains(reference('databaseAccount').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" + }, + "dependsOn": [ + "databaseAccount::sqlDatabase" + ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/document-db/database-account/sql-database/main.bicep b/modules/document-db/database-account/sql-database/main.bicep index dd4e23c5f6..1d931a726b 100644 --- a/modules/document-db/database-account/sql-database/main.bicep +++ b/modules/document-db/database-account/sql-database/main.bicep @@ -18,7 +18,7 @@ param throughput int = 400 param autoscaleSettingsMaxThroughput int = -1 @description('Optional. Tags of the SQL database resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/document-db/database-account/sql-database/main.json b/modules/document-db/database-account/sql-database/main.json index f077897716..d3c8fefc92 100644 --- a/modules/document-db/database-account/sql-database/main.json +++ b/modules/document-db/database-account/sql-database/main.json @@ -1,11 +1,12 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "11353697729412779140" + "templateHash": "10948740009827102632" }, "name": "DocumentDB Database Account SQL Databases", "description": "This module deploys a SQL Database in a CosmosDB Account.", @@ -47,7 +48,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the SQL database resource." } @@ -63,8 +64,8 @@ "variables": { "enableReferencedModulesTelemetry": false }, - "resources": [ - { + "resources": { + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -78,7 +79,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "sqlDatabase": { "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('name'))]", @@ -87,10 +94,13 @@ "resource": { "id": "[parameters('name')]" }, - "options": "[if(contains(reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName')), '2023-04-15').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" - } + "options": "[if(contains(reference('databaseAccount').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" + }, + "dependsOn": [ + "databaseAccount" + ] }, - { + "container": { "copy": { "name": "container", "count": "[length(parameters('containers'))]" @@ -128,12 +138,13 @@ }, "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "languageVersion": "2.0", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "8116399669974678281" + "templateHash": "5628064493958565248" }, "name": "DocumentDB Database Account SQL Database Containers", "description": "This module deploys a SQL Database Container in a CosmosDB Account.", @@ -198,7 +209,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the SQL Database resource." } @@ -244,8 +255,17 @@ } } }, - "resources": [ - { + "resources": { + "databaseAccount::sqlDatabase": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases", + "apiVersion": "2023-04-15", + "name": "[format('{0}/{1}', parameters('databaseAccountName'), parameters('sqlDatabaseName'))]", + "dependsOn": [ + "databaseAccount" + ] + }, + "defaultTelemetry": { "condition": "[parameters('enableDefaultTelemetry')]", "type": "Microsoft.Resources/deployments", "apiVersion": "2022-09-01", @@ -259,7 +279,13 @@ } } }, - { + "databaseAccount": { + "existing": true, + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2023-04-15", + "name": "[parameters('databaseAccountName')]" + }, + "container": { "type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers", "apiVersion": "2023-04-15", "name": "[format('{0}/{1}/{2}', parameters('databaseAccountName'), parameters('sqlDatabaseName'), parameters('name'))]", @@ -277,10 +303,13 @@ }, "uniqueKeyPolicy": "[if(not(empty(parameters('uniqueKeyPolicyKeys'))), createObject('uniqueKeys', parameters('uniqueKeyPolicyKeys')), null())]" }, - "options": "[if(contains(reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName')), '2023-04-15').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" - } + "options": "[if(contains(reference('databaseAccount').capabilities, createObject('name', 'EnableServerless')), null(), createObject('throughput', if(equals(parameters('autoscaleSettingsMaxThroughput'), -1), parameters('throughput'), null()), 'autoscaleSettings', if(not(equals(parameters('autoscaleSettingsMaxThroughput'), -1)), createObject('maxThroughput', parameters('autoscaleSettingsMaxThroughput')), null())))]" + }, + "dependsOn": [ + "databaseAccount::sqlDatabase" + ] } - ], + }, "outputs": { "name": { "type": "string", @@ -307,10 +336,10 @@ } }, "dependsOn": [ - "[resourceId('Microsoft.DocumentDB/databaseAccounts/sqlDatabases', parameters('databaseAccountName'), parameters('name'))]" + "sqlDatabase" ] } - ], + }, "outputs": { "name": { "type": "string", diff --git a/modules/event-grid/domain/README.md b/modules/event-grid/domain/README.md index 6c71635f0a..c72c581389 100644 --- a/modules/event-grid/domain/README.md +++ b/modules/event-grid/domain/README.md @@ -793,7 +793,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `topics` diff --git a/modules/event-grid/domain/main.bicep b/modules/event-grid/domain/main.bicep index 148f117db7..4e5e97ad29 100644 --- a/modules/event-grid/domain/main.bicep +++ b/modules/event-grid/domain/main.bicep @@ -38,7 +38,7 @@ param roleAssignments roleAssignmentType param lock lockType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/event-grid/domain/main.json b/modules/event-grid/domain/main.json index c0d3e0b923..c605dc1497 100644 --- a/modules/event-grid/domain/main.json +++ b/modules/event-grid/domain/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "16715487695261799270" + "templateHash": "18074779137586977163" }, "name": "Event Grid Domains", "description": "This module deploys an Event Grid Domain.", @@ -433,7 +433,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/event-grid/system-topic/README.md b/modules/event-grid/system-topic/README.md index 76aa28f3f5..5b20bf5b6f 100644 --- a/modules/event-grid/system-topic/README.md +++ b/modules/event-grid/system-topic/README.md @@ -567,7 +567,6 @@ Source for the system topic. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `topicType` diff --git a/modules/event-grid/system-topic/main.bicep b/modules/event-grid/system-topic/main.bicep index f851d03ce8..53d77af4ab 100644 --- a/modules/event-grid/system-topic/main.bicep +++ b/modules/event-grid/system-topic/main.bicep @@ -30,7 +30,7 @@ param lock lockType param managedIdentities managedIdentitiesType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/event-grid/system-topic/main.json b/modules/event-grid/system-topic/main.json index 6e084c85bd..fdc007afc1 100644 --- a/modules/event-grid/system-topic/main.json +++ b/modules/event-grid/system-topic/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "15694608297739544704" + "templateHash": "8924691213553754613" }, "name": "Event Grid System Topics", "description": "This module deploys an Event Grid System Topic.", @@ -293,7 +293,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/event-grid/topic/README.md b/modules/event-grid/topic/README.md index 7eb867998a..363cdc2cc0 100644 --- a/modules/event-grid/topic/README.md +++ b/modules/event-grid/topic/README.md @@ -826,7 +826,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/event-grid/topic/main.bicep b/modules/event-grid/topic/main.bicep index 7e24e9c9fc..4e996d59a5 100644 --- a/modules/event-grid/topic/main.bicep +++ b/modules/event-grid/topic/main.bicep @@ -35,7 +35,7 @@ param roleAssignments roleAssignmentType param lock lockType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/event-grid/topic/main.json b/modules/event-grid/topic/main.json index 7013e9320d..52eebfaa89 100644 --- a/modules/event-grid/topic/main.json +++ b/modules/event-grid/topic/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "8337019560033170518" + "templateHash": "17629869517360394667" }, "name": "Event Grid Topics", "description": "This module deploys an Event Grid Topic.", @@ -426,7 +426,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/event-hub/namespace/README.md b/modules/event-hub/namespace/README.md index 01537b304d..ea77988f49 100644 --- a/modules/event-hub/namespace/README.md +++ b/modules/event-hub/namespace/README.md @@ -1272,7 +1272,6 @@ event hub plan SKU name. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `zoneRedundant` diff --git a/modules/event-hub/namespace/main.bicep b/modules/event-hub/namespace/main.bicep index 57097a54ea..f7ec5002f5 100644 --- a/modules/event-hub/namespace/main.bicep +++ b/modules/event-hub/namespace/main.bicep @@ -102,7 +102,7 @@ param requireInfrastructureEncryption bool = false param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/event-hub/namespace/main.json b/modules/event-hub/namespace/main.json index 6e2eb2d442..ea70a72f71 100644 --- a/modules/event-hub/namespace/main.json +++ b/modules/event-hub/namespace/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "4102382527672113808" + "templateHash": "14752778402428640491" }, "name": "Event Hub Namespaces", "description": "This module deploys an Event Hub Namespace.", @@ -571,7 +571,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/health-bot/health-bot/README.md b/modules/health-bot/health-bot/README.md index cf5076bc30..363f535857 100644 --- a/modules/health-bot/health-bot/README.md +++ b/modules/health-bot/health-bot/README.md @@ -349,7 +349,6 @@ The name of the Azure Health Bot SKU. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/health-bot/health-bot/main.bicep b/modules/health-bot/health-bot/main.bicep index c18e4aa195..4d5164ac7f 100644 --- a/modules/health-bot/health-bot/main.bicep +++ b/modules/health-bot/health-bot/main.bicep @@ -26,7 +26,7 @@ param lock lockType param roleAssignments roleAssignmentType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/health-bot/health-bot/main.json b/modules/health-bot/health-bot/main.json index f4ee735e27..fc4be759e6 100644 --- a/modules/health-bot/health-bot/main.json +++ b/modules/health-bot/health-bot/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "4815130337915787009" + "templateHash": "9469986313045690324" }, "name": "Azure Health Bots", "description": "This module deploys an Azure Health Bot.", @@ -165,7 +165,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } diff --git a/modules/healthcare-apis/workspace/README.md b/modules/healthcare-apis/workspace/README.md index 4db6d1c6c8..443ba44ef1 100644 --- a/modules/healthcare-apis/workspace/README.md +++ b/modules/healthcare-apis/workspace/README.md @@ -545,7 +545,6 @@ Required. The name of the role to assign. If it cannot be found you can specify Tags of the resource. - Required: No - Type: object -- Default: `{object}` ## Outputs diff --git a/modules/healthcare-apis/workspace/dicomservice/README.md b/modules/healthcare-apis/workspace/dicomservice/README.md index 217bc50b8d..82cdc71170 100644 --- a/modules/healthcare-apis/workspace/dicomservice/README.md +++ b/modules/healthcare-apis/workspace/dicomservice/README.md @@ -285,7 +285,6 @@ Control permission for data plane traffic coming from public networks while priv Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `workspaceName` diff --git a/modules/healthcare-apis/workspace/dicomservice/main.bicep b/modules/healthcare-apis/workspace/dicomservice/main.bicep index 29d0dbcf1f..16112998b7 100644 --- a/modules/healthcare-apis/workspace/dicomservice/main.bicep +++ b/modules/healthcare-apis/workspace/dicomservice/main.bicep @@ -52,7 +52,7 @@ param publicNetworkAccess string = 'Disabled' param managedIdentities managedIdentitiesType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/healthcare-apis/workspace/dicomservice/main.json b/modules/healthcare-apis/workspace/dicomservice/main.json index f9627046e0..f05ffafc1c 100644 --- a/modules/healthcare-apis/workspace/dicomservice/main.json +++ b/modules/healthcare-apis/workspace/dicomservice/main.json @@ -263,7 +263,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -397,4 +397,4 @@ "value": "[reference('dicom', '2022-06-01', 'full').location]" } } -} \ No newline at end of file +} diff --git a/modules/healthcare-apis/workspace/fhirservice/README.md b/modules/healthcare-apis/workspace/fhirservice/README.md index 9ae8dc574e..1c8d86d105 100644 --- a/modules/healthcare-apis/workspace/fhirservice/README.md +++ b/modules/healthcare-apis/workspace/fhirservice/README.md @@ -462,7 +462,6 @@ If the SMART on FHIR proxy is enabled. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `workspaceName` diff --git a/modules/healthcare-apis/workspace/fhirservice/main.bicep b/modules/healthcare-apis/workspace/fhirservice/main.bicep index 69c00a4d6a..68fef37742 100644 --- a/modules/healthcare-apis/workspace/fhirservice/main.bicep +++ b/modules/healthcare-apis/workspace/fhirservice/main.bicep @@ -103,7 +103,7 @@ param smartProxyEnabled bool = false param managedIdentities managedIdentitiesType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/healthcare-apis/workspace/fhirservice/main.json b/modules/healthcare-apis/workspace/fhirservice/main.json index 3b995855d7..3e1e52d236 100644 --- a/modules/healthcare-apis/workspace/fhirservice/main.json +++ b/modules/healthcare-apis/workspace/fhirservice/main.json @@ -435,7 +435,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -647,4 +647,4 @@ "value": "[parameters('workspaceName')]" } } -} \ No newline at end of file +} diff --git a/modules/healthcare-apis/workspace/iotconnector/README.md b/modules/healthcare-apis/workspace/iotconnector/README.md index 94f9c1bdf3..2da0f7ced5 100644 --- a/modules/healthcare-apis/workspace/iotconnector/README.md +++ b/modules/healthcare-apis/workspace/iotconnector/README.md @@ -275,7 +275,6 @@ The name of the MedTech service. Tags of the resource. - Required: No - Type: object -- Default: `{object}` ### Parameter: `workspaceName` diff --git a/modules/healthcare-apis/workspace/iotconnector/main.bicep b/modules/healthcare-apis/workspace/iotconnector/main.bicep index c4d2088098..b5aab3e434 100644 --- a/modules/healthcare-apis/workspace/iotconnector/main.bicep +++ b/modules/healthcare-apis/workspace/iotconnector/main.bicep @@ -40,7 +40,7 @@ param lock lockType param managedIdentities managedIdentitiesType @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true diff --git a/modules/healthcare-apis/workspace/iotconnector/main.json b/modules/healthcare-apis/workspace/iotconnector/main.json index 890a2c935e..90607dde65 100644 --- a/modules/healthcare-apis/workspace/iotconnector/main.json +++ b/modules/healthcare-apis/workspace/iotconnector/main.json @@ -245,7 +245,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -566,4 +566,4 @@ "value": "[parameters('workspaceName')]" } } -} \ No newline at end of file +} diff --git a/modules/healthcare-apis/workspace/main.bicep b/modules/healthcare-apis/workspace/main.bicep index 60af91948e..454b86f22e 100644 --- a/modules/healthcare-apis/workspace/main.bicep +++ b/modules/healthcare-apis/workspace/main.bicep @@ -23,7 +23,7 @@ param roleAssignments roleAssignmentType param publicNetworkAccess string = 'Disabled' @description('Optional. Tags of the resource.') -param tags object = {} +param tags object? @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true @@ -110,7 +110,7 @@ module workspace_fhirservices 'fhirservice/main.bicep' = [for (fhir, index) in f location: location workspaceName: workspace.name kind: fhir.kind - tags: contains(fhir, 'tags') ? fhir.tags : {} + tags: fhir.?tags ?? tags publicNetworkAccess: contains(fhir, 'publicNetworkAccess') ? fhir.publicNetworkAccess : 'Disabled' managedIdentities: contains(fhir, 'managedIdentities') ? fhir.managedIdentities : null roleAssignments: contains(fhir, 'roleAssignments') ? fhir.roleAssignments : [] @@ -143,7 +143,7 @@ module workspace_dicomservices 'dicomservice/main.bicep' = [for (dicom, index) i name: dicom.name location: location workspaceName: workspace.name - tags: contains(dicom, 'tags') ? dicom.tags : {} + tags: dicom.?tags ?? tags publicNetworkAccess: contains(dicom, 'publicNetworkAccess') ? dicom.publicNetworkAccess : 'Disabled' managedIdentities: contains(dicom, 'managedIdentities') ? dicom.managedIdentities : null corsOrigins: contains(dicom, 'corsOrigins') ? dicom.corsOrigins : [] @@ -163,7 +163,7 @@ module workspace_iotconnector 'iotconnector/main.bicep' = [for (iotConnector, in name: iotConnector.name location: location workspaceName: workspace.name - tags: contains(iotConnector, 'tags') ? iotConnector.tags : {} + tags: iotConnector.?tags ?? tags eventHubName: iotConnector.eventHubName eventHubNamespaceName: iotConnector.eventHubNamespaceName deviceMapping: contains(iotConnector, 'deviceMapping') ? iotConnector.deviceMapping : { diff --git a/modules/healthcare-apis/workspace/main.json b/modules/healthcare-apis/workspace/main.json index 9954e2db58..8502414d02 100644 --- a/modules/healthcare-apis/workspace/main.json +++ b/modules/healthcare-apis/workspace/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "6558922436832597627" + "templateHash": "9102511166724334580" }, "name": "Healthcare API Workspaces", "description": "This module deploys a Healthcare API Workspace.", @@ -145,7 +145,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -285,7 +285,9 @@ "kind": { "value": "[parameters('fhirservices')[copyIndex()].kind]" }, - "tags": "[if(contains(parameters('fhirservices')[copyIndex()], 'tags'), createObject('value', parameters('fhirservices')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('fhirservices')[copyIndex()], 'tags'), parameters('tags'))]" + }, "publicNetworkAccess": "[if(contains(parameters('fhirservices')[copyIndex()], 'publicNetworkAccess'), createObject('value', parameters('fhirservices')[copyIndex()].publicNetworkAccess), createObject('value', 'Disabled'))]", "managedIdentities": "[if(contains(parameters('fhirservices')[copyIndex()], 'managedIdentities'), createObject('value', parameters('fhirservices')[copyIndex()].managedIdentities), createObject('value', null()))]", "roleAssignments": "[if(contains(parameters('fhirservices')[copyIndex()], 'roleAssignments'), createObject('value', parameters('fhirservices')[copyIndex()].roleAssignments), createObject('value', createArray()))]", @@ -324,7 +326,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "14914386228020873144" + "templateHash": "8893393036207321770" }, "name": "Healthcare API Workspace FHIR Services", "description": "This module deploys a Healthcare API Workspace FHIR Service.", @@ -753,7 +755,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -994,7 +996,9 @@ "workspaceName": { "value": "[parameters('name')]" }, - "tags": "[if(contains(parameters('dicomservices')[copyIndex()], 'tags'), createObject('value', parameters('dicomservices')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('dicomservices')[copyIndex()], 'tags'), parameters('tags'))]" + }, "publicNetworkAccess": "[if(contains(parameters('dicomservices')[copyIndex()], 'publicNetworkAccess'), createObject('value', parameters('dicomservices')[copyIndex()].publicNetworkAccess), createObject('value', 'Disabled'))]", "managedIdentities": "[if(contains(parameters('dicomservices')[copyIndex()], 'managedIdentities'), createObject('value', parameters('dicomservices')[copyIndex()].managedIdentities), createObject('value', null()))]", "corsOrigins": "[if(contains(parameters('dicomservices')[copyIndex()], 'corsOrigins'), createObject('value', parameters('dicomservices')[copyIndex()].corsOrigins), createObject('value', createArray()))]", @@ -1020,7 +1024,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "4165874741118763430" + "templateHash": "10991463946028183992" }, "name": "Healthcare API Workspace DICOM Services", "description": "This module deploys a Healthcare API Workspace DICOM Service.", @@ -1277,7 +1281,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." } @@ -1440,7 +1444,9 @@ "workspaceName": { "value": "[parameters('name')]" }, - "tags": "[if(contains(parameters('iotconnectors')[copyIndex()], 'tags'), createObject('value', parameters('iotconnectors')[copyIndex()].tags), createObject('value', createObject()))]", + "tags": { + "value": "[coalesce(tryGet(parameters('iotconnectors')[copyIndex()], 'tags'), parameters('tags'))]" + }, "eventHubName": { "value": "[parameters('iotconnectors')[copyIndex()].eventHubName]" }, @@ -1469,7 +1475,7 @@ "_generator": { "name": "bicep", "version": "0.22.6.54827", - "templateHash": "9502385350114367681" + "templateHash": "16117637432944064764" }, "name": "Healthcare API Workspace IoT Connectors", "description": "This module deploys a Healthcare API Workspace IoT Connector.", @@ -1708,7 +1714,7 @@ }, "tags": { "type": "object", - "defaultValue": {}, + "nullable": true, "metadata": { "description": "Optional. Tags of the resource." }