Azure / Azure/azure-cli

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

Open
#19,991 2 comments 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM customer-reported feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## 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

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.