'InvalidArgumentValue' on az portal dashboard delete #8491
Labels
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Portal
Service Attention
This issue is responsible by Azure service team.
Describe the bug
I've got az extension "portal" in version 1.0.0b1, and when running 'az portal dashboard delete' I've got an error suggesting dashboard name does not meet the requirements, which is matching regex '^[a-zA-Z0-9-]{3,24}$'. Dashboard name has indeed more that 24 characters, but according to the documentation: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftportal it can have up to 160 characters
Related command
az portal dashboard delete --name "laas-availability-drilldown" --resource-group rg-itp-us-pre25 -y
Errors
InvalidArgumentValue: -n: Invalid format: 'laas-availability-drilldown' does not fully match regular expression pattern '^[a-zA-Z0-9-]{3,24}$'
Issue script & Debug output
eardanow@eardanow-u22:~/laas.gaia$ az portal dashboard delete --name "laas-availability-drilldown" --resource-group rg-itp-us-pre25 -y --debug
cli.knack.cli: Command arguments: ['portal', 'dashboard', 'delete', '--name', 'laas-availability-drilldown', '--resource-group', 'rg-itp-us-pre25', '-y', '--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 0x7f58fc67b740>, <function OutputProducer.on_global_arguments at 0x7f58fc3c2700>, <function CLIQuery.on_global_arguments at 0x7f58fc407c40>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'portal': ['azext_portal']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: portal 0.319 2 6 /home/eardanow/.azure/cliextensions/portal
cli.azure.cli.core: Total (1) 0.319 2 6
cli.azure.cli.core: Loaded 2 groups, 6 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : portal dashboard delete
cli.azure.cli.core: Command table: portal dashboard delete
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f58fb622de0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/eardanow/.azure/commands/2025-02-19.12-25-45.portal_dashboard_delete.341751.log'.
az_command_data_logger: command args: portal dashboard delete --name {} --resource-group {} -y --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f58fb663d80>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f58fb696160>, <function register_cache_arguments..add_cache_arguments at 0x7f58fb6962a0>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x7f58fb696340>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f58fc3c27a0>, <function CLIQuery.handle_query_parameter at 0x7f58fc407ce0>, <function register_ids_argument..parse_ids_arguments at 0x7f58fb696200>]
az_command_data_logger: extension name: portal
az_command_data_logger: extension version: 1.0.0b1
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_command_ctx.py", line 53, in format_args
self.args._schema._fmt(ctx=self, value=self.args)
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_arg_fmt.py", line 402, in call
raise err from err
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_arg_fmt.py", line 399, in call
value[field_name] = field_schema._fmt(ctx, value[field_name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_arg_fmt.py", line 56, in call
raise AAZInvalidArgValueError(
azure.cli.core.aaz.exceptions.AAZInvalidArgValueError: InvalidArgumentValue: -n: Invalid format: 'laas-availability-drilldown' does not fully match regular expression pattern '^[a-zA-Z0-9-]{3,24}$'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_command.py", line 155, in call
return self._handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eardanow/.azure/cliextensions/portal/azext_portal/aaz/latest/portal/dashboard/_delete.py", line 33, in _handler
super()._handler(command_args)
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_command.py", line 165, in _handler
self.ctx.format_args()
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_command_ctx.py", line 55, in format_args
raise InvalidArgumentValueError(str(err))
azure.cli.core.azclierror.InvalidArgumentValueError: InvalidArgumentValue: -n: Invalid format: 'laas-availability-drilldown' does not fully match regular expression pattern '^[a-zA-Z0-9-]{3,24}$'
cli.azure.cli.core.azclierror: InvalidArgumentValue: -n: Invalid format: 'laas-availability-drilldown' does not fully match regular expression pattern '^[a-zA-Z0-9-]{3,24}$'
az_command_data_logger: InvalidArgumentValue: -n: Invalid format: 'laas-availability-drilldown' does not fully match regular expression pattern '^[a-zA-Z0-9-]{3,24}$'
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f58fb623060>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 0.806 seconds (init: 0.390, invoke: 0.417)
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 4017 in cache file under /home/eardanow/.azure/telemetry/20250219122545855
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.12/site-packages/azure/cli/telemetry/init.py /home/eardanow/.azure /home/eardanow/.azure/telemetry/20250219122545855"
telemetry.process: Return from creating process 341756
telemetry.main: Finish creating telemetry upload process.
eardanow@eardanow-u22:~/laas.gaia$
Expected behavior
Command should delete the dashboard
Environment Summary
azure-cli 2.67.0 *
core 2.67.0 *
telemetry 1.1.0
Extensions:
portal 1.0.0b1
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Additional context
The problem does not occurs for az extension 'portal' version 0.1.3
Behavior is inconsistent with documentation: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftportal
The text was updated successfully, but these errors were encountered: