Skip to content
Merged
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
14 changes: 8 additions & 6 deletions src/azure-cli-core/azure/cli/core/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ def get_clouds(cli_ctx):
except configparser.MissingSectionHeaderError:
os.remove(CLOUD_CONFIG_FILE)
logger.warning("'%s' is in bad format and has been removed.", CLOUD_CONFIG_FILE)
active_cloud_name = get_active_cloud_name(cli_ctx)
for section in config.sections():
c = Cloud(section)
for option in config.options(section):
Expand All @@ -602,19 +603,20 @@ def get_clouds(cli_ctx):
"2019-03-01-hybrid",
"2020-09-01-hybrid",
):
logger.error(
"The azure stack profile '%s' has been deprecated and removed, using the 'latest' profile instead.\n"
"To continue using Azure Stack, please install the Azure CLI `2.66.*` (LTS) version. For more details, refer to: https://learn.microsoft.com/en-us/cli/azure/whats-new-overview#important-notice-for-azure-stack-hub-customers", c.profile
)
c.profile = 'latest'
if c.name == active_cloud_name:
# only apply to the active cloud
logger.error(
"The azure stack profile '%s' has been deprecated and removed, using the 'latest' profile instead.\n"
"To continue using Azure Stack, please install the Azure CLI `2.66.*` (LTS) version. For more details, refer to: https://learn.microsoft.com/en-us/cli/azure/whats-new-overview#important-notice-for-azure-stack-hub-customers", c.profile
)
c.profile = 'latest'
else:
raise CLIError('Profile {} does not exist or is not supported.'.format(c.profile))
if not c.endpoints.has_endpoint_set('management') and \
c.endpoints.has_endpoint_set('resource_manager'):
# If management endpoint not set, use resource manager endpoint
c.endpoints.management = c.endpoints.resource_manager
clouds.append(c)
active_cloud_name = get_active_cloud_name(cli_ctx)
for c in clouds:
if c.name == active_cloud_name:
c.is_active = True
Expand Down
Loading