Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,13 +1009,16 @@ def _create_identity_instance(cli_ctx, authority, tenant_id=None, client_id=None
from .telemetry import set_broker_info
set_broker_info(enable_broker_on_windows)

# On WSL, use core.enable_broker_on_wsl=true to use broker (WAM)
enable_broker_on_wsl = cli_ctx.config.getboolean('core', 'enable_broker_on_wsl', fallback=False)
Copy link
Member Author

Choose a reason for hiding this comment

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

Telemetry for enable_broker_on_wsl will be added by #31275.

Sending telemetry during development will pollute the telemetry as the feature is not ready yet.

# PREVIEW: In Azure Stack environment, use core.instance_discovery=false to disable MSAL's instance discovery.
instance_discovery = cli_ctx.config.getboolean('core', 'instance_discovery', True)

return Identity(authority, tenant_id=tenant_id, client_id=client_id,
encrypt=encrypt,
use_msal_http_cache=use_msal_http_cache,
enable_broker_on_windows=enable_broker_on_windows,
enable_broker_on_wsl=enable_broker_on_wsl,
instance_discovery=instance_discovery)


Expand Down
5 changes: 4 additions & 1 deletion src/azure-cli-core/azure/cli/core/auth/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class Identity: # pylint: disable=too-many-instance-attributes
_service_principal_store_instance = None

def __init__(self, authority, tenant_id=None, client_id=None, encrypt=False, use_msal_http_cache=True,
enable_broker_on_windows=None, instance_discovery=None):
enable_broker_on_windows=None, enable_broker_on_wsl=None,
instance_discovery=None):
"""
:param authority: Authentication authority endpoint. For example,
- AAD: https://login.microsoftonline.com
Expand All @@ -74,6 +75,7 @@ def __init__(self, authority, tenant_id=None, client_id=None, encrypt=False, use
self._encrypt = encrypt
self._use_msal_http_cache = use_msal_http_cache
self._enable_broker_on_windows = enable_broker_on_windows
self._enable_broker_on_wsl = enable_broker_on_wsl
self._instance_discovery = instance_discovery

# Build the authority in MSAL style
Expand Down Expand Up @@ -114,6 +116,7 @@ def _msal_public_app_kwargs(self):
# enable_broker_on_windows can only be used on PublicClientApplication.
return {**self._msal_app_kwargs,
"enable_broker_on_windows": self._enable_broker_on_windows,
"enable_broker_on_wsl": self._enable_broker_on_wsl,
"enable_pii_log": True}

@property
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ psutil==6.1.0
pycomposefile==0.0.32
PyGithub==1.55
PyJWT==2.4.0
pymsalruntime==0.18.1
PyNaCl==1.5.0
pyOpenSSL==25.0.0
python-dateutil==2.8.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ psutil==6.1.0
pycomposefile==0.0.32
PyGithub==1.55
PyJWT==2.4.0
pymsalruntime==0.16.2
pymsalruntime==0.18.1
PyNaCl==1.5.0
pyOpenSSL==25.0.0
python-dateutil==2.8.0
Expand Down
Loading