Next Gen Azure CLI and Azure PowerShell (Preview)
Microsoft has launched the Public Preview of the Next Gen Azure CLI and Azure PowerShell, introducing a modernized, complete reimagining of how administrators, developers, and platform engineers interact with Azure from the terminal.
For years, choosing between Azure CLI (az) and Azure PowerShell (Az.*) meant working across two completely separate toolchains, each with its own runtime, separate sign in sessions, and subtle behavioral differences. With this new Public Preview, both command surfaces converge on a single, lightweight, fast foundation while keeping the familiar syntax you already use every day.
Best of all, the preview installs side by side with your existing classic tools, making it completely safe to test without disrupting your daily workflows or production scripts.
Why Next Gen Azure CLI and Azure PowerShell Matter
Under the hood, the Next Gen Azure CLI and Azure PowerShell share a unified, extension-based .NET 10 command engine. Whether you prefer native az commands in Bash/Zsh or object-oriented Az.* cmdlets in PowerShell, both surfaces execute through the exact same core pipeline and authentication stack.
This unified architecture delivers immediate practical benefits:
- Faster startup and execution with a significantly smaller disk footprint (including a lean CLI package option).
- Self-contained CLI binary with no local Python or .NET SDK installation required.
- Identical behavior and outcomes across CLI commands and PowerShell cmdlets.
- Ready for constrained environments, containers, and modern cross-platform shells across Windows, Linux (glibc and Alpine/musl, x64 and Arm64), macOS (Intel and Apple Silicon), and WSL.
Standout Features in the Public Preview
1. True Single Sign-On (SSO) Across CLI and PowerShell
Switching between az and PowerShell no longer requires authenticating twice. Sign in once using either az login or Connect-AzAccount, and your authenticated context is immediately shared across both tools:
# Sign in once via Azure CLI
az login --tenant-id <tenant-id> --subscription-id <subscription-id>
# Run a native Azure CLI command
az group list
# Immediately run Azure PowerShell cmdlets without a second login!
Get-AzResourceGroup
2. Named Sign-In Profiles for Multi-Tenant & Multi-Subscription Work
If you juggle development and production subscriptions, customer tenants, or personal and corporate accounts, named profiles are a game changer. Instead of constantly overwriting a single global context, you can save named sign-in contexts and switch between them, or target a single command at another profile on the fly:
# Save two named sign-in profiles
az login --tenant-id <dev-tenant-id> --subscription-id <dev-sub-id> --out-profile dev
az login --tenant-id <prod-tenant-id> --subscription-id <prod-sub-id> --out-profile prod
# List saved profiles and switch the active context
az profile list
az profile set --name dev
# Run a one-off command against 'prod' without switching your active profile
az group list --profile prod
The exact same profile workflow works natively in Azure PowerShell using Connect-AzAccount -OutProfile, Get-AzProfile, and Set-AzProfile.
3. Fast, Offline-Capable Shell-Native Tab Completion
The Next Gen Azure CLI integrates directly with the native completion engines of Bash, Zsh, and PowerShell. Pressing Tab resolves command groups, subcommands, parameter names, and even valid parameter values (such as Azure regions) straight from local metadata, offline and without requiring active authentication:
| Scenario | Example | Result |
|---|---|---|
| Commands & subcommands | az vm <Tab> |
Suggests create, list, delete, get-instance-view, etc. |
| Parameter names | az vm create --<Tab> |
Suggests --name, --resource-group, --location, etc. |
| Valid parameter values | az vm create --location <Tab> |
Suggests valid Azure regions (westeurope, switzerlandnorth, eastus, etc.) |
4. Opt-In AI-Powered Error Recovery
Cryptic ARM deployment errors and missing-parameter failures can slow down troubleshooting. The Next Gen Azure CLI includes an opt-in AI-powered error recovery capability (disabled by default for privacy and control).
When enabled in manual or auto mode, recent command failures are stored locally using OS-protected encryption (Windows DPAPI, macOS Keychain, or Linux Secret Service). Whenever a command fails, you can ask the integrated AI agent to analyze what went wrong:
# Enable manual AI recovery capture (off by default)
az config set --key agent.recovery.trigger --value manual
# Diagnose the latest command failure in your terminal
az troubleshoot recover
# Or start a multi-turn interactive troubleshooting session
az troubleshoot recover --style interactive
The AI response breaks down what went wrong, values to review, and recommended next steps. By default, it uses Microsoft’s built-in AI provider at no additional cost (requiring az login), or you can optionally switch it to use your GitHub Copilot subscription (az config set --key agent.provider --value github).
5. Safe Side-by-Side Coexistence
Evaluating a preview tool shouldn’t put your daily work at risk. By default, the Next Gen Azure CLI installs into an isolated user directory (~/.local/share/azcli on Linux/macOS or %LOCALAPPDATA%\Programs\azcli on Windows) and does not modify your global PATH. Your classic Azure CLI and classic Azure PowerShell installations remain untouched, allowing you to opt in per terminal session and switch back anytime.
Hands-On Quickstart: How to Try the Preview
Note: Check the official GitHub repository and release notes for the latest installation scripts and bundles: GitHub Releases.
Install Next Gen Azure CLI (Preview)
On Linux, macOS, or WSL:
curl -fsSL https://raw.githubusercontent.com/Azure/azclips/main/install/azcli-install.sh | bash
# Activate for the current shell session only (keeps classic 'az' untouched globally)
export PATH="$HOME/.local/share/azcli:$PATH"
az --version
On Windows (PowerShell 7+):
irm https://raw.githubusercontent.com/Azure/azclips/main/install/azcli-install.ps1 -ErrorAction Stop | iex
# Activate for the current PowerShell session only
$env:Path = "$env:LOCALAPPDATA\Programs\azcli;$env:Path"
az --version
(Tip: If you only want core built-in extensions for minimal footprint, set AZCLI_PACKAGE=lean before running the installer.)
Install Next Gen Azure PowerShell (Preview)
Because the binary cmdlets are compiled against .NET 10 and modern PowerShell APIs, PowerShell 7.6 or later is required ($PSVersionTable.PSVersion). Run the cross-platform bootstrap inside pwsh:
# Windows, Linux, macOS, or WSL (PowerShell 7.6+)
irm https://raw.githubusercontent.com/Azure/azclips/main/install/azps-install.ps1 -ErrorAction Stop | iex
# Verify installed preview modules
Import-Module Az
Get-Module Az.* -ListAvailable | Select-Object Name, Version
Supported Workloads & Preview Considerations
Command coverage is expanding rapidly in regular preview iterations. Out of the box, the Public Preview already covers key day-to-day scenarios across CLI and PowerShell:
- Core & Governance: Accounts, Named Profiles, Configuration, Extensions, Resource Groups, and ARM/Bicep Deployments across Resource Group, Subscription, Management Group, and Tenant scopes (including What-If previews)
- Infrastructure: Compute (VMs, Disks, SSH keys, Instance Views), Networking (VNets, Subnets, NSGs, NICs, Public IPs), and Storage (Accounts plus Blob and Azure Files data-plane operations)
- Security & Identity: Key Vault, User-Assigned Managed Identities (including Federated Identity Credentials), Microsoft Graph / Entra ID (
msgraphfor users, groups, and app registrations), and rawaz restcalls - Authentication: Interactive browser login, Device Code flow, Managed Identities, Service Principals, and OIDC Federated Credentials for CI/CD pipelines
Keep in mind before deploying:
- This is an early Public Preview, so commands, parameters, and packaging may change between builds without notice.
- Shell support: Next Gen Azure CLI supports Bash, Zsh, and PowerShell 7+. Next Gen Azure PowerShell requires PowerShell 7.6+ (Windows PowerShell 5.1 and PowerShell ISE are not supported).
- AI Error Recovery is currently available for Azure CLI (
az) commands only.
Final Thoughts & Sharing Feedback
Unifying Azure CLI and Azure PowerShell on a single, fast .NET 10 engine (complete with shared SSO, first-class profile management, and opt-in AI troubleshooting) solves longstanding friction points for anyone working across multiple Azure environments and shells.
Since it installs cleanly side by side with your existing tools, spinning it up in a test terminal takes less than a minute. Give the Public Preview a try and share bugs, feature requests, or feedback directly with the engineering team via GitHub Issues and GitHub Discussions.
