Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix cross tenant in cloud shell
  • Loading branch information
jiasli committed Apr 21, 2021
commit 06505a02c1df4d178205b79309667cda3f20b016
3 changes: 2 additions & 1 deletion src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,8 @@ def get_login_credentials(self, resource=None, subscription_id=None, aux_subscri
if sub[_TENANT_ID] != account[_TENANT_ID]:
external_tenants_info.append(sub[_TENANT_ID])

if external_tenants_info and (identity_type or in_cloud_console()):
if external_tenants_info and \
(in_cloud_console() and account[_USER_ENTITY].get(_CLOUD_SHELL_ID) or identity_type):
raise CLIError("Cross-tenant authentication is not supported by managed identity and Cloud Shell. "
"Please run `az login` with a user account or a service principal.")

Expand Down