Skip to main content

Switch-AzureCliAuthMode

SYNOPSIS

Switches Azure CLI authentication between browser and WAM modes.

SYNTAX

Toggle (Default)

Switch-AzureCliAuthMode [-ProgressAction <ActionPreference>] [<CommonParameters>]

Specify

Switch-AzureCliAuthMode [-Mode <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

GetCurrent

Switch-AzureCliAuthMode [-GetCurrent] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Toggles the Windows broker (WAM) setting when using az login. If no mode is specified, it toggles between modes. If a mode is specified, it switches to that mode.

Beginning with Azure CLI version 2.61.0, Web Account Manager (WAM) is the default authentication method on Windows. WAM is a Windows 10+ component that acts as an authentication broker. An authentication broker is an application that runs on a user's machine. It manages the authentication handshakes and token maintenance for connected accounts.

Using WAM has several benefits:

  • Enhanced security. See Conditional Access: Token protection (preview).
  • Support for Windows Hello, conditional access policies, and FIDO keys.
  • Streamlined single sign-on.
  • Bug fixes and enhancements shipped with Windows.

Technically this opens a window for login. But, in some cases, especially when connecting to client environments, it might be preferable to use the browser-based authentication method.

EXAMPLES

EXAMPLE 1

Switch-AzureCliAuthMode
Toggles between browser and WAM authentication modes.

EXAMPLE 2

Switch-AzureCliAuthMode -Mode Browser
Switches to browser-based authentication.

EXAMPLE 3

Switch-AzureCliAuthMode -Mode WAM
Switches to Web Account Manager authentication.

EXAMPLE 4

Switch-AzureCliAuthMode -GetCurrent
Displays the current authentication mode.

PARAMETERS

-Mode

The authentication mode to switch to. Valid values are 'Browser' or 'WAM'. If not specified, the function will toggle between the current modes.

Type: String
Parameter Sets: Specify
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-GetCurrent

Displays the current authentication mode without making any changes.

Type: SwitchParameter
Parameter Sets: GetCurrent
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES