Post

The Next Generation of Azure PowerShell

The Next Generation of Azure PowerShell

Microsoft is rebuilding Azure PowerShell. Not a new major version of the Az modules you know - a new code base. It lives in the open on GitHub: Azure/azclips.

It’s a public preview. The current release is 0.1.8 from 15 November 2026. Commands, behavior and packaging can still change.

Requirements

  • PowerShell 7.6 or later. The binary cmdlets are built against System.Management.Automation 7.6. PowerShell 7.5 and Windows PowerShell 5.1 can’t load them. The ISE isn’t supported either.
  • tar on the PATH - the installer extracts a .tar.gz.
  • Any OS that PowerShell 7.6 runs on.

Installing next to classic Az

The preview ships through GitHub Releases, not the PowerShell Gallery. To install the Az rollup and all its dependencies for the current user:

1
2
3
4
5
$requestParams = @{
    Uri         = 'https://raw.githubusercontent.com/Azure/azclips/main/install/azps-install.ps1'
    ErrorAction = 'Stop'
}
Invoke-RestMethod @requestParams | Invoke-Expression

If you want to pass parameters:

1
2
3
4
5
6
7
8
9
10
11
$downloadParams = @{
    Uri     = 'https://raw.githubusercontent.com/Azure/azclips/main/install/azps-install.ps1'
    OutFile = './azps-install.ps1'
}
Invoke-WebRequest @downloadParams

$installParams = @{
    ModuleName = 'Az.Resources'
    Scope      = 'CurrentUser'
}
./azps-install.ps1 @installParams
ParameterDefaultPurpose
-ModuleNameAzInstall one module instead of the rollup
-RequiredVersionhighest packaged versionPin a version
-ScopeCurrentUserAllUsers for a machine-wide install (elevated)
-RepositoryNameAzclipsInstall-...Name of the temporary local repository

One session, one version

This is the most important thing to understand before you start. The preview uses the same module names as classic Az. Az, Az.Accounts, Az.Resources and so on. Only the version differs: 0.1.* for the preview, 15.x for classic.

An unversioned Import-Module Az loads the highest version. That’s classic. So is autoloading - run a cmdlet without importing first and PowerShell picks classic. Import the preview explicitly, before anything else:

1
2
3
4
5
6
7
$importParams = @{
    Name           = 'Az'
    MinimumVersion = '0.1.0'
    MaximumVersion = '0.1.9999'
}
Import-Module @importParams
Get-Module Az, Az.Accounts | Select-Object Name, Version, ModuleBase

The modules load .NET assemblies. Once they’re loaded, PowerShell can’t replace them. Remove-Module doesn’t help. To switch between classic and preview, start a new pwsh process. You can add them to your PowerShell profile for convenience:

1
2
function az-preview { pwsh -NoExit -Command 'Import-Module Az -MinimumVersion 0.1.0 -MaximumVersion 0.1.9999' }
function az-classic { pwsh -NoExit -Command 'Import-Module Az' }

The Az rollup (0.1.8) pulls in nine modules.

ModuleVersionCmdletsPurpose
Az.Accounts0.1.57Sign-in, profiles, access tokens
Az.Config0.1.65Settings in ~/.azclips/config.json
Az.Resources0.1.638Resource groups, ARM deployments at every scope, RBAC, raw REST
Az.Compute0.1.65Virtual machine lifecycle
Az.Network0.1.412VNets, NSGs, public IPs, NICs
Az.Storage0.1.224Storage accounts, Blob and Azure Files data plane
Az.KeyVault0.1.312Key Vault secrets and certificates
Az.ManagedServiceIdentity0.1.48User-assigned identities, federated credentials
Az.MsGraph0.1.66Entra ID users, groups, app registrations

At the time of writing the total number of cmdlets across all modules is 117.

Az.Accounts - sign-in and profiles

CmdletPurpose
Connect-AzAccountSign in and save or refresh a profile
Disconnect-AzAccountSign out of the active profile and clear its cached credentials
Get-AzProfileList profiles, show one, or show the active one
Set-AzProfileSwitch the active profile
Remove-AzProfileDelete a profile
Get-AzAccessTokenGet an Entra ID token for ARM, Graph, a resource URL or explicit scopes
Open-AzSurveyOpen the feedback survey

Get-AzContext, Set-AzContext, Select-AzSubscription and Get-AzSubscription don’t exist in the preview. Profiles replace them.

Get-AzAccessToken accepts -ResourceUrl, -ResourceTypeName, -Scope and -TenantId. It returns the token as SecureString unless you add -AsPlainText.

Supported sign-in methods:

MethodParameters
Interactive (browser)-SubscriptionId, optionally -TenantId
Device codeadd -UseDeviceCode
Managed identity-Identity, plus -ClientId, -ObjectId or -ResourceId for a user-assigned identity. Needs -SubscriptionId.
Service principal + secret-ClientId, -ClientSecret (SecureString), -TenantId, -SubscriptionId - or -ServicePrincipal -Credential
Service principal + OIDC-ServicePrincipal, -FederatedToken, -ClientId, -TenantId, -SubscriptionId

Certificate-based service principal sign-in isn’t there.

Az.Config - settings

CmdletPurpose
Get-AzConfigRead one key, a section (-Key core) or all effective values. -ConfiguredOnly hides defaults.
Set-AzConfigWrite a key. Unknown keys need -Force.
Remove-AzConfigDelete a key
Get-AzConfigInfoShow the schema: all valid keys, types and defaults
Get-AzConfigListList all values. Still exported in 0.1.8; the main branch has folded it into Get-AzConfig.

The configuration is a JSON file: ~/.azclips/config.json. Precedence is command arguments > environment variables > config file > defaults. Every result object has a Source property, so you see where a value comes from:

1
2
Get-AzConfig -Key core | Format-Table Key, Value, Source
Set-AzConfig -Key core.logging.level -Value debug

Useful keys: core.logging.level, core.http.maxRetries, core.http.maxRetriesFor429, telemetry.enabled, defaults.group, defaults.location.

Az.Resources - groups, deployments, RBAC, REST

The biggest module. It covers four areas.

Resource groups: New-AzResourceGroup, Get-AzResourceGroup, Set-AzResourceGroup, Remove-AzResourceGroup.

ARM/Bicep deployments - at all four scopes:

ScopeCmdlets
Resource groupNew-AzResourceGroupDeployment, New-AzResourceGroupDeploymentWhatIf, Test-AzResourceGroupDeployment, Get-AzResourceGroupDeployment, Stop-AzResourceGroupDeployment, Remove-AzResourceGroupDeployment, Save-AzResourceGroupDeploymentTemplate, Get-AzResourceGroupDeploymentOperation
SubscriptionNew-AzSubDeployment, Test-AzSubDeployment, Get-AzSubDeploymentWhatIfResult, Get-AzSubDeployment, Stop-AzSubDeployment, Remove-AzSubDeployment, Save-AzSubDeploymentTemplate, Get-AzDeploymentOperation
Management groupNew-AzManagementGroupDeployment, Test-AzManagementGroupDeployment, Get-AzManagementGroupDeployment, Stop-AzManagementGroupDeployment, Remove-AzManagementGroupDeployment, Get-AzManagementGroupDeploymentOperation
TenantNew-AzTenantDeployment, Test-AzTenantDeployment, Get-AzTenantDeploymentWhatIfResult, Get-AzTenantDeployment, Stop-AzTenantDeployment, Remove-AzTenantDeployment, Save-AzTenantDeploymentTemplate, Get-AzTenantDeploymentOperation

Note the new names at subscription scope: *-AzSubDeployment instead of *-AzSubscriptionDeployment. The old names still work as aliases.

Some behavior differs from classic:

  • New-AzSubDeployment and New-AzTenantDeployment validate before they deploy. A failed validation throws Deployment validation failed. and creates no deployment.
  • A failed subscription deployment reports the ARM error, up to three failed operations and the correlation ID.
  • -NoWait returns the submitted deployment. It doesn’t create a PowerShell job.
  • Without -Name, the deployment is named after the template file instead of a GUID.

RBAC: Get-AzRoleAssignment, New-AzRoleAssignment, Remove-AzRoleAssignment. Get-AzRoleAssignment lists the exact scope by default. -IncludeInherited, -ExpandPrincipalGroups and -IncludeNestedScopes widen it. New-AzRoleAssignment returns the existing assignment instead of failing when it already exists.

REST: Invoke-AzRestMethod - for everything the preview doesn’t cover yet. It takes the token from the active profile, or from the one you name with -Profile.

Az.Compute - virtual machines

CmdletPurpose
New-AzVMCreate a VM. Takes the VNet, subnet, NSG and public IP by name, or an existing NIC
Get-AzVMGet or list VMs.
Start-AzVMStart a VM
Stop-AzVMStop or deallocate a VM
Remove-AzVMDelete. -ForceDeletion for forced deletion

New-AzVM is one cmdlet with many parameters, not the classic New-AzVMConfig / Set-AzVMOperatingSystem / Add-AzVMNetworkInterface chain. It supports marketplace URNs, security type with Secure Boot and vTPM, SSH keys, zones (-Zone), tags, -StorageSku and -OSDiskDeleteOption.

Az.Network - the VM building blocks

ResourceCmdlets
Virtual networkNew-AzVirtualNetwork, Get-AzVirtualNetwork, Remove-AzVirtualNetwork
Network security groupNew-AzNetworkSecurityGroup, Get-AzNetworkSecurityGroup, Remove-AzNetworkSecurityGroup
Public IPNew-AzPublicIpAddress, Get-AzPublicIpAddress, Remove-AzPublicIpAddress
Network interfaceNew-AzNetworkInterface, Get-AzNetworkInterface, Remove-AzNetworkInterface

Subnets are hashtables on New-AzVirtualNetwork -Subnet. There’s no New-AzVirtualNetworkSubnetConfig. Outputs expose properties directly ($vnet.Subnets), not under .Properties. Get-AzNetworkSecurityGroup, Get-AzNetworkInterface and Get-AzPublicIpAddress without -ResourceGroupName list the whole subscription.

Az.Storage - management and data plane

AreaCmdlets
Storage accountNew-AzStorageAccount, Get-AzStorageAccount, Remove-AzStorageAccount
Blob containerNew-AzStorageContainer, Remove-AzStorageContainer
BlobGet-AzStorageBlob, Set-AzStorageBlobContent, Get-AzStorageBlobContent, Copy-AzStorageBlob, Start-AzStorageBlobCopy, Remove-AzStorageBlob
File shareNew-AzStorageShare, Get-AzStorageShare, Update-AzStorageShare, Remove-AzStorageShare
DirectoryNew-AzStorageDirectory, Get-AzStorageDirectory, Remove-AzStorageDirectory
FileNew-AzStorageFile, Get-AzStorageFile, Set-AzStorageFileContent, Get-AzStorageFileContent, Start-AzStorageFileCopy, Remove-AzStorageFile

No New-AzStorageContext. The data plane cmdlets take -StorageAccountName with -StorageAccountKey, or -SasToken.

Az.KeyVault - secrets and certificates

AreaCmdlets
SecretsSet-AzKeyVaultSecret, Get-AzKeyVaultSecret, Update-AzKeyVaultSecret, Remove-AzKeyVaultSecret, Undo-AzKeyVaultSecretRemoval
CertificatesAdd-AzKeyVaultCertificate, Import-AzKeyVaultCertificate, Get-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Export-AzKeyVaultCertificate, Remove-AzKeyVaultCertificate, Undo-AzKeyVaultCertificateRemoval

Get-AzKeyVaultSecret returns metadata only by default. The value comes with -AsPlainText. Certificate import handles encrypted PFX and PEM. Export is public part only (DER or PEM).

Az.ManagedServiceIdentity - identities for workloads

AreaCmdlets
User-assigned identityNew-AzUserAssignedIdentity, Get-AzUserAssignedIdentity, Update-AzUserAssignedIdentity, Remove-AzUserAssignedIdentity
Federated credentialNew-AzFederatedIdentityCredential, Get-AzFederatedIdentityCredential, Update-AzFederatedIdentityCredential, Remove-AzFederatedIdentityCredential

The federated credentials are the interesting part. A user-assigned identity plus a federated credential is how GitHub Actions or Kubernetes workloads sign in without a secret.

Az.MsGraph - Entra ID

CmdletPurpose
Get-AzMsGraphUserGet or list users
Get-AzMsGraphGroupGet or list groups
Get-AzMsGraphGroupMemberList members of a group
New-AzMsGraphApplicationCreate an app registration
Get-AzMsGraphApplicationGet or list app registrations
Remove-AzMsGraphApplicationDelete an app registration

The nouns changed: AzMsGraphUser instead of classic AzADUser, AzMsGraphApplication instead of AzADApplication. There are no service principal cmdlets yet. Get-AzMsGraphApplication returns single objects and follows all pages, not a raw response envelope.

Profiles: the new piece

Everything above is a smaller version of something you know. Profiles are new. They change how you manage where your commands run.

What classic Az does

Classic Az.Accounts has contexts. Connect-AzAccount creates one. Set-AzContext or Select-AzSubscription changes the subscription of the current one. Get-AzContext -ListAvailable shows all of them. With context autosave, they land in AzureRmContext.json.

That works. But contexts get long auto-generated names built from the subscription name, IDs and the account. And the “current” context is global. One Set-AzContext in a helper script changes the target of every command that follows.

What a profile is

A profile is a named sign-in context. You give it the name. Connect-AzAccount saves it. It stores:

FieldMeaning
NameYour name for it, e.g. prod
TenantIdThe Entra ID tenant
SubscriptionIdThe subscription
CloudNameAzureCloud by default
AuthMethodBrowser, DeviceCode, ManagedIdentity, ServicePrincipalSecret or Federated
UserPrincipalNameThe signed-in account (for service principals: the application ID)
ClientId, ManagedIdentityIdFor service principals and user-assigned identities
DefaultLocation, DefaultResourceGroupFields for profile defaults

A profile doesn’t contain a token or a secret. It says which connection to use, not how to prove it. Credentials live separately (see below).

Where it’s stored

Everything lives under ~/.azclips ($HOME\.azclips on Windows):

FileContent
profiles.jsonAll profiles, one JSON object keyed by name
active-profilePlain text: the name of the active profile - or no file at all
config.jsonThe configuration from Az.Config
MSAL token cacheProtected with DPAPI on Windows, Keychain on macOS, libsecret on Linux

AZCLIPS_HOME overrides the root. That’s useful for CI runners or to keep test profiles apart.

profiles.json looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "prod": {
    "Name": "prod",
    "TenantId": "<tenant-id>",
    "SubscriptionId": "<subscription-id>",
    "CloudName": "AzureCloud",
    "AuthMethod": "Browser",
    "DefaultLocation": null,
    "DefaultResourceGroup": null,
    "UserPrincipalName": "constantin@contoso.com",
    "ClientId": null,
    "ManagedIdentityId": null
  }
}

Creating profiles

-OutProfile names the profile. The first sign-in needs -SubscriptionId - the preview doesn’t guess a subscription for you:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$homeParams = @{
    TenantId       = '<your-tenant-id>'
    SubscriptionId = '<your-subscription-id>'
    OutProfile     = 'home'
}
Connect-AzAccount @homeParams

$customerParams = @{
    TenantId       = '<your-customer-tenant-id>'
    SubscriptionId = '<your-customer-subscription-id>'
    OutProfile     = 'customer-prod'
    UseDeviceCode  = $true
}
Connect-AzAccount @customerParams

The last sign-in becomes the active profile.

Without -OutProfile, Connect-AzAccount writes to the reserved profile default. That keeps old scripts working. But every bare sign-in overwrites default. For anything you want to keep, name it.

Naming rules: 1-100 characters, letters, digits, -, _ and .. default is reserved.

There’s no New-AzProfile. A profile only comes into existence through a successful sign-in. So every profile has worked at least once.

Listing, showing, switching

1
2
3
4
5
6
Get-AzProfile                          # all profiles, IsActive marks the active one
Get-AzProfile -Name customer-prod      # one profile
Get-AzProfile -Active                  # the active one

Set-AzProfile -Name home               # switch
Get-AzResourceGroup                    # runs against home

Set-AzProfile only moves the pointer in active-profile. It doesn’t sign in again and doesn’t call Azure. It checks that the profile exists, that’s all. Switching is instant.

The per-command override

This is the feature I like most. Most cmdlets have a -Profile parameter. It runs that one command against another profile. The active profile doesn’t change:

1
2
3
4
5
6
7
8
9
Get-AzProfile -Active | Select-Object Name     # home

# Compare the home with a customer tenant
$home = Get-AzResourceGroup
$customer  = Get-AzResourceGroup -Profile prod

Compare-Object $home.Name $customer.Name

Get-AzProfile -Active | Select-Object Name     # still home

That’s the end of Set-AzContext ping-pong in scripts. A script can work with two tenants side by side and leave the session exactly as it found it.

The rules:

  • An explicit -Profile with a name that doesn’t exist fails. No silent fallback to the active profile.
  • Without -Profile, the active profile is used.
  • Without an active profile, the command runs without a profile and fails at the first call to Azure. Not every cmdlet has -Profile yet. In the current source, Az.MsGraph and the Key Vault certificate cmdlets have none. In Az.Storage only the storage account cmdlets have it - the data plane uses a key or SAS anyway. Check before you rely on it:
1
(Get-Command Get-AzVM).Parameters.ContainsKey('Profile')

There’s also a narrower override: commands with -SubscriptionId run against another subscription with the identity of the active profile.

Re-authenticating

Tokens expire. -Profile on Connect-AzAccount refreshes an existing profile in place:

1
Connect-AzAccount -Profile customer-prod

Tenant, subscription and identity come from the profile. You can’t change them during re-authentication: -Profile doesn’t accept -SubscriptionId, -TenantId or another sign-in method. A profile always stays the identity it was created with. To change it, create it again with -OutProfile.

-Profile and -OutProfile together are rejected. One refreshes, the other creates.

One profile store for PowerShell and CLI

The PowerShell modules and the new az share the same ~/.azclips. A profile created in one surface works in the other:

1
az login --tenant-id $tenantId --subscription-id $subId --out-profile lab
1
2
Set-AzProfile -Name lab
Get-AzResourceGroup

Signing out and removing

1
2
Disconnect-AzAccount        # sign out of the active profile, keep its definition
Remove-AzProfile -Name lab  # delete the definition

Conclusion

The next generation of Azure PowerShell is a rebuild, not a refresh. One .NET 10 engine for PowerShell and CLI and PowerShell 7.6 as the minimum.

With 117 cmdlets in nine modules, it’s not a replacement for classic Az yet. It covers sign-in, deployments at every scope, VMs and their network, storage, Key Vault secrets and certificates, managed identities and the basics of Entra ID. For the rest there’s Invoke-AzRestMethod.

The part I’d try today is profiles. Named contexts you choose yourself, one store for PowerShell and CLI, and -Profile on a single command without touching the session. For someone who jumps between multiple tenants all day, that’s a very useful feature.

If you find any bugs or missing features, open an issue on the repository. Your feedback helps shape the next generation of Azure PowerShell.

That’s it for this blog post.

This post is licensed under CC BY 4.0 by the author.