Azure / Azure/azure-cli

Deployment hangs with parameter containing `/*`

Open
#27,518 1 comment 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM Auto-Assign Azure CLI Team potential-pruning question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

The following command appears to hang before attempting to submit a deployment to Azure:
```sh
az deployment group create --template-file main.json --resource-group ant-test --parameters clientKey="q8/*&(fi"
```

It can be repro'd with the following contents of `main.json`:
```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clientKey": {
"type": "string"
}
},
"resources": [],
"outputs": {}
}
```

### Related command

`az deployment group create`

### Errors

N/A

### Issue script & Debug output

```
az deployment group create --template-file /Users/ant/Desktop/issue12032/main.json --resource-group ant-test --parameters clientKey="q8/*&(fi" --debug --verbose
cli.knack.cli: Command arguments: ['deployment', 'group', 'create', '--template-file', '/Users/ant/Desktop/issue12032/main.json', '--resource-group', 'ant-test', '--parameters', 'clientKey=q8/*&(fi', '--debug', '--verbose']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'deployment': ['azure.cli.command_modules.resource']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: resource 0.095 51 227
cli.azure.cli.core: Total (1) 0.095 51 227
cli.azure.cli.core: Loaded 51 groups, 227 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : deployment group create
cli.azure.cli.core: Command table: deployment group create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/ant/.azure/commands/2023-10-03.19-20-11.deployment_group_create.88921.log'.
az_command_data_logger: command args: deployment group create --template-file {} --resource-group {} --parameters {} --debug --verbose
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x101cf76d0>]
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/core/profiles/_shared.py", line 655, in _get_attr
op = getattr(op, part)
AttributeError: module 'azure.mgmt.resource.resources.v2022_09_01.models' has no attribute 'ExemptionCategory'

cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x101e012d0>, .add_cache_arguments at 0x101e013f0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x101e01360>]
cli.azure.cli.core.util: attempting to read file /Users/ant/Desktop/issue12032/main.json as utf-8-sig
```

### Expected behavior

The deployment is submitted to Azure and runs successfully.

### Environment Summary

```
azure-cli 2.53.0

core 2.53.0
telemetry 1.1.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/bin/python'
Extensions directory '/Users/ant/.azure/cliextensions'

Python (Darwin) 3.10.13 (main, Aug 24 2023, 22:36:46) [Clang 14.0.3 (clang-1403.0.22.14.1)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.
```

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