You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/azure-cli-core/azure/cli/core/cloud.py
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -583,6 +583,7 @@ def get_clouds(cli_ctx):
583
583
exceptconfigparser.MissingSectionHeaderError:
584
584
os.remove(CLOUD_CONFIG_FILE)
585
585
logger.warning("'%s' is in bad format and has been removed.", CLOUD_CONFIG_FILE)
586
+
active_cloud_name=get_active_cloud_name(cli_ctx)
586
587
forsectioninconfig.sections():
587
588
c=Cloud(section)
588
589
foroptioninconfig.options(section):
@@ -602,19 +603,20 @@ def get_clouds(cli_ctx):
602
603
"2019-03-01-hybrid",
603
604
"2020-09-01-hybrid",
604
605
):
605
-
logger.error(
606
-
"The azure stack profile '%s' has been deprecated and removed, using the 'latest' profile instead.\n"
607
-
"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
608
-
)
609
-
c.profile='latest'
606
+
ifc.name==active_cloud_name:
607
+
# only apply to the active cloud
608
+
logger.error(
609
+
"The azure stack profile '%s' has been deprecated and removed, using the 'latest' profile instead.\n"
610
+
"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
611
+
)
612
+
c.profile='latest'
610
613
else:
611
614
raiseCLIError('Profile {} does not exist or is not supported.'.format(c.profile))
612
615
ifnotc.endpoints.has_endpoint_set('management') and \
613
616
c.endpoints.has_endpoint_set('resource_manager'):
614
617
# If management endpoint not set, use resource manager endpoint
0 commit comments