@@ -604,6 +604,13 @@ 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 (f"The `az { cmd .name } ` 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." )
613+
607614 graph_client = _graph_client_factory (cmd .cli_ctx )
608615
609616 existing_apps = list_applications (cmd , client , display_name = display_name )
@@ -1017,10 +1024,6 @@ def app_federated_credential_delete(client, app_identifier, federated_identity_c
10171024
10181025
10191026def create_service_principal (cmd , identifier ):
1020- logger .warning ("The `az ad sp create` command can modify an existing application or service principal "
1021- "if another object shares the same display name. Display names aren't unique and can change, "
1022- "which could result in credential loss or incorrect RBAC assignments. "
1023- "Use a unique object ID or app ID instead." )
10241027 return _create_service_principal (cmd .cli_ctx , identifier )
10251028
10261029
@@ -1149,11 +1152,6 @@ def create_service_principal_for_rbac(
11491152 show_auth_in_json = None , skip_assignment = False , keyvault = None ):
11501153 import time
11511154
1152- logger .warning ("The `az ad sp create-for-rbac` command can modify an existing application or service principal "
1153- "if another object shares the same display name. Display names aren't unique and can change, "
1154- "which could result in credential loss or incorrect RBAC assignments. "
1155- "Use a unique object ID or app ID instead." )
1156-
11571155 if role and not scopes or not role and scopes :
11581156 raise ArgumentUsageError ("Usage error: To create role assignments, specify both --role and --scopes." )
11591157
0 commit comments