Skip to content

az monitor action-group create requires --tags with whitespace to be surrounded by single quotes unlike other commands #29117

@r300mrg

Description

@r300mrg

Describe the bug

The command "az monitor action-group create requires" requires the --tags Name to be surrounded by single quotes (double quotes do not work), however other Azure CLI commands do not need single quotes and double quotes work.

This then creates inconsistencies in code when using Azure CLI commands. If single quotes are added to the other non-required Azure CLI commands, the single quotes are populated within the Name of the Tag.

Related command

This commands fails with the error below:

az monitor action-group create
--subscription "$SUBSCRIPTION_ID"
--resource-group "$RESOURCE_GROUP"
--action-group-name "$GROUP_NAME"
--group-short-name "$GROUP_SHORT_NAME"
--location "Global"
--tags "Technical Owner"="$TAG_TECH_OWNER" "Environment"="$TAG_ENV"

This amended command works with the single quotes surrounding the tag.:

az monitor action-group create
--subscription "$SUBSCRIPTION_ID"
--resource-group "$RESOURCE_GROUP"
--action-group-name "$GROUP_NAME"
--group-short-name "$GROUP_SHORT_NAME"
--location "Global"
--tags "'Technical Owner'"="$TAG_TECH_OWNER" "Environment"="$TAG_ENV"

However, other Azure CLI commands do not have this issue and do not require single quotes to be included:
e.g.
az monitor scheduled-query create \


--tags "Technical Owner"="$TAG_TECH_OWNER"
or
az functionapp create \


--tags "Technical Owner"="$TAG_TECH_OWNER"

Errors

Creating/Updating Action Group:
ERROR: Failed to parse '--tags' argument: Shorthand Syntax Error: Please wrap whitespace character in single quotes:
Technical
^

Issue script & Debug output

Creating/Updating Action Group:
ERROR: Failed to parse '--tags' argument: Shorthand Syntax Error: Please wrap whitespace character in single quotes:
Technical
^

Expected behavior

Consistency across Azure CLI commands and double quotes to work without the need for single quotes.

Environment Summary

azure-cli 2.61.0

core 2.61.0
telemetry 1.1.0

Extensions:
azure-devops 1.0.1

Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/opt/az/azcliextensions'

Python (Linux) 3.11.8 (main, May 16 2024, 03:47:28) [GCC 11.4.0]

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamFunctionsaz functionappMonitoraz monitoract-observability-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-triageThis issue needs the team to triage.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