Get a token for my Azure Kubernetes

Benjamin Balanger 20 Reputation points
2023-12-04T04:30:59.2066667+00:00

Hello,

I have an AKS deployed, and I want to access it (to get the list of pods for example) without using kubectl/kubelogin nor the Azure CLI.

I want to do it directly with curl on the Azure API and the kubernetes API, but I don't find the way to do it.

I'm pretty sure that kubelogin is doing some kind of request against the Kubernetes API using the credential that I get from User credential, but I don't find how to replicate it with curl.

Any help on this issue would be really appreciated.

Thank you,

Benjamin

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,433 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Benjamin Balanger 20 Reputation points
    2023-12-05T04:33:39.11+00:00

    I found a solution by using https://login.windows.net/tenant_id/oauth2/v2.0/token with

    grant_type:client_credentials
    client_id:<APP_ID>
    client_secret:<SECRET>
    scope:6dae42f8-4368-4678-94ff-3960e28e3630/.default
    
    

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.