Unable to create AKS cluster using Azure playground

Hi Team,

In AKS, i have not able to create due to below. plesae help to provide to how to create cluster with steps.

i have followed kodekloud community github link also but same issue.

Error :
{“code”:“InvalidTemplateDeployment”,“details”:[{“code”:“RequestDisallowedByPolicy”,“target”:“kodekloud-demo”,“message”:“Resource ‘kodekloud-demo’ was disallowed by policy. (Code: RequestDisallowedByPolicy)”,“additionalInfo”:[{“type”:“PolicyViolation”,“info”:{“evaluationDetails”:{“evaluatedExpressions”:[{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Compute/virtualMachines”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Compute/sshPublicKeys”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Compute/virtualMachines/extensions”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Compute/virtualMachineScaleSets”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Network/applicationGateways”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Compute/disks”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Storage”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Network/networkInterfaces”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Network/networkSecurityGroups”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Network/publicIPAddresses”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Network/virtualNetworks”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.DocumentDB/databaseAccounts”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Web/serverFarms”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Web/sites”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Sql/servers”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.ManagedIdentity/userAssignedIdentities”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Network/loadBalancers”,“operator”:“Like”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.Network/routeTables”,“operator”:“Like”},{“result”:“True”,“expressionKind”:“Field”,“expression”:“type”,“path”:“type”,“expressionValue”:“Microsoft.ContainerService/managedClusters”,“targetValue”:“Microsoft.ContainerService/managedClusters”,“operator”:“Equals”},{“result”:“False”,“expressionKind”:“Field”,“expression”:“Microsoft.ContainerService/managedClusters/agentPoolProfiles[].maxCount",“path”:"properties.agentPoolProfiles[].maxCount”,“expressionValue”:5,“targetValue”:2,“operator”:“LessOrEquals”}]},“policyDefinitionId”:“/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/providers/Microsoft.Authorization/policyDefinitions/kml_PolicyDefinition_main-0df473332a7848dc”,“policyDefinitionName”:“kml_PolicyDefinition_main-0df473332a7848dc”,“policyDefinitionDisplayName”:“kml_PolicyDefinition_main-0df473332a7848dc”,“policyDefinitionEffect”:“deny”,“policyAssignmentId”:“/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/resourceGroups/kml_rg_main-0df473332a7848dc/providers/Microsoft.Authorization/policyAssignments/kml_Policy_main-0df473332a7848dc”,“policyAssignmentName”:“kml_Policy_main-0df473332a7848dc”,“policyAssignmentScope”:“/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/resourceGroups/kml_rg_main-0df473332a7848dc”,“policyAssignmentParameters”:{},“policyExemptionIds”:[]}}],“policyDetails”:[{“isInitiative”:false,“assignmentId”:“/subscriptions/a2b28c85-1948-4263-90ca-bade2bac4df4/resourceGroups/kml_rg_main-0df473332a7848dc/providers/Microsoft.Authorization/policyAssignments/kml_Policy_main-0df473332a7848dc”,“assignmentName”:“kml_Policy_main-0df473332a7848dc”,“nonComplianceMessage”:null,“viewDetailsUri”:“Microsoft Azure template deployment failed because of policy violation. Please see details for more information.”}

Please don’t post the same questions in multiple places. I have answered you already. Follow the guide exactly.

Hi @al1,

Sorry for duplicate post. But I have already tried your GitHub link. Earlier I tried with this GitHub link in that time it is working fine. Now it is not working.

Along with error message I have already posted your github link.

Could you please reverify the aks along with GitHub link once and let me know. I think policies has changed.

I checked it yesterday. Nothing has changed. You need to set the number of nodes in the pool to 2 - you had 5.

{“result”:“False”,“expressionKind”:“Field”,“expression”:“Microsoft.ContainerService/managedClusters/agentPoolProfiles[].maxCount",“path”:"properties.agentPoolProfiles[].maxCount”,“expressionValue”:5,“targetValue”:2,“operator”:“LessOrEquals”}]},“

You are not following the guide exactly. If you do follow the guide it works.

Thank you so much @al1 , i have rectify my mistake. Now i can create AKS cluster.
Possible to do one more help. AKS complete guide if you have Please share with me.
If you done this help it is helpful for my carrier growth.

There is a KodeKloud course for AKS here:
Azure Kubernetes Service Course | KodeKloud

Thank you so much @al1 , For your kind help