From 6a6fa909980c37c54e999f5c19d2ff0bbac365ea Mon Sep 17 00:00:00 2001 From: AlexanderSehr Date: Fri, 20 Oct 2023 08:23:48 +0200 Subject: [PATCH] Updated managed service --- modules/container-service/managed-cluster/main.bicep | 6 ++++-- modules/container-service/managed-cluster/main.json | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/container-service/managed-cluster/main.bicep b/modules/container-service/managed-cluster/main.bicep index 27201c8fb2..d4f3a4192b 100644 --- a/modules/container-service/managed-cluster/main.bicep +++ b/modules/container-service/managed-cluster/main.bicep @@ -465,7 +465,9 @@ resource managedCluster 'Microsoft.ContainerService/managedClusters@2023-07-02-p ingressProfile: { webAppRouting: { enabled: webApplicationRoutingEnabled - dnsZoneResourceId: !empty(dnsZoneResourceId) ? any(dnsZoneResourceId) : null + dnsZoneResourceIds: [ + !empty(dnsZoneResourceId) ? any(dnsZoneResourceId) : null + ] } } addonProfiles: { @@ -696,7 +698,7 @@ module managedCluster_roleAssignments '.bicep/nested_roleAssignments.bicep' = [f }] resource dnsZone 'Microsoft.Network/dnsZones@2018-05-01' existing = if (dnsZoneResourceId != null && webApplicationRoutingEnabled) { - name: last(split(dnsZoneResourceId, '/'))! + name: last(split((!empty(dnsZoneResourceId) ? dnsZoneResourceId : 'dummmyZone'), '/'))! } resource dnsZone_roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (enableDnsZoneContributorRoleAssignment == true && dnsZoneResourceId != null && webApplicationRoutingEnabled) { diff --git a/modules/container-service/managed-cluster/main.json b/modules/container-service/managed-cluster/main.json index 10118514e6..77d03fb85f 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": "10441788183325724370" + "templateHash": "13409538219229947959" }, "name": "Azure Kubernetes Service (AKS) Managed Clusters", "description": "This module deploys an Azure Kubernetes Service (AKS) Managed Cluster.", @@ -897,7 +897,9 @@ "ingressProfile": { "webAppRouting": { "enabled": "[parameters('webApplicationRoutingEnabled')]", - "dnsZoneResourceId": "[if(not(empty(parameters('dnsZoneResourceId'))), parameters('dnsZoneResourceId'), null())]" + "dnsZoneResourceIds": [ + "[if(not(empty(parameters('dnsZoneResourceId'))), parameters('dnsZoneResourceId'), null())]" + ] } }, "addonProfiles": { @@ -1050,13 +1052,13 @@ "existing": true, "type": "Microsoft.Network/dnsZones", "apiVersion": "2018-05-01", - "name": "[last(split(parameters('dnsZoneResourceId'), '/'))]" + "name": "[last(split(if(not(empty(parameters('dnsZoneResourceId'))), parameters('dnsZoneResourceId'), 'dummmyZone'), '/'))]" }, "dnsZone_roleAssignment": { "condition": "[and(and(equals(parameters('enableDnsZoneContributorRoleAssignment'), true()), not(equals(parameters('dnsZoneResourceId'), null()))), parameters('webApplicationRoutingEnabled'))]", "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "2022-04-01", - "scope": "[format('Microsoft.Network/dnsZones/{0}', last(split(parameters('dnsZoneResourceId'), '/')))]", + "scope": "[format('Microsoft.Network/dnsZones/{0}', last(split(if(not(empty(parameters('dnsZoneResourceId'))), parameters('dnsZoneResourceId'), 'dummmyZone'), '/')))]", "name": "[guid(parameters('dnsZoneResourceId'), subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'befefa01-2a29-4197-83a8-272ff33ce314'), 'DNS Zone Contributor')]", "properties": { "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'befefa01-2a29-4197-83a8-272ff33ce314')]",