Bicep AKS deployment

Niren Adhikary (NAD) 146 Reputation points
2022-06-30T06:49:58.547+00:00

Hello,

I am trying to deploy private AKS using bicep template. I am getting error

InvalidTemplateDeployment - The template deployment 'main' is not valid according to the validation procedure. The tracking id is '5f5fb3a2-0356-43b6-a955-d4b01d65c13easd'. See inner errors for details.
InvalidParameter - Provisioning of resource(s) for container service aksPrivateClustertest in resource group test failed. Message: Category: ClientError; Code: InvalidParameter; SubCode: ; Message: The value of parameter agentPoolProfile.vnetSubnetID is invalid. Please see https://aka.ms/aks-naming-rules for more details.; InnerMessage: ; Dependency: ; OrginalError: %!s(<nil>); AKSTeam: . Details:

Here is the bicep template I am trying to deploy.

param general object = {
location: resourceGroup().location
tags: {
LastUpdate: utcNow()
}
}
@description('Properties of the cluster.')
param aksPrivateCluster object = {}

resource rsrc_aks_private_cluster 'Microsoft.ContainerService/managedClusters@2022-04-02-preview' = {
name: aksPrivateCluster.name
location: general.location
tags: general.tags
sku: {
name: 'Basic'
tier: 'Paid'
}
identity: {
type: 'SystemAssigned'
}
properties: {
kubernetesVersion: '1.22.6'
dnsPrefix: '${aksPrivateCluster.name}-dns'
agentPoolProfiles: [
{
name: 'agentpool'
count: 7
vmSize: 'Standard_D4s_v3'
osDiskSizeGB: 128
osDiskType: 'Managed'
kubeletDiskType: 'OS'
vnetSubnetID: 'clustervirtualNetwork.properties.subnets[0].id'
maxPods: 110
type: 'VirtualMachineScaleSets'
availabilityZones: [
'1'
'2'
'3'
]
maxCount: 10
minCount: 7
enableAutoScaling: true
powerState: {
code: 'Running'
}
orchestratorVersion: '1.22.6'
currentOrchestratorVersion: '1.22.6'
enableNodePublicIP: false
enableCustomCATrust: false

    mode: 'System'  
    osType: 'Linux'  
    osSKU: 'Ubuntu'  
    enableFIPS: false  
  }  
]  
  
servicePrincipalProfile: {  
  clientId: 'msi'  
}  
addonProfiles: {  
  azureKeyvaultSecretsProvider: {  
    enabled: false  
  }  
  azurepolicy: {  
    enabled: false  
  }  
  httpApplicationRouting: {  
    enabled: false  
  }  
  omsAgent: {  
    enabled: true  
   // config: {  
   // logAnalyticsWorkspaceResourceID: la_name_resource.id  
  //  }  
  }  
}  

}
}

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,000 questions
{count} votes