Skip to content

[authentication] Enable broker based authentication on macOS ARM64 (opt-in via enable_broker_on_mac=true)#33376

Open
naga-nandyala wants to merge 1 commit into
Azure:devfrom
naga-nandyala:naga/broker_on_mac
Open

[authentication] Enable broker based authentication on macOS ARM64 (opt-in via enable_broker_on_mac=true)#33376
naga-nandyala wants to merge 1 commit into
Azure:devfrom
naga-nandyala:naga/broker_on_mac

Conversation

@naga-nandyala
Copy link
Copy Markdown
Contributor

@naga-nandyala naga-nandyala commented May 14, 2026

Related command
az {login}

Description

Changes:

  • Pass enable_broker_on_mac flag to MSAL Identity and PublicClientApplication
  • Broker on macOS is opt-in (default False). Users enable via az config set core.enable_broker_on_mac=true
  • Install msal[broker] on darwin in addition to win32 (setup.py)
  • Add requirements.py3.MacOS.txt with msal[broker] and pymsalruntime pinned
  • Update macOS build script to use requirements.py3.MacOS.txt
  • Add EnableBrokerOnMac telemetry custom property
  • Add unit tests for default (False) and opt-in (True) behavior

Note: Currently supported on macOS ARM64 only.

Supersedes #32773

Testing Guide

  1. az login — should work as before (broker disabled by default on macOS)
  2. az config set core.enable_broker_on_mac=true then az login — should use broker authentication
  3. az config unset core.enable_broker_on_mac — reverts to default (no broker)

History Notes


This checklist is used to make sure that common guidelines for a pull request are followed.

- Add enable_broker_on_mac config (default: False, opt-in via core.enable_broker_on_mac=true)
- Pass enable_broker_on_mac to MSAL Identity and PublicClientApplication
- Add EnableBrokerOnMac telemetry property
- Install msal[broker] on darwin in addition to win32
- Add requirements.py3.MacOS.txt with msal[broker] and pymsalruntime pinned
- Update build script to use MacOS requirements file
- Add unit tests for broker_on_mac default and opt-in behavior

Supersedes Azure#32773
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 14, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 14, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 14, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds opt-in macOS broker authentication support for az login, wiring the new setting through Azure CLI Core authentication, telemetry, packaging, and macOS release dependencies.

Changes:

  • Adds core.enable_broker_on_mac handling and passes it into MSAL Identity/PublicClientApplication.
  • Records macOS broker state in telemetry and adds unit coverage for default/opt-in behavior.
  • Adds a macOS-specific pinned requirements file and updates the macOS binary packaging script to use it.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/azure-cli/requirements.py3.MacOS.txt Adds a macOS-specific dependency lockfile with broker MSAL runtime dependencies.
src/azure-cli-core/setup.py Expands MSAL broker extra installation to macOS.
src/azure-cli-core/azure/cli/core/tests/test_profile.py Adds tests for default and enabled macOS broker config behavior.
src/azure-cli-core/azure/cli/core/telemetry.py Adds telemetry property for macOS broker enablement.
src/azure-cli-core/azure/cli/core/auth/identity.py Passes macOS broker enablement into MSAL public client kwargs.
src/azure-cli-core/azure/cli/core/_profile.py Reads macOS broker config and forwards it to telemetry and Identity.
scripts/release/macos/build_binary_tar_gz.py Switches macOS binary packaging to the new macOS requirements file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'msal-extensions==1.3.1',
'msal[broker]==1.35.1; sys_platform == "win32"',
'msal==1.35.1; sys_platform != "win32"',
'msal[broker]==1.35.1; sys_platform == "win32" or sys_platform == "darwin"',
# On Windows, use core.enable_broker_on_windows=false to disable broker (WAM) for authentication.
enable_broker_on_windows = cli_ctx.config.getboolean('core', 'enable_broker_on_windows', fallback=True)
# On macOS, broker authentication is opt-in. Use core.enable_broker_on_mac=true to enable it.
enable_broker_on_mac = cli_ctx.config.getboolean('core', 'enable_broker_on_mac', fallback=False)
SRC_DIR = PROJECT_ROOT / "src"
AZURE_CLI_CORE_DIR = SRC_DIR / "azure-cli-core"
REQUIREMENTS_FILE = SRC_DIR / "azure-cli" / "requirements.py3.Darwin.txt"
REQUIREMENTS_FILE = SRC_DIR / "azure-cli" / "requirements.py3.MacOS.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants