Skip to content

Commit 8a28faf

Browse files
committed
Remove markdown style tokens. Make warning only appear when the command is overwriting an existing SP
1 parent 23fd0c0 commit 8a28faf

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
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
27-
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.
26+
IMPORTANT: The "az ad app create" command can modify an existing application or service principal if
27+
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.
2929
For more details, see https://go.microsoft.com/fwlink/?linkid=2342455.
3030
3131
@@ -528,9 +528,9 @@
528528
Create an application and its associated service principal, optionally configure the service principal's
529529
RBAC role assignments.
530530
long-summary: >-
531-
**IMPORTANT**: The `az ad sp create-for-rbac` command can modify an existing application or service principal if
532-
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.
531+
IMPORTANT: The "az ad sp create-for-rbac" command can modify an existing application or service principal if
532+
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.
534534
For more details, see https://go.microsoft.com/fwlink/?linkid=2342455.
535535
536536

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)