Skip to content

Commit 75b7dca

Browse files
committed
Update warning message
1 parent 9ac13c8 commit 75b7dca

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/azure-cli/azure/cli/command_modules/role/_help.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
type: command
2424
short-summary: Create an application.
2525
long-summary: >-
26-
IMPORTANT: The "az ad app create" command can modify an existing application or service principal if
26+
WARNING: The "az ad app create" command can modify an existing application if
2727
another object shares the same display name. Display names aren't unique and can change, which
28-
could result in credential loss or incorrect RBAC assignments. Use a unique object ID or app ID instead.
28+
could result in credential loss or incorrect RBAC assignments.
2929
For more details, see https://go.microsoft.com/fwlink/?linkid=2342455.
3030
3131
32-
For more detailed documentation, see https://learn.microsoft.com/graph/api/resources/application
32+
For more detailed documentation on Microsoft Entra application, see https://learn.microsoft.com/graph/api/resources/application
3333
examples:
3434
- name: Create an application.
3535
text: |
@@ -515,7 +515,6 @@
515515
helps['ad sp create'] = """
516516
type: command
517517
short-summary: Create a service principal.
518-
long-summary:
519518
examples:
520519
- name: Create a service principal. (autogenerated)
521520
text: az ad sp create --id 00000000-0000-0000-0000-000000000000
@@ -528,9 +527,9 @@
528527
Create an application and its associated service principal, optionally configure the service principal's
529528
RBAC role assignments.
530529
long-summary: >-
531-
IMPORTANT: The "az ad sp create-for-rbac" command can modify an existing application or service principal if
530+
WARNING: The "az ad sp create-for-rbac" command can modify an existing application or service principal if
532531
another object shares the same display name. Display names aren't unique and can change, which
533-
could result in credential loss or incorrect RBAC assignments. Use a unique object ID or app ID instead.
532+
could result in credential loss or incorrect RBAC assignments.
534533
For more details, see https://go.microsoft.com/fwlink/?linkid=2342455.
535534
536535

src/azure-cli/azure/cli/command_modules/role/custom.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -615,14 +615,11 @@ def create_application(cmd, client, display_name, identifier_uris=None,
615615
raise CLIError("More than one application have the same display name '{}': (id) {}, please remove "
616616
'them first.'.format(display_name, ', '.join([x[ID] for x in existing_apps])))
617617
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, "
618+
logger.warning("Found an existing application instance: (id) %s.", existing_apps[0][ID])
619+
logger.warning("Please notice that display names aren't unique, "
621620
"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)
624-
logger.warning("Found an existing application instance: (id) %s. We will patch it.",
625-
existing_apps[0][ID])
621+
"To create a new application, use a unique display name instead. For more details, "
622+
"see https://go.microsoft.com/fwlink/?linkid=2342455.")
626623
body = update_application(
627624
existing_apps[0], display_name=display_name, identifier_uris=identifier_uris,
628625
is_fallback_public_client=is_fallback_public_client,

0 commit comments

Comments
 (0)