Hi Nolan Le,
In continuation to above, I have tried working in my tenant its working for me as I can able to create aks cluster within existing vnet and subnet and please follow given below steps to resolve the issue -
Ensure your Service Principal have Contributor permission.
Please try to execute below command in Azure Cloud Shell.
az aks create --resource-group <your resource group name> --name <name of your aks cluster> --node-count <node count> --generate-ssh-keys --service-principal <application(client)ID> --client-secret <client secret> --network-plugin azure --vnet-subnet-id <your subnet ID> --service-cidr <service cidr> --dns-service-ip <your dns service ip>
Make sure that service cidr should not overlap with subnet cidr and dns-service-ip is an IP from the range specified in service cidr. https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/create-upgrade-delete/error-code-servicecidroverlapexistingsubnetscidr
To find out Subnet ID:
If you encounter any issue during the execution of above command like "Azure subscription is not registered to use the 'Microsoft.ContainerService' namespace" try to execute below command:
az provider register --namespace Microsoft.ContainerService
and wait for some time till the registration is completed, you can check by using below command:
az provider show --namespace Microsoft.ContainerService --query registrationState
If the information is helpful, please click on "Accept Answer" and "Upvote"
If you have any queries, please do let us know, we will help you.