Azure / Azure/azure-cli

az tag command doesn't support space in tag value or name in Azure cli Windows editon.

Open
#28,861 3 comments 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM Auto-Assign customer-reported question Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

Based on below doc, it should work:
https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources-cli#handling-spaces

Validated it's working for Linux Azure cli but not for Windows Azure cli:

![image](https://github.com/Azure/azure-cli/assets/73254634/16df4bad-4237-429c-a06b-de1aa54364ed)

### Related command

az tag update

### Errors

(InvalidTagName) The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.
Code: InvalidTagName
Message: The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.

### Issue script & Debug output

cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidTagName","message":"The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value."}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 664, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 701, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 334, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 4112, in update_tag_at_scope
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py", line 12859, in begin_update_at_scope
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py", line 12723, in _update_at_scope_initial
azure.core.exceptions.HttpResponseError: (InvalidTagName) The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.
Code: InvalidTagName
Message: The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.

cli.azure.cli.core.azclierror: (InvalidTagName) The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.
Code: InvalidTagName
Message: The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.
az_command_data_logger: (InvalidTagName) The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.
Code: InvalidTagName
Message: The tag name must be non-null, non-empty and non-whitespace only. Please provide an actual value.
cli.knack.cli: Event: Cli.PostExecute []

### Expected behavior

same as Linux Azure cli

### Environment Summary

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

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.