diff --git a/src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py b/src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py index 994f420fef0..98c44c11d39 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py +++ b/src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py @@ -4127,21 +4127,6 @@ def process_add_role_assignment_for_vnet_subnet(self, mc: ManagedCluster) -> Non service_principal_profile = mc.service_principal_profile assign_identity = self.context.get_assign_identity() if service_principal_profile is None and not assign_identity: - msg = ( - "It is highly recommended to use USER assigned identity " - "(option --assign-identity) when you want to bring your own" - "subnet, which will have no latency for the role assignment to " - "take effect. When using SYSTEM assigned identity, " - "azure-cli will grant Network Contributor role to the " - "system assigned identity after the cluster is created, and " - "the role assignment will take some time to take effect, see " - "https://docs.microsoft.com/azure/aks/use-managed-identity, " - "proceed to create cluster with system assigned identity?" - ) - if not self.context.get_yes() and not prompt_y_n( - msg, default="n" - ): - raise DecoratorEarlyExitException() need_post_creation_vnet_permission_granting = True else: scope = vnet_subnet_id diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py index 534bd4400ba..8588aa6269d 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py @@ -4356,16 +4356,11 @@ def test_process_add_role_assignment_for_vnet_subnet(self): with patch( "azure.cli.command_modules.acs.managed_cluster_decorator.subnet_role_assignment_exists", return_value=False, - ), patch( - "azure.cli.command_modules.acs.managed_cluster_decorator.prompt_y_n", - return_value=False, ): - # fail on user does not confirm - with self.assertRaises(DecoratorEarlyExitException): - dec_3.process_add_role_assignment_for_vnet_subnet(mc_3) + dec_3.process_add_role_assignment_for_vnet_subnet(mc_3) self.assertEqual( dec_3.context.get_intermediate("need_post_creation_vnet_permission_granting"), - None, + True, ) # custom value