Skip to content
Closed
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
11 changes: 1 addition & 10 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,7 @@ def _normalize_properties(self, user, subscriptions, is_service_principal, cert_
if subscription_dict[_SUBSCRIPTION_NAME] != _TENANT_LEVEL_ACCOUNT_NAME:
if hasattr(s, 'home_tenant_id'):
subscription_dict[_HOME_TENANT_ID] = s.home_tenant_id
if hasattr(s, 'managed_by_tenants'):
if s.managed_by_tenants is None:
# managedByTenants is missing from the response. This is a known service issue:
# https://github.com/Azure/azure-rest-api-specs/issues/9567
# pylint: disable=line-too-long
raise CLIError("Invalid profile is used for cloud '{cloud_name}'. "
"To configure the cloud profile, run `az cloud set --name {cloud_name} --profile <profile>(e.g. 2019-03-01-hybrid)`. "
"For more information about using Azure CLI with Azure Stack, see "
"https://docs.microsoft.com/azure-stack/user/azure-stack-version-profiles-azurecli2"
.format(cloud_name=self.cli_ctx.cloud.name))
if getattr(s, 'managed_by_tenants', None):
subscription_dict[_MANAGED_BY_TENANTS] = [{_TENANT_ID: t.tenant_id} for t in s.managed_by_tenants]

consolidated.append(subscription_dict)
Expand Down