Skip to content

Commit f58a10f

Browse files
committed
enable_broker_on_wsl
1 parent 42850b4 commit f58a10f

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

src/azure-cli-core/azure/cli/core/_profile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,13 +1009,16 @@ def _create_identity_instance(cli_ctx, authority, tenant_id=None, client_id=None
10091009
from .telemetry import set_broker_info
10101010
set_broker_info(enable_broker_on_windows)
10111011

1012+
# On WSL, use core.enable_broker_on_wsl=true to use broker (WAM)
1013+
enable_broker_on_wsl = cli_ctx.config.getboolean('core', 'enable_broker_on_wsl', fallback=False)
10121014
# PREVIEW: In Azure Stack environment, use core.instance_discovery=false to disable MSAL's instance discovery.
10131015
instance_discovery = cli_ctx.config.getboolean('core', 'instance_discovery', True)
10141016

10151017
return Identity(authority, tenant_id=tenant_id, client_id=client_id,
10161018
encrypt=encrypt,
10171019
use_msal_http_cache=use_msal_http_cache,
10181020
enable_broker_on_windows=enable_broker_on_windows,
1021+
enable_broker_on_wsl=enable_broker_on_wsl,
10191022
instance_discovery=instance_discovery)
10201023

10211024

src/azure-cli-core/azure/cli/core/auth/identity.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class Identity: # pylint: disable=too-many-instance-attributes
5858
_service_principal_store_instance = None
5959

6060
def __init__(self, authority, tenant_id=None, client_id=None, encrypt=False, use_msal_http_cache=True,
61-
enable_broker_on_windows=None, instance_discovery=None):
61+
enable_broker_on_windows=None, enable_broker_on_wsl=None,
62+
instance_discovery=None):
6263
"""
6364
:param authority: Authentication authority endpoint. For example,
6465
- AAD: https://login.microsoftonline.com
@@ -74,6 +75,7 @@ def __init__(self, authority, tenant_id=None, client_id=None, encrypt=False, use
7475
self._encrypt = encrypt
7576
self._use_msal_http_cache = use_msal_http_cache
7677
self._enable_broker_on_windows = enable_broker_on_windows
78+
self._enable_broker_on_wsl = enable_broker_on_wsl
7779
self._instance_discovery = instance_discovery
7880

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

119122
@property

src/azure-cli/requirements.py3.Linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ psutil==6.1.0
117117
pycomposefile==0.0.32
118118
PyGithub==1.55
119119
PyJWT==2.4.0
120+
pymsalruntime==0.18.1
120121
PyNaCl==1.5.0
121122
pyOpenSSL==25.0.0
122123
python-dateutil==2.8.0

src/azure-cli/requirements.py3.windows.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ psutil==6.1.0
116116
pycomposefile==0.0.32
117117
PyGithub==1.55
118118
PyJWT==2.4.0
119-
pymsalruntime==0.16.2
119+
pymsalruntime==0.18.1
120120
PyNaCl==1.5.0
121121
pyOpenSSL==25.0.0
122122
python-dateutil==2.8.0

0 commit comments

Comments
 (0)