Skip to content

Commit bfb73c3

Browse files
committed
arc
1 parent ef2ad8f commit bfb73c3

5 files changed

Lines changed: 13 additions & 12 deletions

File tree

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ def login(self,
220220
return deepcopy(consolidated)
221221

222222
def login_with_managed_identity(self, identity_id=None, allow_no_subscriptions=None):
223-
if _on_azure_arc_windows():
224-
return self.login_with_managed_identity_azure_arc_windows(
223+
if _on_azure_arc():
224+
return self.login_with_managed_identity_azure_arc(
225225
identity_id=identity_id, allow_no_subscriptions=allow_no_subscriptions)
226226

227227
import jwt
@@ -286,7 +286,7 @@ def login_with_managed_identity(self, identity_id=None, allow_no_subscriptions=N
286286
self._set_subscriptions(consolidated)
287287
return deepcopy(consolidated)
288288

289-
def login_with_managed_identity_azure_arc_windows(self, identity_id=None, allow_no_subscriptions=None):
289+
def login_with_managed_identity_azure_arc(self, identity_id=None, allow_no_subscriptions=None):
290290
import jwt
291291
identity_type = MsiAccountTypes.system_assigned
292292
from .auth.msal_credentials import ManagedIdentityCredential
@@ -388,7 +388,7 @@ def get_login_credentials(self, resource=None, subscription_id=None, aux_subscri
388388

389389
elif managed_identity_type:
390390
# managed identity
391-
if _on_azure_arc_windows():
391+
if _on_azure_arc():
392392
from .auth.msal_credentials import ManagedIdentityCredential
393393
from azure.cli.core.auth.credential_adaptor import CredentialAdaptor
394394
# The credential must be wrapped by CredentialAdaptor so that it can work with Track 1 SDKs.
@@ -449,7 +449,7 @@ def get_raw_token(self, resource=None, scopes=None, subscription=None, tenant=No
449449
# managed identity
450450
if tenant:
451451
raise CLIError("Tenant shouldn't be specified for managed identity account")
452-
if _on_azure_arc_windows():
452+
if _on_azure_arc():
453453
from .auth.msal_credentials import ManagedIdentityCredential
454454
cred = ManagedIdentityCredential()
455455
else:
@@ -960,6 +960,7 @@ def _create_identity_instance(cli_ctx, authority, tenant_id=None, client_id=None
960960
instance_discovery=instance_discovery)
961961

962962

963-
def _on_azure_arc_windows():
964-
# This indicates an Azure Arc-enabled Windows server
965-
return "IDENTITY_ENDPOINT" in os.environ and "IMDS_ENDPOINT" in os.environ
963+
def _on_azure_arc():
964+
# This indicates an Azure Arc-enabled server
965+
from msal.managed_identity import get_managed_identity_source, AZURE_ARC
966+
return get_managed_identity_source() == AZURE_ARC

src/azure-cli-core/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
'jmespath',
5454
'knack~=0.11.0',
5555
'msal-extensions==1.2.0',
56-
'msal[broker]==1.31.0',
56+
'msal[broker]==1.31.1',
5757
'msrestazure~=0.6.4',
5858
'packaging>=20.9',
5959
'pkginfo>=1.5.0.1',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jmespath==0.9.5
104104
jsondiff==2.0.0
105105
knack==0.11.0
106106
msal-extensions==1.2.0
107-
msal[broker]==1.31.0
107+
msal[broker]==1.31.1
108108
msrest==0.7.1
109109
msrestazure==0.6.4
110110
oauthlib==3.2.2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jmespath==0.9.5
105105
jsondiff==2.0.0
106106
knack==0.11.0
107107
msal-extensions==1.2.0
108-
msal[broker]==1.31.0
108+
msal[broker]==1.31.1
109109
msrest==0.7.1
110110
msrestazure==0.6.4
111111
oauthlib==3.2.2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jmespath==0.9.5
104104
jsondiff==2.0.0
105105
knack==0.11.0
106106
msal-extensions==1.2.0
107-
msal[broker]==1.31.0
107+
msal[broker]==1.31.1
108108
msrest==0.7.1
109109
msrestazure==0.6.4
110110
oauthlib==3.2.2

0 commit comments

Comments
 (0)