Skip to content

Value error on "az ad sp create-for-rbac" #32832

@azgabur

Description

@azgabur

Describe the bug

On running az ad sp create-for-rbac --name "name" I get following crash.

Related command

az ad sp create-for-rbac

Errors

The command failed with an unexpected error. Here is the traceback:
badly formed help string
Traceback (most recent call last):
File "/usr/lib/python3.14/argparse.py", line 1744, in _check_help
formatter._expand_help(action)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 672, in _expand_help
return help_string % params
~~~~~~~~~~~~^~~~~~~~
ValueError: unsupported format character 'Y' (0x59) at index 77

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/azure-cli/lib/python3.14/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/commands/init.py", line 570, in execute
self.parser.load_command_table(self.commands_loader)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/parser.py", line 129, in load_command_table
param = AzCliCommandParser._add_argument(command_parser, arg)
File "/opt/azure-cli/lib/python3.14/site-packages/knack/parser.py", line 64, in _add_argument
return obj.add_argument(*scrubbed_options_list, **argparse_options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1558, in add_argument
self._check_help(action)
~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1746, in _check_help
raise ValueError('badly formed help string') from exc
ValueError: badly formed help string

Issue script & Debug output

cli.knack.cli: Command arguments: ['ad', 'sp', 'create-for-rbac', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f1364a8d380>, <function OutputProducer.on_global_arguments at 0x7f13649a7530>, <function CLIQuery.on_global_arguments at 0x7f13649e9dd0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'ad': ['azure.cli.command_modules.role']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: role 0.007 17 62
cli.azure.cli.core: Total (1) 0.007 17 62
cli.azure.cli.core: Loaded 17 groups, 62 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : ad sp create-for-rbac
cli.azure.cli.core: Command table: ad sp create
cli.azure.cli.core: remaining : for-rbac
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f13639a7ed0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/azgabur/.azure/commands/2026-02-23.16-19-17.ad_sp_create-for-rbac.299119.log'.
az_command_data_logger: command args: ad sp create-for-rbac --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f13637d16f0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f13637f8bf0>, <function register_cache_arguments..add_cache_arguments at 0x7f1363811170>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x7f1363811220>]
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/lib/python3.14/argparse.py", line 1744, in _check_help
formatter._expand_help(action)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 672, in _expand_help
return help_string % params
~~~~~~~~~~~~^~~~~~~~
ValueError: unsupported format character 'Y' (0x59) at index 77

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/azure-cli/lib/python3.14/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/commands/init.py", line 570, in execute
self.parser.load_command_table(self.commands_loader)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/parser.py", line 129, in load_command_table
param = AzCliCommandParser._add_argument(command_parser, arg)
File "/opt/azure-cli/lib/python3.14/site-packages/knack/parser.py", line 64, in _add_argument
return obj.add_argument(*scrubbed_options_list, **argparse_options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1558, in add_argument
self._check_help(action)
~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1746, in _check_help
raise ValueError('badly formed help string') from exc
ValueError: badly formed help string

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: badly formed help string
Traceback (most recent call last):
File "/usr/lib/python3.14/argparse.py", line 1744, in _check_help
formatter._expand_help(action)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 672, in _expand_help
return help_string % params
~~~~~~~~~~~~^~~~~~~~
ValueError: unsupported format character 'Y' (0x59) at index 77

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/azure-cli/lib/python3.14/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/commands/init.py", line 570, in execute
self.parser.load_command_table(self.commands_loader)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/parser.py", line 129, in load_command_table
param = AzCliCommandParser._add_argument(command_parser, arg)
File "/opt/azure-cli/lib/python3.14/site-packages/knack/parser.py", line 64, in _add_argument
return obj.add_argument(*scrubbed_options_list, **argparse_options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1558, in add_argument
self._check_help(action)
~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1746, in _check_help
raise ValueError('badly formed help string') from exc
ValueError: badly formed help string
az_command_data_logger: badly formed help string
Traceback (most recent call last):
File "/usr/lib/python3.14/argparse.py", line 1744, in _check_help
formatter._expand_help(action)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 672, in _expand_help
return help_string % params
~~~~~~~~~~~~^~~~~~~~
ValueError: unsupported format character 'Y' (0x59) at index 77

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/azure-cli/lib/python3.14/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/commands/init.py", line 570, in execute
self.parser.load_command_table(self.commands_loader)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/opt/azure-cli/lib/python3.14/site-packages/azure/cli/core/parser.py", line 129, in load_command_table
param = AzCliCommandParser._add_argument(command_parser, arg)
File "/opt/azure-cli/lib/python3.14/site-packages/knack/parser.py", line 64, in _add_argument
return obj.add_argument(*scrubbed_options_list, **argparse_options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1558, in add_argument
self._check_help(action)
~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.14/argparse.py", line 1746, in _check_help
raise ValueError('badly formed help string') from exc
ValueError: badly formed help string
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f13639a8250>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 0.545 seconds (init: 0.252, invoke: 0.294)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 8019 in cache file under /home/azgabur/.azure/telemetry/20260223161918162
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/azure-cli/bin/python /opt/azure-cli/lib/python3.14/site-packages/azure/cli/telemetry/init.py /home/azgabur/.azure /home/azgabur/.azure/telemetry/20260223161918162"
telemetry.process: Return from creating process 299144
telemetry.main: Finish creating telemetry upload process.

Expected behavior

To not crash

Environment Summary

{
"azure-cli": "2.83.0",
"azure-cli-core": "2.83.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {}
}

Python 3.14.3

DISTRIB_ID="Arch"
DISTRIB_RELEASE="rolling"
DISTRIB_DESCRIPTION="Arch Linux"

Additional context

I tried installing azure-cli via system package manager and pipx, both resulting in same errors.

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamGraphaz adHelp Commandcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions