@@ -604,13 +604,6 @@ def create_application(cmd, client, display_name, identifier_uris=None,
604604 # JSON properties
605605 app_roles = None , optional_claims = None , required_resource_accesses = None ):
606606 # pylint:disable=too-many-locals
607-
608- logger .warning ("The `az %s` command can modify an existing application or service principal "
609- "if another object shares the same display name. Display names aren't unique and can change, "
610- "which could result in credential loss or incorrect RBAC assignments. "
611- "Use a unique object ID or app ID instead. For more details, "
612- "see https://go.microsoft.com/fwlink/?linkid=2342455." , cmd .name )
613-
614607 graph_client = _graph_client_factory (cmd .cli_ctx )
615608
616609 existing_apps = list_applications (cmd , client , display_name = display_name )
@@ -622,6 +615,12 @@ def create_application(cmd, client, display_name, identifier_uris=None,
622615 raise CLIError ("More than one application have the same display name '{}': (id) {}, please remove "
623616 'them first.' .format (display_name , ', ' .join ([x [ID ] for x in existing_apps ])))
624617 if len (existing_apps ) == 1 :
618+ logger .warning ("IMPORTANT: The \" az %s\" command can modify an existing application or service principal "
619+ "if another object shares the same display name. "
620+ "Display names aren't unique and can change, "
621+ "which could result in credential loss or incorrect RBAC assignments. "
622+ "Use a unique object ID or app ID instead. For more details, "
623+ "see https://go.microsoft.com/fwlink/?linkid=2342455." , cmd .name )
625624 logger .warning ("Found an existing application instance: (id) %s. We will patch it." ,
626625 existing_apps [0 ][ID ])
627626 body = update_application (
0 commit comments