Interview Prep/Azure/Fundamentals and Resource Hierarchy

How do you authenticate the Azure CLI on a laptop, in CI and on a VM?

BeginnerConceptFundamentals and Resource Hierarchy
Answer
Where How
Laptop az login (browser), or az login --use-device-code on a headless box
CI Workload identity federation: azure/login@v2 in GitHub, a WIF service connection in Azure DevOps; never a stored secret if you can avoid it
VM, App Service, AKS pod Managed identity: az login --identity (add --username <clientId> or --client-id for a user-assigned identity on newer CLI)

Then pin the subscription: az account set --subscription <id>. Most "wrong resources changed" incidents start with a default subscription nobody checked.

Azure All Azure questions Roadmap: Azure core services

More on Fundamentals and Resource Hierarchy