Azure / Azure/azure-cli

UnrecognizedArgumentError in Azure Cloud Shell while parsing wildcard argument

Open
#16,879 5 comments 1 reaction 0 assignees View on GitHub
act-codegen-extensibility-squad Cloud Shell Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**

Providing wildcard character as argument throws a strange error in Azure Cloud Shell (both powershell and bash shells).
This only happens in Cloud Shell. I'm not sure which CLI version introduced this regression, but we had a customer report this error recently in [this github issue](https://github.com/Azure/AppConfiguration/issues/48#issuecomment-776157045).

**To Reproduce**

`az appconfig kv list -n test-appconfig-00 --key *`
UnrecognizedArgumentError: unrecognized arguments: test.json
Try this: 'az appconfig kv list --label --name '
Still stuck? Run 'az --help' to view all commands or go to 'https://aka.ms/cli_ref' to learn more

**Commands that still parse wildcard as expected:**

`az appconfig kv list -n test-appconfig-00 --key *abc`
[]

`az appconfig kv list -n test-appconfig-00 --key abc*`
[]

**Workaround for parsing wildcard:**

`az appconfig kv list -n test-appconfig-00 --key "*"`
[]

**Expected behavior**

Many AppConfig commands accept wildcard characters as input arguments. Parsing `*` without quotes should not throw any error.

**Environment summary**

`az --version`
azure-cli 2.18.0 *

core 2.18.0 *
telemetry 1.0.6

Extensions:
ai-examples 0.2.5
azure-cli-ml 1.20.0

Python location '/opt/az/bin/python3'
Extensions directory '/home/avani/.azure/cliextensions'
Extensions system directory '/opt/az/lib/python3.6/site-packages/azure-cli-extensions'

Python (Linux) 3.6.10 (default, Jan 15 2021, 09:54:35)
[GCC 8.3.0]

**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.