This is me having a chat with my friendly neighborhood Co-Pilot.
Copilot said:
Here’s the scoop, Deborah — and you’re definitely not the only one confused.
✅ Short Summary (What’s Going On)
Device code flow for AKS is not disabled, but the old “kubectl triggers device code login automatically” behavior has been removed because:
- The legacy Azure auth provider in kubectl was fully deprecated and removed (Kubernetes 1.26+).
- AKS now requires the newer kubelogin exec plugin, which does not trigger device-code flow automatically unless the kubeconfig is converted properly.
- kubelogin ≥ v0.2.0 changed behavior, requiring an
az loginfirst in most cases.
You’re seeing exactly what others have hit when their kubelogin / kubeconfig wasn’t updated.
✅ Evidence from official sources
1. kubelogin ≥ v0.2.0 requires convert‑kubeconfig
Users reported that device code login seemed “gone” until they ran the required conversion step.
2. kubectl’s old built‑in Azure auth plugin only supported device code flow and is now removed
3. Device code is still supported — it’s just the default mode after convert‑kubeconfig
🧩 Why you need az login now
With new kubelogin:
kubectlno longer initiates device code auth directly.- The recommended auth flow is:
That convert-kubeconfig step rewrites your kubeconfig to use the exec plugin, which then uses the Azure CLI credential flow by default — hence the need for an az login.
This design is intentional and aligns AKS with standard client-go exec plugins.
🧩 Can you still use Device Code? Yes — here’s how
You can explicitly convert your kubeconfig to device code mode:
Then your kubectl command will again trigger a device-code challenge:
Device code mode is still supported, just not auto‑magically triggered without the conversion step.
🚨 Important Gotchas
- kubelogin device code mode fails if your tenant has Conditional Access — use web‑interactive instead.
- The jump from kubelogin 0.1.9 → 0.2.x changed behavior and broke some setups until kubeconfig conversion was done.
📝 So in plain terms…
You’re correct:
- Previously: kubectl → triggers device code automatically
- Now: kubectl → uses exec plugin → expects you to be logged in (Azure CLI) unless you configure your kubeconfig to use device code login mode explicitly.
This is because the internal Azure auth plugin is gone and kubelogin requires a more explicit and modern OAuth flow.