From c928bad30dd7978d680c7bb08e450ceb3388bca2 Mon Sep 17 00:00:00 2001 From: rajeshkaremane Date: Tue, 28 Nov 2023 19:12:58 +0000 Subject: [PATCH 1/6] Upgrade to latest version 2023-05-01 --- modules/app/managed-environment/README.md | 29 ++++++++----------- modules/app/managed-environment/main.bicep | 15 ++++------ modules/app/managed-environment/main.json | 19 +++++++----- .../tests/e2e/max/main.test.bicep | 16 +++++++++- .../tests/e2e/waf-aligned/main.test.bicep | 15 +++++++++- 5 files changed, 58 insertions(+), 36 deletions(-) diff --git a/modules/app/managed-environment/README.md b/modules/app/managed-environment/README.md index d044d9f6fa..6174f9141e 100644 --- a/modules/app/managed-environment/README.md +++ b/modules/app/managed-environment/README.md @@ -108,7 +108,8 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { } platformReservedCidr: '172.17.17.0/24' platformReservedDnsIP: '172.17.17.17' - skuName: 'Consumption' + infrastructureResourceGroupName: '' + workloadProfiles: '' tags: { Env: 'test' 'hidden-title': 'This is visible in the resource name' @@ -164,8 +165,8 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { "platformReservedDnsIP": { "value": "172.17.17.17" }, - "skuName": { - "value": "Consumption" + "infrastructureResourceGroupName": { + "value": "" }, "tags": { "value": { @@ -208,7 +209,8 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { } platformReservedCidr: '172.17.17.0/24' platformReservedDnsIP: '172.17.17.17' - skuName: 'Consumption' + infrastructureResourceGroupName: '' + workloadProfiles: '' tags: { Env: 'test' 'hidden-title': 'This is visible in the resource name' @@ -264,8 +266,8 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { "platformReservedDnsIP": { "value": "172.17.17.17" }, - "skuName": { - "value": "Consumption" + "infrastructureResourceGroupName": { + "value": "" }, "tags": { "value": { @@ -314,7 +316,7 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { | [`platformReservedCidr`](#parameter-platformreservedcidr) | string | IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. It must not overlap with any other provided IP ranges and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. | | [`platformReservedDnsIP`](#parameter-platformreserveddnsip) | string | An IP address from the IP range defined by "platformReservedCidr" that will be reserved for the internal DNS server. It must not be the first address in the range and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. | | [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. | -| [`skuName`](#parameter-skuname) | string | Managed environment SKU. | +| [`infrastructureResourceGroupName`](#parameter-infrastructureResourceGroupName) | string | Custom Resource group name for infrastrcuture components. | | [`tags`](#parameter-tags) | object | Tags of the resource. | | [`workloadProfiles`](#parameter-workloadprofiles) | array | Workload profiles configured for the Managed Environment. | | [`zoneRedundant`](#parameter-zoneredundant) | bool | Whether or not this Managed Environment is zone-redundant. | @@ -561,20 +563,13 @@ The principal type of the assigned principal ID. ] ``` -### Parameter: `skuName` +### Parameter: `infrastructureResourceGroupName` -Managed environment SKU. +Customer Resource Group name for additional infrastructure components. - Required: No - Type: string -- Default: `'Consumption'` -- Allowed: - ```Bicep - [ - 'Consumption' - 'Premium' - ] - ``` +- Default: `'ME_ManagedEnvironmentName'` ### Parameter: `tags` diff --git a/modules/app/managed-environment/main.bicep b/modules/app/managed-environment/main.bicep index f3905ce986..a328e36afb 100644 --- a/modules/app/managed-environment/main.bicep +++ b/modules/app/managed-environment/main.bicep @@ -17,12 +17,6 @@ param tags object? @description('Optional. Array of role assignments to create.') param roleAssignments roleAssignmentType -@allowed([ - 'Consumption' - 'Premium' -]) -@description('Optional. Managed environment SKU.') -param skuName string = 'Consumption' @description('Optional. Logs destination.') param logsDestination string = 'log-analytics' @@ -73,6 +67,9 @@ param lock lockType @description('Optional. Workload profiles configured for the Managed Environment.') param workloadProfiles array = [] +@description('Optional. Name of the infrastructure resource group. If not provided, it will be set with a default value.') +param infrastructureResourceGroupName string = take('ME_${name}', 63) + var builtInRoleNames = { Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c') Owner: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635') @@ -98,13 +95,10 @@ resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06 scope: resourceGroup(split(logAnalyticsWorkspaceResourceId, '/')[2], split(logAnalyticsWorkspaceResourceId, '/')[4]) } -resource managedEnvironment 'Microsoft.App/managedEnvironments@2022-10-01' = { +resource managedEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' = { name: name location: location tags: tags - sku: { - name: skuName - } properties: { appLogsConfiguration: { destination: logsDestination @@ -129,6 +123,7 @@ resource managedEnvironment 'Microsoft.App/managedEnvironments@2022-10-01' = { } workloadProfiles: !empty(workloadProfiles) ? workloadProfiles : null zoneRedundant: zoneRedundant + infrastructureResourceGroup: infrastructureResourceGroupName } } diff --git a/modules/app/managed-environment/main.json b/modules/app/managed-environment/main.json index ba37943c32..de0f5c57cc 100644 --- a/modules/app/managed-environment/main.json +++ b/modules/app/managed-environment/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.23.1.45101", - "templateHash": "15830956831455159038" + "templateHash": "2542503992713932852" }, "name": "App ManagedEnvironments", "description": "This module deploys an App Managed Environment (also known as a Container App Environment).", @@ -251,6 +251,13 @@ "metadata": { "description": "Optional. Workload profiles configured for the Managed Environment." } + }, + "infrastructureResourceGroupName": { + "type": "string", + "defaultValue": "[take(format('ME_{0}', parameters('name')), 63)]", + "metadata": { + "description": "Optional. Name of the infrastructure resource group. If not provided, it will be set with a default value." + } } }, "variables": { @@ -288,13 +295,10 @@ }, "managedEnvironment": { "type": "Microsoft.App/managedEnvironments", - "apiVersion": "2022-10-01", + "apiVersion": "2023-05-01", "name": "[parameters('name')]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", - "sku": { - "name": "[parameters('skuName')]" - }, "properties": { "appLogsConfiguration": { "destination": "[parameters('logsDestination')]", @@ -318,7 +322,8 @@ "platformReservedDnsIP": "[if(and(not(empty(parameters('infrastructureSubnetId'))), equals(parameters('internal'), true())), parameters('platformReservedDnsIP'), null())]" }, "workloadProfiles": "[if(not(empty(parameters('workloadProfiles'))), parameters('workloadProfiles'), null())]", - "zoneRedundant": "[parameters('zoneRedundant')]" + "zoneRedundant": "[parameters('zoneRedundant')]", + "infrastructureResourceGroup": "[parameters('infrastructureResourceGroupName')]" }, "dependsOn": [ "logAnalyticsWorkspace" @@ -374,7 +379,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference('managedEnvironment', '2022-10-01', 'full').location]" + "value": "[reference('managedEnvironment', '2023-05-01', 'full').location]" }, "name": { "type": "string", diff --git a/modules/app/managed-environment/tests/e2e/max/main.test.bicep b/modules/app/managed-environment/tests/e2e/max/main.test.bicep index 7eecb1c599..a6c350e742 100644 --- a/modules/app/managed-environment/tests/e2e/max/main.test.bicep +++ b/modules/app/managed-environment/tests/e2e/max/main.test.bicep @@ -10,6 +10,9 @@ metadata description = 'This instance deploys the module with most of its featur @maxLength(90) param resourceGroupName string = 'dep-${namePrefix}-app.managedenvironments-${serviceShort}-rg' +@description('Optional. The name of the infrastructre resource group to deploy for testing purposes.') +param infrastructureResourceGroupName string = 'me-dep-${namePrefix}-app.managedenvironments-${serviceShort}-rg' + @description('Optional. The location to deploy resources to.') param location string = deployment().location @@ -22,6 +25,16 @@ param enableDefaultTelemetry bool = true @description('Optional. A token to inject into the name of each resource.') param namePrefix string = '[[namePrefix]]' +@description('Optional. WorkloadProfile') +param workloadProfiles array = [ + { + workloadProfileType: 'D4' + name: 'CAW01' + minimumCount: 0 + maximumCount: 3 + } + ] + // =========== // // Deployments // // =========== // @@ -55,12 +68,13 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' name: '${namePrefix}${serviceShort}001' logAnalyticsWorkspaceResourceId: nestedDependencies.outputs.logAnalyticsWorkspaceResourceId location: location - skuName: 'Consumption' + workloadProfiles: workloadProfiles internal: true dockerBridgeCidr: '172.16.0.1/28' platformReservedCidr: '172.17.17.0/24' platformReservedDnsIP: '172.17.17.17' infrastructureSubnetId: nestedDependencies.outputs.subnetResourceId + infrastructureResourceGroupName: infrastructureResourceGroupName lock: { kind: 'CanNotDelete' name: 'myCustomLockName' diff --git a/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep b/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep index f7416ce8ed..127dbf8051 100644 --- a/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep +++ b/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep @@ -10,6 +10,9 @@ metadata description = 'This instance deploys the module in alignment with the b @maxLength(90) param resourceGroupName string = 'dep-${namePrefix}-app.managedenvironments-${serviceShort}-rg' +@description('Optional. The name of the infrastructre resource group to deploy for testing purposes.') +param infrastructureResourceGroupName string = 'me-dep-${namePrefix}-app.managedenvironments-${serviceShort}-rg' + @description('Optional. The location to deploy resources to.') param location string = deployment().location @@ -22,6 +25,15 @@ param enableDefaultTelemetry bool = true @description('Optional. A token to inject into the name of each resource.') param namePrefix string = '[[namePrefix]]' +@description('Optional. WorkloadProfile') +param workloadProfiles array = [ + { + workloadProfileType: 'D4' + name: 'CAW01' + minimumCount: 0 + maximumCount: 3 + } + ] // =========== // // Deployments // // =========== // @@ -55,12 +67,13 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' name: '${namePrefix}${serviceShort}001' logAnalyticsWorkspaceResourceId: nestedDependencies.outputs.logAnalyticsWorkspaceResourceId location: location - skuName: 'Consumption' + workloadProfiles: workloadProfiles internal: true dockerBridgeCidr: '172.16.0.1/28' platformReservedCidr: '172.17.17.0/24' platformReservedDnsIP: '172.17.17.17' infrastructureSubnetId: nestedDependencies.outputs.subnetResourceId + infrastructureResourceGroupName: infrastructureResourceGroupName lock: { kind: 'CanNotDelete' name: 'myCustomLockName' From be0eaac578855b841f22ec589d7ef7bf0303dd77 Mon Sep 17 00:00:00 2001 From: rajeshkaremane Date: Tue, 28 Nov 2023 19:16:33 +0000 Subject: [PATCH 2/6] Formatted --- modules/app/managed-environment/README.md | 20 +++++++++---------- modules/app/managed-environment/main.bicep | 1 - .../tests/e2e/max/main.test.bicep | 14 ++++++------- .../tests/e2e/waf-aligned/main.test.bicep | 14 ++++++------- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/modules/app/managed-environment/README.md b/modules/app/managed-environment/README.md index 6174f9141e..5e50f02b2d 100644 --- a/modules/app/managed-environment/README.md +++ b/modules/app/managed-environment/README.md @@ -4,11 +4,11 @@ This module deploys an App Managed Environment (also known as a Container App En ## Navigation -- [Resource Types](#Resource-Types) -- [Usage examples](#Usage-examples) -- [Parameters](#Parameters) -- [Outputs](#Outputs) -- [Cross-referenced modules](#Cross-referenced-modules) +- [Resource Types](#resource-types) +- [Usage examples](#usage-examples) +- [Parameters](#parameters) +- [Outputs](#outputs) +- [Cross-referenced modules](#cross-referenced-modules) ## Resource Types @@ -34,7 +34,6 @@ The following section provides usage examples for the module, which were used to This instance deploys the module with the minimum set of required parameters. -
via Bicep module @@ -84,7 +83,6 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { This instance deploys the module with most of its features enabled. -
via Bicep module @@ -185,7 +183,6 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework. -
via Bicep module @@ -282,7 +279,6 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = {

- ## Parameters **Required parameters** @@ -316,7 +312,7 @@ module managedEnvironment 'br:bicep/modules/app.managed-environment:1.0.0' = { | [`platformReservedCidr`](#parameter-platformreservedcidr) | string | IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. It must not overlap with any other provided IP ranges and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. | | [`platformReservedDnsIP`](#parameter-platformreserveddnsip) | string | An IP address from the IP range defined by "platformReservedCidr" that will be reserved for the internal DNS server. It must not be the first address in the range and can only be used when the environment is deployed into a virtual network. If not provided, it will be set with a default value by the platform. | | [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. | -| [`infrastructureResourceGroupName`](#parameter-infrastructureResourceGroupName) | string | Custom Resource group name for infrastrcuture components. | +| [`infrastructureResourceGroupName`](#parameter-infrastructureresourcegroupname) | string | Custom Resource group name for infrastrcuture components. | | [`tags`](#parameter-tags) | object | Tags of the resource. | | [`workloadProfiles`](#parameter-workloadprofiles) | array | Workload profiles configured for the Managed Environment. | | [`zoneRedundant`](#parameter-zoneredundant) | bool | Whether or not this Managed Environment is zone-redundant. | @@ -435,6 +431,7 @@ Specify the type of lock. - Required: No - Type: string - Allowed: + ```Bicep [ 'CanNotDelete' @@ -526,6 +523,7 @@ Version of the condition. - Required: No - Type: string - Allowed: + ```Bicep [ '2.0' @@ -553,6 +551,7 @@ The principal type of the assigned principal ID. - Required: No - Type: string - Allowed: + ```Bicep [ 'Device' @@ -594,7 +593,6 @@ Whether or not this Managed Environment is zone-redundant. - Type: bool - Default: `False` - ## Outputs | Output | Type | Description | diff --git a/modules/app/managed-environment/main.bicep b/modules/app/managed-environment/main.bicep index a328e36afb..b24dc6f0c2 100644 --- a/modules/app/managed-environment/main.bicep +++ b/modules/app/managed-environment/main.bicep @@ -17,7 +17,6 @@ param tags object? @description('Optional. Array of role assignments to create.') param roleAssignments roleAssignmentType - @description('Optional. Logs destination.') param logsDestination string = 'log-analytics' diff --git a/modules/app/managed-environment/tests/e2e/max/main.test.bicep b/modules/app/managed-environment/tests/e2e/max/main.test.bicep index a6c350e742..1646791a1b 100644 --- a/modules/app/managed-environment/tests/e2e/max/main.test.bicep +++ b/modules/app/managed-environment/tests/e2e/max/main.test.bicep @@ -27,13 +27,13 @@ param namePrefix string = '[[namePrefix]]' @description('Optional. WorkloadProfile') param workloadProfiles array = [ - { - workloadProfileType: 'D4' - name: 'CAW01' - minimumCount: 0 - maximumCount: 3 - } - ] + { + workloadProfileType: 'D4' + name: 'CAW01' + minimumCount: 0 + maximumCount: 3 + } +] // =========== // // Deployments // diff --git a/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep b/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep index 127dbf8051..11807a0ea4 100644 --- a/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep +++ b/modules/app/managed-environment/tests/e2e/waf-aligned/main.test.bicep @@ -27,13 +27,13 @@ param namePrefix string = '[[namePrefix]]' @description('Optional. WorkloadProfile') param workloadProfiles array = [ - { - workloadProfileType: 'D4' - name: 'CAW01' - minimumCount: 0 - maximumCount: 3 - } - ] + { + workloadProfileType: 'D4' + name: 'CAW01' + minimumCount: 0 + maximumCount: 3 + } +] // =========== // // Deployments // // =========== // From 9395c792dfe96c51bde85dbe9410afdae1104a9d Mon Sep 17 00:00:00 2001 From: rajeshkaremane Date: Mon, 4 Dec 2023 09:04:51 +0000 Subject: [PATCH 3/6] assign subnet id if provided --- modules/app/managed-environment/main.bicep | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/app/managed-environment/main.bicep b/modules/app/managed-environment/main.bicep index b24dc6f0c2..5051cb597f 100644 --- a/modules/app/managed-environment/main.bicep +++ b/modules/app/managed-environment/main.bicep @@ -115,10 +115,10 @@ resource managedEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' = { } vnetConfiguration: { internal: internal - infrastructureSubnetId: !empty(infrastructureSubnetId) && internal == true ? infrastructureSubnetId : null - dockerBridgeCidr: !empty(infrastructureSubnetId) && internal == true ? dockerBridgeCidr : null - platformReservedCidr: !empty(infrastructureSubnetId) && internal == true ? platformReservedCidr : null - platformReservedDnsIP: !empty(infrastructureSubnetId) && internal == true ? platformReservedDnsIP : null + infrastructureSubnetId: !empty(infrastructureSubnetId) ? infrastructureSubnetId : null + dockerBridgeCidr: !empty(infrastructureSubnetId) ? dockerBridgeCidr : null + platformReservedCidr: !empty(infrastructureSubnetId) ? platformReservedCidr : null + platformReservedDnsIP: !empty(infrastructureSubnetId) ? platformReservedDnsIP : null } workloadProfiles: !empty(workloadProfiles) ? workloadProfiles : null zoneRedundant: zoneRedundant From 874e3261477b6119d4ae1c5816ceda015217f042 Mon Sep 17 00:00:00 2001 From: rajeshkaremane Date: Mon, 4 Dec 2023 09:13:40 +0000 Subject: [PATCH 4/6] updated arm template and output defaultDomain --- modules/app/managed-environment/main.bicep | 3 +++ modules/app/managed-environment/main.json | 28 ++++++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/modules/app/managed-environment/main.bicep b/modules/app/managed-environment/main.bicep index 5051cb597f..b2546e3f20 100644 --- a/modules/app/managed-environment/main.bicep +++ b/modules/app/managed-environment/main.bicep @@ -161,6 +161,9 @@ output name string = managedEnvironment.name @description('The resource ID of the Managed Environment.') output resourceId string = managedEnvironment.id +@description('The Default domain of the Managed Environment.') +output defaultDomain string = managedEnvironment.properties.defaultDomain + // =============== // // Definitions // // =============== // diff --git a/modules/app/managed-environment/main.json b/modules/app/managed-environment/main.json index de0f5c57cc..e86162e982 100644 --- a/modules/app/managed-environment/main.json +++ b/modules/app/managed-environment/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.23.1.45101", - "templateHash": "2542503992713932852" + "templateHash": "5457009656345678407" }, "name": "App ManagedEnvironments", "description": "This module deploys an App Managed Environment (also known as a Container App Environment).", @@ -138,17 +138,6 @@ "description": "Optional. Array of role assignments to create." } }, - "skuName": { - "type": "string", - "defaultValue": "Consumption", - "allowedValues": [ - "Consumption", - "Premium" - ], - "metadata": { - "description": "Optional. Managed environment SKU." - } - }, "logsDestination": { "type": "string", "defaultValue": "log-analytics", @@ -316,10 +305,10 @@ }, "vnetConfiguration": { "internal": "[parameters('internal')]", - "infrastructureSubnetId": "[if(and(not(empty(parameters('infrastructureSubnetId'))), equals(parameters('internal'), true())), parameters('infrastructureSubnetId'), null())]", - "dockerBridgeCidr": "[if(and(not(empty(parameters('infrastructureSubnetId'))), equals(parameters('internal'), true())), parameters('dockerBridgeCidr'), null())]", - "platformReservedCidr": "[if(and(not(empty(parameters('infrastructureSubnetId'))), equals(parameters('internal'), true())), parameters('platformReservedCidr'), null())]", - "platformReservedDnsIP": "[if(and(not(empty(parameters('infrastructureSubnetId'))), equals(parameters('internal'), true())), parameters('platformReservedDnsIP'), null())]" + "infrastructureSubnetId": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('infrastructureSubnetId'), null())]", + "dockerBridgeCidr": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('dockerBridgeCidr'), null())]", + "platformReservedCidr": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('platformReservedCidr'), null())]", + "platformReservedDnsIP": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('platformReservedDnsIP'), null())]" }, "workloadProfiles": "[if(not(empty(parameters('workloadProfiles'))), parameters('workloadProfiles'), null())]", "zoneRedundant": "[parameters('zoneRedundant')]", @@ -394,6 +383,13 @@ "description": "The resource ID of the Managed Environment." }, "value": "[resourceId('Microsoft.App/managedEnvironments', parameters('name'))]" + }, + "defaultDomain": { + "type": "string", + "metadata": { + "description": "The Default domain of the Managed Environment." + }, + "value": "[reference('managedEnvironment').defaultDomain]" } } } \ No newline at end of file From 27720fa90a89d5d2a8ed2934e6b88ddc47d00d1d Mon Sep 17 00:00:00 2001 From: rajeshkaremane Date: Tue, 5 Dec 2023 12:18:07 +0000 Subject: [PATCH 5/6] Lint fix --- modules/app/managed-environment/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/app/managed-environment/README.md b/modules/app/managed-environment/README.md index 5e50f02b2d..a55dc9c7d5 100644 --- a/modules/app/managed-environment/README.md +++ b/modules/app/managed-environment/README.md @@ -491,7 +491,7 @@ Array of role assignments to create. | :-- | :-- | :-- | | [`condition`](#parameter-roleassignmentscondition) | string | The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container" | | [`conditionVersion`](#parameter-roleassignmentsconditionversion) | string | Version of the condition. | -| [`delegatedManagedIdentityResourceId`](#parameter-roleassignmentsdelegatedmanagedidentityresourceid) | string | The Resource Id of the delegated managed identity resource. | +| [`delegatedManagedIdentityResourceId`](#parameter-roleassignmentsdelegatedmanagedidentityresourceid) | string | The Resource ID of the delegated managed identity resource. | | [`description`](#parameter-roleassignmentsdescription) | string | The description of the role assignment. | | [`principalType`](#parameter-roleassignmentsprincipaltype) | string | The principal type of the assigned principal ID. | @@ -532,7 +532,7 @@ Version of the condition. ### Parameter: `roleAssignments.delegatedManagedIdentityResourceId` -The Resource Id of the delegated managed identity resource. +The Resource ID of the delegated managed identity resource. - Required: No - Type: string From 2464bd81f15b44ea94764b3c5765ac32bad2b15e Mon Sep 17 00:00:00 2001 From: rajeshkaremane Date: Thu, 7 Dec 2023 10:53:49 +0000 Subject: [PATCH 6/6] minor fix for ReservedCidr, ReservedDnsIP and test --- modules/app/managed-environment/main.bicep | 4 ++-- modules/app/managed-environment/main.json | 6 +++--- .../managed-environment/tests/e2e/max/dependencies.bicep | 8 ++++++++ .../tests/e2e/waf-aligned/dependencies.bicep | 8 ++++++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/app/managed-environment/main.bicep b/modules/app/managed-environment/main.bicep index b2546e3f20..93e9920902 100644 --- a/modules/app/managed-environment/main.bicep +++ b/modules/app/managed-environment/main.bicep @@ -117,8 +117,8 @@ resource managedEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' = { internal: internal infrastructureSubnetId: !empty(infrastructureSubnetId) ? infrastructureSubnetId : null dockerBridgeCidr: !empty(infrastructureSubnetId) ? dockerBridgeCidr : null - platformReservedCidr: !empty(infrastructureSubnetId) ? platformReservedCidr : null - platformReservedDnsIP: !empty(infrastructureSubnetId) ? platformReservedDnsIP : null + platformReservedCidr: empty(workloadProfiles) && !empty(infrastructureSubnetId) ? platformReservedCidr : null + platformReservedDnsIP: empty(workloadProfiles) && !empty(infrastructureSubnetId) ? platformReservedDnsIP : null } workloadProfiles: !empty(workloadProfiles) ? workloadProfiles : null zoneRedundant: zoneRedundant diff --git a/modules/app/managed-environment/main.json b/modules/app/managed-environment/main.json index e86162e982..d3860b25fa 100644 --- a/modules/app/managed-environment/main.json +++ b/modules/app/managed-environment/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.23.1.45101", - "templateHash": "5457009656345678407" + "templateHash": "6452494198386670014" }, "name": "App ManagedEnvironments", "description": "This module deploys an App Managed Environment (also known as a Container App Environment).", @@ -307,8 +307,8 @@ "internal": "[parameters('internal')]", "infrastructureSubnetId": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('infrastructureSubnetId'), null())]", "dockerBridgeCidr": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('dockerBridgeCidr'), null())]", - "platformReservedCidr": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('platformReservedCidr'), null())]", - "platformReservedDnsIP": "[if(not(empty(parameters('infrastructureSubnetId'))), parameters('platformReservedDnsIP'), null())]" + "platformReservedCidr": "[if(and(empty(parameters('workloadProfiles')), not(empty(parameters('infrastructureSubnetId')))), parameters('platformReservedCidr'), null())]", + "platformReservedDnsIP": "[if(and(empty(parameters('workloadProfiles')), not(empty(parameters('infrastructureSubnetId')))), parameters('platformReservedDnsIP'), null())]" }, "workloadProfiles": "[if(not(empty(parameters('workloadProfiles'))), parameters('workloadProfiles'), null())]", "zoneRedundant": "[parameters('zoneRedundant')]", diff --git a/modules/app/managed-environment/tests/e2e/max/dependencies.bicep b/modules/app/managed-environment/tests/e2e/max/dependencies.bicep index f61380acc4..8d908b1603 100644 --- a/modules/app/managed-environment/tests/e2e/max/dependencies.bicep +++ b/modules/app/managed-environment/tests/e2e/max/dependencies.bicep @@ -37,6 +37,14 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-04-01' = { name: 'defaultSubnet' properties: { addressPrefix: cidrSubnet(addressPrefix, 16, 0) + delegations: [ + { + name: 'Microsoft.App.environments' + properties: { + serviceName: 'Microsoft.App/environments' + } + } + ] } } ] diff --git a/modules/app/managed-environment/tests/e2e/waf-aligned/dependencies.bicep b/modules/app/managed-environment/tests/e2e/waf-aligned/dependencies.bicep index f61380acc4..8d908b1603 100644 --- a/modules/app/managed-environment/tests/e2e/waf-aligned/dependencies.bicep +++ b/modules/app/managed-environment/tests/e2e/waf-aligned/dependencies.bicep @@ -37,6 +37,14 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-04-01' = { name: 'defaultSubnet' properties: { addressPrefix: cidrSubnet(addressPrefix, 16, 0) + delegations: [ + { + name: 'Microsoft.App.environments' + properties: { + serviceName: 'Microsoft.App/environments' + } + } + ] } } ]