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
6 changes: 0 additions & 6 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@

_AZ_LOGIN_MESSAGE = "Please run 'az login' to setup account."

MANAGED_IDENTITY_ID_WARNING = (
"Passing the managed identity ID with --username is deprecated and will be removed in a future release. "
"Please use --client-id, --object-id or --resource-id instead."
)


def load_subscriptions(cli_ctx, all_clouds=False, refresh=False):
profile = Profile(cli_ctx=cli_ctx)
Expand Down Expand Up @@ -257,7 +252,6 @@ def login_with_managed_identity(self, identity_id=None, client_id=None, object_i
msi_creds = MSIAuthenticationWrapper(resource=resource, msi_res_id=resource_id)
# The old way of re-using the same --username for 3 types of ID
elif identity_id:
logger.warning(MANAGED_IDENTITY_ID_WARNING)
if is_valid_resource_id(identity_id):
msi_creds = MSIAuthenticationWrapper(resource=resource, msi_res_id=identity_id)
identity_type = MsiAccountTypes.user_assigned_resource_id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

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

register_conditional_breaking_change(tag='ManagedIdentityUsernameBreakingChange', breaking_change=AzCLIOtherChange(
'login',
'Passing the managed identity ID with --username is deprecated and will be removed in 2.73.0. '
'Use --client-id, --object-id or --resource-id instead.'))
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/profile/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ def login(cmd, username=None, password=None, tenant=None, scopes=None, allow_no_
if identity:
if in_cloud_console():
return profile.login_in_cloud_shell()
if username:
from azure.cli.core.breaking_change import print_conditional_breaking_change
print_conditional_breaking_change(cmd.cli_ctx, tag='ManagedIdentityUsernameBreakingChange')
return profile.login_with_managed_identity(
identity_id=username, client_id=client_id, object_id=object_id, resource_id=resource_id,
allow_no_subscriptions=allow_no_subscriptions)
Expand Down
Loading