Skip to content

Azure CLI is unable to query resource groups with dashes in their resource group name #19991

@michaelelleby

Description

@michaelelleby

Describe the bug

Unable to query for resource groups with dashes in their name. This is required to check the existence of a resource group. az group show --resource-group kubernetes-cluster would return an error if the resource group does not exist, making it difficult to determine if the error was due to the resource group not existing or some other error.

To Reproduce:

$ az group list --query [?name=="kubernetes-cluster"]
argument --query: invalid jmespath_type value: '[?name==kubernetes-cluster]'
To learn more about --query, please visit: 'https://docs.microsoft.com/cli/azure/query-azure-cli'

Expected Behavior

A list containing one element, which is the resource group named "kubernetes-cluster" or 0 elements if no such group exists.

Environment Summary

Windows-10-10.0.17763-SP0
Python 3.8.9
Installer: 

azure-cli 2.29.1

Extensions:
aks-preview 0.5.32
front-door 1.0.16

## Additional Context
<!--- Add any other context about the problem here. --->

Metadata

Metadata

Assignees

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions