Azure Kubernetes Cluster with public API may remain open to unauthorized access.
Once a cluster has been created, the private cluster settings cannot be changed. To create a private cluster, follow the steps below.
In Azure Console -
In Terraform -
References:
https://learn.microsoft.com/en-us/azure/aks/private-clusters
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster