Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions src/azure-cli-core/azure/cli/core/_breaking_change.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from azure.cli.core.breaking_change import AzCLIOtherChange, register_conditional_breaking_change

register_conditional_breaking_change(
tag='CloudProfilesDeprecate',
breaking_change=AzCLIOtherChange(
cmd='',
message="Starting from 2.73.0, the azure stack profiles ('2017-03-09-profile', '2018-03-01-hybrid', '2019-03-01-hybrid', '2020-09-01-hybrid') will be deprecated. Please use the 'latest' profile or the CLI 2.66.* (LTS) version instead."
)
)
7 changes: 5 additions & 2 deletions src/azure-cli-core/azure/cli/core/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,16 @@ def get_active_cloud(cli_ctx=None):
from azure.cli.core import get_default_cli
cli_ctx = get_default_cli()
try:
return get_cloud(cli_ctx, get_active_cloud_name(cli_ctx))
cloud = get_cloud(cli_ctx, get_active_cloud_name(cli_ctx))
except CloudNotRegisteredException as err:
logger.warning(err)
default_cloud_name = get_default_cloud_name()
logger.warning("Resetting active cloud to'%s'.", default_cloud_name)
_set_active_cloud(cli_ctx, default_cloud_name)
return get_cloud(cli_ctx, default_cloud_name)
cloud = get_cloud(cli_ctx, default_cloud_name)
if cloud.profile != 'latest':
logger.warning("Cloud profile '%s' will be deprecated starting from 2.73.0. Please use the 'latest' profile or the CLI 2.66.* (LTS) version instead.", cloud.profile)
return cloud


def get_cloud_subscription(cloud_name):
Expand Down