diff --git a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml index 4e89156966..bf3d32009d 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml @@ -241,7 +241,7 @@ jobs: } $projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json - if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) { + if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry) -and (Get-Content -Path $functionInput.templateFilePath -Raw) -like '*param enableDefaultTelemetry*') { $functionInput['additionalParameters'] += @{ enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry } @@ -291,7 +291,7 @@ jobs: } $projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json - if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) { + if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry) -and (Get-Content -Path $functionInput.templateFilePath -Raw) -like '*param enableDefaultTelemetry*') { $functionInput['additionalParameters'] += @{ enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry } diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index 97bcc17ec1..ac57bd1e42 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -154,7 +154,7 @@ runs: } $projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json - if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) { + if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry) -and (Get-Content -Path $functionInput.templateFilePath -Raw) -like '*param enableDefaultTelemetry*') { $functionInput['additionalParameters'] += @{ enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry } @@ -191,7 +191,7 @@ runs: } $projectSettings = Get-Content -Path 'settings.json' | ConvertFrom-Json - if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry)) { + if (-not [String]::IsNullOrEmpty($projectSettings.enableDefaultTelemetry) -and (Get-Content -Path $functionInput.templateFilePath -Raw) -like '*param enableDefaultTelemetry*') { $functionInput['additionalParameters'] += @{ enableDefaultTelemetry = $projectSettings.enableDefaultTelemetry } diff --git a/arm/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep b/arm/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep index eb16c6956a..46e36f9645 100644 --- a/arm/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep +++ b/arm/Microsoft.Authorization/policyAssignments/managementGroup/deploy.bicep @@ -62,6 +62,7 @@ var identity_var = identity == 'SystemAssigned' ? { resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policyAssignments/resourceGroup/.bicep/nested_cuaId.bicep b/arm/Microsoft.Authorization/policyAssignments/resourceGroup/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Authorization/policyAssignments/resourceGroup/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep b/arm/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep index 9df8ce15ec..60fd27bf10 100644 --- a/arm/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep +++ b/arm/Microsoft.Authorization/policyAssignments/subscription/deploy.bicep @@ -62,6 +62,7 @@ var identity_var = identity == 'SystemAssigned' ? { resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policyDefinitions/deploy.bicep b/arm/Microsoft.Authorization/policyDefinitions/deploy.bicep index 1aefba8da0..f02c50027d 100644 --- a/arm/Microsoft.Authorization/policyDefinitions/deploy.bicep +++ b/arm/Microsoft.Authorization/policyDefinitions/deploy.bicep @@ -66,6 +66,7 @@ module policyDefinition_mg 'managementGroup/deploy.bicep' = if (empty(subscripti metadata: !empty(metadata) ? metadata : {} parameters: !empty(parameters) ? parameters : {} policyRule: policyRule + location: location } } @@ -81,6 +82,7 @@ module policyDefinition_sub 'subscription/deploy.bicep' = if (!empty(subscriptio metadata: !empty(metadata) ? metadata : {} parameters: !empty(parameters) ? parameters : {} policyRule: policyRule + location: location } } diff --git a/arm/Microsoft.Authorization/policyDefinitions/managementGroup/deploy.bicep b/arm/Microsoft.Authorization/policyDefinitions/managementGroup/deploy.bicep index 5771bc0b23..72920d688c 100644 --- a/arm/Microsoft.Authorization/policyDefinitions/managementGroup/deploy.bicep +++ b/arm/Microsoft.Authorization/policyDefinitions/managementGroup/deploy.bicep @@ -33,11 +33,15 @@ param policyRule object @sys.description('Optional. The group ID of the Management Group. If not provided, will use the current scope for deployment.') param managementGroupId string = managementGroup().name +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policyDefinitions/managementGroup/readme.md b/arm/Microsoft.Authorization/policyDefinitions/managementGroup/readme.md index bfe2719bc8..40b5ea28b6 100644 --- a/arm/Microsoft.Authorization/policyDefinitions/managementGroup/readme.md +++ b/arm/Microsoft.Authorization/policyDefinitions/managementGroup/readme.md @@ -15,6 +15,7 @@ With this module you can create policy definitions on a management group level. | `description` | string | | | Optional. The policy definition description. | | `displayName` | string | | | Optional. The display name of the policy definition. Maximum length is 128 characters. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `managementGroupId` | string | `[managementGroup().name]` | | Optional. The group ID of the Management Group. If not provided, will use the current scope for deployment. | | `metadata` | object | `{object}` | | Optional. The policy Definition metadata. Metadata is an open ended object and is typically a collection of key-value pairs. | | `mode` | string | `All` | `[All, Indexed, Microsoft.KeyVault.Data, Microsoft.ContainerService.Data, Microsoft.Kubernetes.Data]` | Optional. The policy definition mode. Default is All, Some examples are All, Indexed, Microsoft.KeyVault.Data. | diff --git a/arm/Microsoft.Authorization/policyDefinitions/subscription/deploy.bicep b/arm/Microsoft.Authorization/policyDefinitions/subscription/deploy.bicep index f7f14a96d8..cd6f480468 100644 --- a/arm/Microsoft.Authorization/policyDefinitions/subscription/deploy.bicep +++ b/arm/Microsoft.Authorization/policyDefinitions/subscription/deploy.bicep @@ -33,11 +33,15 @@ param policyRule object @sys.description('Optional. The subscription ID of the subscription') param subscriptionId string = subscription().subscriptionId +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policyDefinitions/subscription/readme.md b/arm/Microsoft.Authorization/policyDefinitions/subscription/readme.md index 90de7e498b..f6c5d7d6ad 100644 --- a/arm/Microsoft.Authorization/policyDefinitions/subscription/readme.md +++ b/arm/Microsoft.Authorization/policyDefinitions/subscription/readme.md @@ -15,6 +15,7 @@ With this module you can create policy definitions on a subscription level. | `description` | string | | | Optional. The policy definition description. | | `displayName` | string | | | Optional. The display name of the policy definition. Maximum length is 128 characters. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `metadata` | object | `{object}` | | Optional. The policy Definition metadata. Metadata is an open ended object and is typically a collection of key-value pairs. | | `mode` | string | `All` | `[All, Indexed, Microsoft.KeyVault.Data, Microsoft.ContainerService.Data, Microsoft.Kubernetes.Data]` | Optional. The policy definition mode. Default is All, Some examples are All, Indexed, Microsoft.KeyVault.Data. | | `name` | string | | | Required. Specifies the name of the policy definition. Maximum length is 64 characters. | diff --git a/arm/Microsoft.Authorization/policyExemptions/deploy.bicep b/arm/Microsoft.Authorization/policyExemptions/deploy.bicep index 0ab2370f2a..13c4652945 100644 --- a/arm/Microsoft.Authorization/policyExemptions/deploy.bicep +++ b/arm/Microsoft.Authorization/policyExemptions/deploy.bicep @@ -47,6 +47,7 @@ param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { @@ -70,6 +71,7 @@ module policyExemption_mg 'managementGroup/deploy.bicep' = if (empty(subscriptio policyDefinitionReferenceIds: !empty(policyDefinitionReferenceIds) ? policyDefinitionReferenceIds : [] expiresOn: !empty(expiresOn) ? expiresOn : '' managementGroupId: managementGroupId + location: location } } @@ -86,6 +88,7 @@ module policyExemption_sub 'subscription/deploy.bicep' = if (!empty(subscription policyDefinitionReferenceIds: !empty(policyDefinitionReferenceIds) ? policyDefinitionReferenceIds : [] expiresOn: !empty(expiresOn) ? expiresOn : '' subscriptionId: subscriptionId + location: location } } diff --git a/arm/Microsoft.Authorization/policyExemptions/managementGroup/deploy.bicep b/arm/Microsoft.Authorization/policyExemptions/managementGroup/deploy.bicep index d87a8d0718..d3843fa673 100644 --- a/arm/Microsoft.Authorization/policyExemptions/managementGroup/deploy.bicep +++ b/arm/Microsoft.Authorization/policyExemptions/managementGroup/deploy.bicep @@ -33,11 +33,15 @@ param expiresOn string = '' @sys.description('Optional. The group ID of the management group to be exempted from the policy assignment. If not provided, will use the current scope for deployment.') param managementGroupId string = managementGroup().name +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policyExemptions/managementGroup/readme.md b/arm/Microsoft.Authorization/policyExemptions/managementGroup/readme.md index 2650c770fa..831d46387c 100644 --- a/arm/Microsoft.Authorization/policyExemptions/managementGroup/readme.md +++ b/arm/Microsoft.Authorization/policyExemptions/managementGroup/readme.md @@ -17,6 +17,7 @@ With this module you can create policy exemptions on a management group level. | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | | `exemptionCategory` | string | `Mitigated` | `[Mitigated, Waiver]` | Optional. The policy exemption category. Possible values are Waiver and Mitigated. Default is Mitigated | | `expiresOn` | string | | | Optional. The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy exemption. e.g. 2021-10-02T03:57:00.000Z | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `managementGroupId` | string | `[managementGroup().name]` | | Optional. The group ID of the management group to be exempted from the policy assignment. If not provided, will use the current scope for deployment. | | `metadata` | object | `{object}` | | Optional. The policy exemption metadata. Metadata is an open ended object and is typically a collection of key-value pairs. | | `name` | string | | | Required. Specifies the name of the policy exemption. Maximum length is 64 characters for management group scope. | diff --git a/arm/Microsoft.Authorization/policyExemptions/resourceGroup/.bicep/nested_cuaId.bicep b/arm/Microsoft.Authorization/policyExemptions/resourceGroup/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Authorization/policyExemptions/resourceGroup/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Authorization/policyExemptions/subscription/deploy.bicep b/arm/Microsoft.Authorization/policyExemptions/subscription/deploy.bicep index 2fec3817f7..84db8b97da 100644 --- a/arm/Microsoft.Authorization/policyExemptions/subscription/deploy.bicep +++ b/arm/Microsoft.Authorization/policyExemptions/subscription/deploy.bicep @@ -33,11 +33,15 @@ param expiresOn string = '' @sys.description('Optional. The subscription ID of the subscription to be exempted from the policy assignment. If not provided, will use the current scope for deployment.') param subscriptionId string = subscription().subscriptionId +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policyExemptions/subscription/readme.md b/arm/Microsoft.Authorization/policyExemptions/subscription/readme.md index dd60c9e262..3f59663251 100644 --- a/arm/Microsoft.Authorization/policyExemptions/subscription/readme.md +++ b/arm/Microsoft.Authorization/policyExemptions/subscription/readme.md @@ -17,6 +17,7 @@ With this module you can create policy exemptions on a subscription level. | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | | `exemptionCategory` | string | `Mitigated` | `[Mitigated, Waiver]` | Optional. The policy exemption category. Possible values are Waiver and Mitigated. Default is Mitigated | | `expiresOn` | string | | | Optional. The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy exemption. e.g. 2021-10-02T03:57:00.000Z | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `metadata` | object | `{object}` | | Optional. The policy exemption metadata. Metadata is an open ended object and is typically a collection of key-value pairs. | | `name` | string | | | Required. Specifies the name of the policy exemption. Maximum length is 64 characters for subscription scope. | | `policyAssignmentId` | string | | | Required. The resource ID of the policy assignment that is being exempted. | diff --git a/arm/Microsoft.Authorization/policySetDefinitions/deploy.bicep b/arm/Microsoft.Authorization/policySetDefinitions/deploy.bicep index 063a7b5d90..83f59917ce 100644 --- a/arm/Microsoft.Authorization/policySetDefinitions/deploy.bicep +++ b/arm/Microsoft.Authorization/policySetDefinitions/deploy.bicep @@ -37,6 +37,7 @@ param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { @@ -59,6 +60,7 @@ module policySetDefinition_mg 'managementGroup/deploy.bicep' = if (empty(subscri policyDefinitions: policyDefinitions policyDefinitionGroups: !empty(policyDefinitionGroups) ? policyDefinitionGroups : [] managementGroupId: managementGroupId + location: location } } @@ -74,6 +76,7 @@ module policySetDefinition_sub 'subscription/deploy.bicep' = if (!empty(subscrip policyDefinitions: policyDefinitions policyDefinitionGroups: !empty(policyDefinitionGroups) ? policyDefinitionGroups : [] subscriptionId: subscriptionId + location: location } } diff --git a/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/deploy.bicep b/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/deploy.bicep index d735154b5d..028bdd3b25 100644 --- a/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/deploy.bicep +++ b/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/deploy.bicep @@ -26,11 +26,15 @@ param policyDefinitionGroups array = [] @sys.description('Optional. The Set Definition (Initiative) parameters that can be used in policy definition references.') param parameters object = {} +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/readme.md b/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/readme.md index e0368addc0..b6503fbdf8 100644 --- a/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/readme.md +++ b/arm/Microsoft.Authorization/policySetDefinitions/managementGroup/readme.md @@ -15,6 +15,7 @@ With this module you can create policy set definitions on a management group lev | `description` | string | | | Optional. The description name of the Set Definition (Initiative) | | `displayName` | string | | | Optional. The display name of the Set Definition (Initiative). Maximum length is 128 characters. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `managementGroupId` | string | `[managementGroup().name]` | | Optional. The group ID of the Management Group. If not provided, will use the current scope for deployment. | | `metadata` | object | `{object}` | | Optional. The Set Definition (Initiative) metadata. Metadata is an open ended object and is typically a collection of key-value pairs. | | `name` | string | | | Required. Specifies the name of the policy Set Definition (Initiative). Maximum length is 24 characters for management group scope. | diff --git a/arm/Microsoft.Authorization/policySetDefinitions/subscription/deploy.bicep b/arm/Microsoft.Authorization/policySetDefinitions/subscription/deploy.bicep index b35c20f3fd..3474e4acd6 100644 --- a/arm/Microsoft.Authorization/policySetDefinitions/subscription/deploy.bicep +++ b/arm/Microsoft.Authorization/policySetDefinitions/subscription/deploy.bicep @@ -26,11 +26,15 @@ param policyDefinitionGroups array = [] @sys.description('Optional. The Set Definition (Initiative) parameters that can be used in policy definition references.') param parameters object = {} +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/policySetDefinitions/subscription/readme.md b/arm/Microsoft.Authorization/policySetDefinitions/subscription/readme.md index 9cae11577f..bb77375e7c 100644 --- a/arm/Microsoft.Authorization/policySetDefinitions/subscription/readme.md +++ b/arm/Microsoft.Authorization/policySetDefinitions/subscription/readme.md @@ -15,6 +15,7 @@ With this module you can create policy set definitions on a subscription level. | `description` | string | | | Optional. The description name of the Set Definition (Initiative) | | `displayName` | string | | | Optional. The display name of the Set Definition (Initiative). Maximum length is 128 characters. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `metadata` | object | `{object}` | | Optional. The Set Definition (Initiative) metadata. Metadata is an open ended object and is typically a collection of key-value pairs. | | `name` | string | | | Required. Specifies the name of the policy Set Definition (Initiative). Maximum length is 64 characters for subscription scope. | | `parameters` | object | `{object}` | | Optional. The Set Definition (Initiative) parameters that can be used in policy definition references. | diff --git a/arm/Microsoft.Authorization/roleAssignments/deploy.bicep b/arm/Microsoft.Authorization/roleAssignments/deploy.bicep index c8146cecba..c45027f8cc 100644 --- a/arm/Microsoft.Authorization/roleAssignments/deploy.bicep +++ b/arm/Microsoft.Authorization/roleAssignments/deploy.bicep @@ -49,6 +49,7 @@ param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { @@ -71,6 +72,7 @@ module roleAssignment_mg 'managementGroup/deploy.bicep' = if (empty(subscription delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : '' conditionVersion: conditionVersion condition: !empty(condition) ? condition : '' + location: location } } @@ -86,6 +88,7 @@ module roleAssignment_sub 'subscription/deploy.bicep' = if (!empty(subscriptionI delegatedManagedIdentityResourceId: !empty(delegatedManagedIdentityResourceId) ? delegatedManagedIdentityResourceId : '' conditionVersion: conditionVersion condition: !empty(condition) ? condition : '' + location: location } } diff --git a/arm/Microsoft.Authorization/roleAssignments/managementGroup/deploy.bicep b/arm/Microsoft.Authorization/roleAssignments/managementGroup/deploy.bicep index 0ccf2e8137..2eaa4187c4 100644 --- a/arm/Microsoft.Authorization/roleAssignments/managementGroup/deploy.bicep +++ b/arm/Microsoft.Authorization/roleAssignments/managementGroup/deploy.bicep @@ -38,6 +38,9 @@ param principalType string = '' @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + var builtInRoleNames_var = { 'AcrPush': '/providers/Microsoft.Authorization/roleDefinitions/8311e382-0749-4cb8-b61a-304f252e45ec' 'API Management Service Contributor': '/providers/Microsoft.Authorization/roleDefinitions/312a565d-c81f-4fd8-895a-4e21e48d571c' @@ -326,6 +329,7 @@ var roleDefinitionId_var = (contains(builtInRoleNames_var, roleDefinitionIdOrNam resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/roleAssignments/managementGroup/readme.md b/arm/Microsoft.Authorization/roleAssignments/managementGroup/readme.md index 10c47b32e9..d54f8fd802 100644 --- a/arm/Microsoft.Authorization/roleAssignments/managementGroup/readme.md +++ b/arm/Microsoft.Authorization/roleAssignments/managementGroup/readme.md @@ -17,6 +17,7 @@ With this module you can perform role assignments on a management group level | `delegatedManagedIdentityResourceId` | string | | | Optional. ID of the delegated managed identity resource | | `description` | string | | | Optional. Description of role assignment | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `managementGroupId` | string | `[managementGroup().name]` | | Optional. Group ID of the Management Group to assign the RBAC role to. If not provided, will use the current scope for deployment. | | `principalId` | string | | | Required. The Principal or Object ID of the Security Principal (User, Group, Service Principal, Managed Identity) | | `principalType` | string | | `[ServicePrincipal, Group, User, ForeignGroup, Device, ]` | Optional. The principal type of the assigned principal ID. | diff --git a/arm/Microsoft.Authorization/roleAssignments/resourceGroup/.bicep/nested_cuaId.bicep b/arm/Microsoft.Authorization/roleAssignments/resourceGroup/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Authorization/roleAssignments/resourceGroup/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Authorization/roleAssignments/subscription/deploy.bicep b/arm/Microsoft.Authorization/roleAssignments/subscription/deploy.bicep index b5600f9379..0e1242f2cf 100644 --- a/arm/Microsoft.Authorization/roleAssignments/subscription/deploy.bicep +++ b/arm/Microsoft.Authorization/roleAssignments/subscription/deploy.bicep @@ -18,6 +18,9 @@ param delegatedManagedIdentityResourceId string = '' @sys.description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to') param condition string = '' +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Version of the condition. Currently accepted value is "2.0"') @allowed([ '2.0' @@ -324,6 +327,7 @@ var builtInRoleNames_var = { resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/roleAssignments/subscription/readme.md b/arm/Microsoft.Authorization/roleAssignments/subscription/readme.md index c85644fcfd..54fdd3b58f 100644 --- a/arm/Microsoft.Authorization/roleAssignments/subscription/readme.md +++ b/arm/Microsoft.Authorization/roleAssignments/subscription/readme.md @@ -17,6 +17,7 @@ With this module you can perform role assignments on a subscription level | `delegatedManagedIdentityResourceId` | string | | | Optional. ID of the delegated managed identity resource | | `description` | string | | | Optional. Description of role assignment | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `principalId` | string | | | Required. The Principal or Object ID of the Security Principal (User, Group, Service Principal, Managed Identity) | | `principalType` | string | | `[ServicePrincipal, Group, User, ForeignGroup, Device, ]` | Optional. The principal type of the assigned principal ID. | | `roleDefinitionIdOrName` | string | | | Required. You can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11' | diff --git a/arm/Microsoft.Authorization/roleDefinitions/deploy.bicep b/arm/Microsoft.Authorization/roleDefinitions/deploy.bicep index 1bf3c34402..1044d7dcb9 100644 --- a/arm/Microsoft.Authorization/roleDefinitions/deploy.bicep +++ b/arm/Microsoft.Authorization/roleDefinitions/deploy.bicep @@ -38,6 +38,7 @@ param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { @@ -58,6 +59,7 @@ module roleDefinition_mg 'managementGroup/deploy.bicep' = if (empty(subscription notActions: !empty(notActions) ? notActions : [] assignableScopes: !empty(assignableScopes) ? assignableScopes : [] managementGroupId: managementGroupId + location: location } } @@ -73,6 +75,7 @@ module roleDefinition_sub 'subscription/deploy.bicep' = if (!empty(subscriptionI notDataActions: !empty(notDataActions) ? notDataActions : [] assignableScopes: !empty(assignableScopes) ? assignableScopes : [] subscriptionId: subscriptionId + location: location } } diff --git a/arm/Microsoft.Authorization/roleDefinitions/managementGroup/deploy.bicep b/arm/Microsoft.Authorization/roleDefinitions/managementGroup/deploy.bicep index 4d5bb27077..b311e1da3f 100644 --- a/arm/Microsoft.Authorization/roleDefinitions/managementGroup/deploy.bicep +++ b/arm/Microsoft.Authorization/roleDefinitions/managementGroup/deploy.bicep @@ -18,11 +18,15 @@ param managementGroupId string = managementGroup().name @sys.description('Optional. Role definition assignable scopes. If not provided, will use the current scope provided.') param assignableScopes array = [] +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/roleDefinitions/managementGroup/readme.md b/arm/Microsoft.Authorization/roleDefinitions/managementGroup/readme.md index 4f0f28d370..c631402ee8 100644 --- a/arm/Microsoft.Authorization/roleDefinitions/managementGroup/readme.md +++ b/arm/Microsoft.Authorization/roleDefinitions/managementGroup/readme.md @@ -16,6 +16,7 @@ With this module you can create role definitions on a management group level | `assignableScopes` | array | `[]` | | Optional. Role definition assignable scopes. If not provided, will use the current scope provided. | | `description` | string | | | Optional. Description of the custom RBAC role to be created. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `managementGroupId` | string | `[managementGroup().name]` | | Optional. The group ID of the Management Group where the Role Definition and Target Scope will be applied to. If not provided, will use the current scope for deployment. | | `notActions` | array | `[]` | | Optional. List of denied actions. | | `roleName` | string | | | Required. Name of the custom RBAC role to be created. | diff --git a/arm/Microsoft.Authorization/roleDefinitions/resourceGroup/.bicep/nested_cuaId.bicep b/arm/Microsoft.Authorization/roleDefinitions/resourceGroup/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Authorization/roleDefinitions/resourceGroup/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Authorization/roleDefinitions/subscription/deploy.bicep b/arm/Microsoft.Authorization/roleDefinitions/subscription/deploy.bicep index be9d4812b2..d4ee8ae956 100644 --- a/arm/Microsoft.Authorization/roleDefinitions/subscription/deploy.bicep +++ b/arm/Microsoft.Authorization/roleDefinitions/subscription/deploy.bicep @@ -24,11 +24,15 @@ param subscriptionId string = subscription().subscriptionId @sys.description('Optional. Role definition assignable scopes. If not provided, will use the current scope provided.') param assignableScopes array = [] +@sys.description('Optional. Location for all resources.') +param location string = deployment().location + @sys.description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Authorization/roleDefinitions/subscription/readme.md b/arm/Microsoft.Authorization/roleDefinitions/subscription/readme.md index cbd393a57d..7ba5758b26 100644 --- a/arm/Microsoft.Authorization/roleDefinitions/subscription/readme.md +++ b/arm/Microsoft.Authorization/roleDefinitions/subscription/readme.md @@ -17,6 +17,7 @@ With this module you can create role definitions on a subscription level | `dataActions` | array | `[]` | | Optional. List of allowed data actions. This is not supported if the assignableScopes contains Management Group Scopes | | `description` | string | | | Optional. Description of the custom RBAC role to be created. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `notActions` | array | `[]` | | Optional. List of denied actions. | | `notDataActions` | array | `[]` | | Optional. List of denied data actions. This is not supported if the assignableScopes contains Management Group Scopes | | `roleName` | string | | | Required. Name of the custom RBAC role to be created. | diff --git a/arm/Microsoft.ContainerRegistry/registries/replications/.bicep/nested_cuaId.bicep b/arm/Microsoft.ContainerRegistry/registries/replications/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.ContainerRegistry/registries/replications/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.EventGrid/systemTopics/.bicep/nested_cuaId.bicep b/arm/Microsoft.EventGrid/systemTopics/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.EventGrid/systemTopics/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Insights/diagnosticSettings/deploy.bicep b/arm/Microsoft.Insights/diagnosticSettings/deploy.bicep index 67b1bd705b..a04b95df8c 100644 --- a/arm/Microsoft.Insights/diagnosticSettings/deploy.bicep +++ b/arm/Microsoft.Insights/diagnosticSettings/deploy.bicep @@ -47,6 +47,9 @@ param logsToEnable array = [ @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true +@description('Optional. Location for all resources.') +param location string = deployment().location + var diagnosticsLogs = [for log in logsToEnable: { category: log enabled: true @@ -58,6 +61,7 @@ var diagnosticsLogs = [for log in logsToEnable: { resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Insights/diagnosticSettings/readme.md b/arm/Microsoft.Insights/diagnosticSettings/readme.md index 0d31f3d458..f42535632b 100644 --- a/arm/Microsoft.Insights/diagnosticSettings/readme.md +++ b/arm/Microsoft.Insights/diagnosticSettings/readme.md @@ -18,6 +18,7 @@ This module deploys a subscription wide export of the activity log. | `diagnosticStorageAccountId` | string | | | Optional. Resource ID of the diagnostic storage account. | | `diagnosticWorkspaceId` | string | | | Optional. Resource ID of the diagnostic log analytics workspace. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `logsToEnable` | array | `[Administrative, Security, ServiceHealth, Alert, Recommendation, Policy, Autoscale, ResourceHealth]` | `[Administrative, Security, ServiceHealth, Alert, Recommendation, Policy, Autoscale, ResourceHealth]` | Optional. The name of logs that will be streamed. | | `name` | string | `[format('{0}-ActivityLog', uniqueString(subscription().id))]` | | Optional. Name of the ActivityLog diagnostic settings. | diff --git a/arm/Microsoft.ManagedServices/registrationDefinitions/deploy.bicep b/arm/Microsoft.ManagedServices/registrationDefinitions/deploy.bicep index 3073a8c38f..a897e60da0 100644 --- a/arm/Microsoft.ManagedServices/registrationDefinitions/deploy.bicep +++ b/arm/Microsoft.ManagedServices/registrationDefinitions/deploy.bicep @@ -15,6 +15,9 @@ param authorizations array @description('Optional. Specify the name of the Resource Group to delegate access to. If not provided, delegation will be done on the targeted subscription.') param resourceGroupName string = '' +@description('Optional. Location for all resources.') +param location string = deployment().location + @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true @@ -22,6 +25,7 @@ var registrationId = empty(resourceGroupName) ? guid(managedByTenantId, subscrip resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.ManagedServices/registrationDefinitions/readme.md b/arm/Microsoft.ManagedServices/registrationDefinitions/readme.md index d9a18ec165..59c25b4dc2 100644 --- a/arm/Microsoft.ManagedServices/registrationDefinitions/readme.md +++ b/arm/Microsoft.ManagedServices/registrationDefinitions/readme.md @@ -19,6 +19,7 @@ remote/managing tenant. | :-- | :-- | :-- | :-- | :-- | | `authorizations` | array | | | Required. Specify an array of objects, containing object of Azure Active Directory principalId, a Azure roleDefinitionId, and an optional principalIdDisplayName. The roleDefinition specified is granted to the principalId in the provider's Active Directory and the principalIdDisplayName is visible to customers. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `managedByTenantId` | string | | | Required. Specify the tenant ID of the tenant which homes the principals you are delegating permissions to. | | `name` | string | | | Required. Specify a unique name for your offer/registration. i.e ' - - ' | | `registrationDescription` | string | | | Required. Description of the offer/registration. i.e. 'Managed by ' | diff --git a/arm/Microsoft.Management/managementGroups/deploy.bicep b/arm/Microsoft.Management/managementGroups/deploy.bicep index 3780447a5d..4c7952e0ca 100644 --- a/arm/Microsoft.Management/managementGroups/deploy.bicep +++ b/arm/Microsoft.Management/managementGroups/deploy.bicep @@ -12,11 +12,15 @@ param parentId string = '' @description('Optional. Array of role assignment objects to define RBAC on this resource.') param roleAssignments array = [] +@description('Optional. Location for all resources.') +param location string = deployment().location + @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Management/managementGroups/readme.md b/arm/Microsoft.Management/managementGroups/readme.md index 1546176641..78c304bce3 100644 --- a/arm/Microsoft.Management/managementGroups/readme.md +++ b/arm/Microsoft.Management/managementGroups/readme.md @@ -20,6 +20,7 @@ This module has some known **limitations**: | :-- | :-- | :-- | :-- | :-- | | `displayName` | string | | | Optional. The friendly name of the management group. If no value is passed then this field will be set to the group ID. | | `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `name` | string | | | Required. The group ID of the Management group | | `parentId` | string | | | Optional. The management group parent ID. Defaults to current scope. | | `roleAssignments` | array | `[]` | | Optional. Array of role assignment objects to define RBAC on this resource. | diff --git a/arm/Microsoft.Network/privateDnsZones/A/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/A/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/A/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/privateDnsZones/AAAA/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/AAAA/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/AAAA/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/privateDnsZones/CNAME/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/CNAME/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/CNAME/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/privateDnsZones/MX/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/MX/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/MX/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/privateDnsZones/PTR/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/PTR/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/PTR/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/privateDnsZones/SOA/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/SOA/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/SOA/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/privateDnsZones/SRV/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/SRV/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/SRV/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/privateDnsZones/TXT/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/privateDnsZones/TXT/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/privateDnsZones/TXT/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/vpnGateways/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/vpnGateways/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/vpnGateways/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/vpnGateways/connections/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/vpnGateways/connections/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/vpnGateways/connections/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/vpnGateways/natRules/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/vpnGateways/natRules/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/vpnGateways/natRules/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Network/vpnSites/.bicep/nested_cuaId.bicep b/arm/Microsoft.Network/vpnSites/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Network/vpnSites/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Resources/resourceGroups/deploy.bicep b/arm/Microsoft.Resources/resourceGroups/deploy.bicep index f0b9ae6704..b475ba3b1c 100644 --- a/arm/Microsoft.Resources/resourceGroups/deploy.bicep +++ b/arm/Microsoft.Resources/resourceGroups/deploy.bicep @@ -25,6 +25,7 @@ param enableDefaultTelemetry bool = true resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location properties: { mode: 'Incremental' template: { diff --git a/arm/Microsoft.Resources/tags/deploy.bicep b/arm/Microsoft.Resources/tags/deploy.bicep index 4b3d6b791a..7e17989918 100644 --- a/arm/Microsoft.Resources/tags/deploy.bicep +++ b/arm/Microsoft.Resources/tags/deploy.bicep @@ -12,11 +12,31 @@ param resourceGroupName string = '' @description('Optional. Subscription ID of the subscription to assign the tags to. If no Resource Group name is provided, the module deploys at subscription level, therefore assigns the provided tags to the subscription.') param subscriptionId string = subscription().id +@description('Optional. Location for all resources.') +param location string = deployment().location + +@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') +param enableDefaultTelemetry bool = true + +resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { + name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + } + } +} + module tags_sub 'subscriptions/deploy.bicep' = if (!empty(subscriptionId) && empty(resourceGroupName)) { name: '${deployment().name}-Tags-Sub' params: { onlyUpdate: onlyUpdate tags: tags + location: location } } diff --git a/arm/Microsoft.Resources/tags/readme.md b/arm/Microsoft.Resources/tags/readme.md index c93ce02f7f..60cfde19da 100644 --- a/arm/Microsoft.Resources/tags/readme.md +++ b/arm/Microsoft.Resources/tags/readme.md @@ -12,6 +12,8 @@ This module deploys Resources Tags on a subscription or resource group scope. | Parameter Name | Type | Default Value | Possible Values | Description | | :-- | :-- | :-- | :-- | :-- | +| `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `onlyUpdate` | bool | `False` | | Optional. Instead of overwriting the existing tags, combine them with the new tags | | `resourceGroupName` | string | | | Optional. Name of the Resource Group to assign the tags to. If no Resource Group name is provided, and Subscription ID is provided, the module deploys at subscription level, therefore assigns the provided tags to the subscription. | | `subscriptionId` | string | `[subscription().id]` | | Optional. Subscription ID of the subscription to assign the tags to. If no Resource Group name is provided, the module deploys at subscription level, therefore assigns the provided tags to the subscription. | diff --git a/arm/Microsoft.Resources/tags/resourceGroups/deploy.bicep b/arm/Microsoft.Resources/tags/resourceGroups/deploy.bicep index 3c06c2b2a5..81993a0cde 100644 --- a/arm/Microsoft.Resources/tags/resourceGroups/deploy.bicep +++ b/arm/Microsoft.Resources/tags/resourceGroups/deploy.bicep @@ -7,6 +7,21 @@ param name string = 'default' @description('Optional. Instead of overwriting the existing tags, combine them with the new tags') param onlyUpdate bool = false +@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') +param enableDefaultTelemetry bool = true + +resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { + name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + } + } +} + module readTags '.bicep/readTags.bicep' = if (onlyUpdate) { name: '${deployment().name}-ReadTags' } diff --git a/arm/Microsoft.Resources/tags/resourceGroups/readme.md b/arm/Microsoft.Resources/tags/resourceGroups/readme.md index 9dc9742cee..bc8238727f 100644 --- a/arm/Microsoft.Resources/tags/resourceGroups/readme.md +++ b/arm/Microsoft.Resources/tags/resourceGroups/readme.md @@ -12,6 +12,7 @@ This module deploys Resources Tags on a resource group scope. | Parameter Name | Type | Default Value | Possible Values | Description | | :-- | :-- | :-- | :-- | :-- | +| `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | | `name` | string | `default` | | Optional. The name of the tags resource. | | `onlyUpdate` | bool | `False` | | Optional. Instead of overwriting the existing tags, combine them with the new tags | | `tags` | object | `{object}` | | Optional. Tags for the resource group. If not provided, removes existing tags | diff --git a/arm/Microsoft.Resources/tags/subscriptions/deploy.bicep b/arm/Microsoft.Resources/tags/subscriptions/deploy.bicep index 37f4759a8e..7c45459dd3 100644 --- a/arm/Microsoft.Resources/tags/subscriptions/deploy.bicep +++ b/arm/Microsoft.Resources/tags/subscriptions/deploy.bicep @@ -9,6 +9,25 @@ param name string = 'default' @description('Optional. Instead of overwriting the existing tags, combine them with the new tags') param onlyUpdate bool = false +@description('Optional. Location for all resources.') +param location string = deployment().location + +@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') +param enableDefaultTelemetry bool = true + +resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { + name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + location: location + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + } + } +} + module readTags '.bicep/readTags.bicep' = if (onlyUpdate) { name: '${deployment().name}-ReadTags' } diff --git a/arm/Microsoft.Resources/tags/subscriptions/readme.md b/arm/Microsoft.Resources/tags/subscriptions/readme.md index 596f28dece..3a2131a852 100644 --- a/arm/Microsoft.Resources/tags/subscriptions/readme.md +++ b/arm/Microsoft.Resources/tags/subscriptions/readme.md @@ -12,6 +12,8 @@ This module deploys Resources Tags on a subscription scope. | Parameter Name | Type | Default Value | Possible Values | Description | | :-- | :-- | :-- | :-- | :-- | +| `enableDefaultTelemetry` | bool | `True` | | Optional. Enable telemetry via the Customer Usage Attribution ID (GUID). | +| `location` | string | `[deployment().location]` | | Optional. Location for all resources. | | `name` | string | `default` | | Optional. The name of the tags resource. | | `onlyUpdate` | bool | `False` | | Optional. Instead of overwriting the existing tags, combine them with the new tags | | `tags` | object | `{object}` | | Optional. Tags for the resource group. If not provided, removes existing tags | diff --git a/arm/Microsoft.Web/staticSites/.bicep/nested_cuaId.bicep b/arm/Microsoft.Web/staticSites/.bicep/nested_cuaId.bicep deleted file mode 100644 index 8b13789179..0000000000 --- a/arm/Microsoft.Web/staticSites/.bicep/nested_cuaId.bicep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/arm/Microsoft.Web/staticSites/deploy.bicep b/arm/Microsoft.Web/staticSites/deploy.bicep index 03ff5d5251..3c4efe5f2d 100644 --- a/arm/Microsoft.Web/staticSites/deploy.bicep +++ b/arm/Microsoft.Web/staticSites/deploy.bicep @@ -71,8 +71,8 @@ param privateEndpoints array = [] @description('Optional. Tags of the resource.') param tags object = {} -@description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered.') -param cuaId string = '' +@description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') +param enableDefaultTelemetry bool = true @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 = [] @@ -84,9 +84,16 @@ var identity = identityType != 'None' ? { userAssignedIdentities: !empty(userAssignedIdentities) ? userAssignedIdentities : null } : null -module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) { - name: 'pid-${cuaId}' - params: {} +resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { + name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + } + } } resource staticSite 'Microsoft.Web/staticSites@2021-03-01' = {