AKS Automatic - Error when using service-principal

Zach Howell 20 Reputation points
2025-08-06T21:36:29.53+00:00

I can create an AKS Automatic service successfully with a command like:

az aks create --name tmpaks --location my-location --resource-group my-resource-group --sku automatic --generate-ssh-keys

However when I try to use a service-principal by adding --service-principal my-principal --client-secret my-secret , I get the following error:
ERROR: --enable-azuremonitormetrics can only be specified for clusters with managed identity enabled
Despite me not setting the --enable-azuremonitormetrics explicitly.

So I have several questions:

  1. (Ultimate goal) How can I create an AKS Automatic cluster with a service-principal of my choosing?
  2. I don't understand Azure & AKS permissioning very well.. does it make sense to use a service principal with AKS?
  3. Can anyone explain why this error message makes any sense? Is this enable-azuremonitormetrics setting enabled by AKS Automatic? Does AKS Automatic use managed identity or no? This might help me find a workaround or answer question #2.
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
{count} votes

Accepted answer
  1. Akram Kathimi 1,751 Reputation points Microsoft Employee
    2025-08-07T09:40:25.4033333+00:00

    Hi @Zach Howell ,

    Thank you for posting your question.

    The automatic AKS SKU will automatically configure monitoring as mentioned here. Therefore, service principal is not allowed.

    Regarding using service principals, I would advise using managed identities instead, they need less maintenance, and do not require renewals (automatic). They are basically wrappers around service principals, and have wider application compatibility. So, unless you have a reason to use service principals, use MI instead :).

    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    Thank you.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.