Azure / Azure/azure-cli

Allow passing of command line arguments via file

Open
#17,543 1 comment 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-platform-engineering-squad Core feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Is your feature request related to a problem? Please describe.**

We rely on AZ CLI to maintain our service infra. One of the things that we do is configure Web Access Firewall rules to allow access to endpoints only to certain IP address ranges. Unfortunately, the list of IP address ranges is too long and we're running into a problem with command line length (at least on Windows). I.e., when fully constructed, `az cdn waf policy custom-rule set` command line results in "The command line is too long" error message, not an actual functionality being performed.

**Describe the solution you'd like**

That'd be great if we could pass command line args via file instead of listing them all in the command line.

For example, 7-zip allows using @listfile when it comes to passing a list of files:

```
Usage: 7z [...] [...] [@listfile]
[...]

-ai[r[-|0]]{@listfile|!wildcard} : Include archives
-ax[r[-|0]]{@listfile|!wildcard} : eXclude archives
```

Given that AZ CLI has a diverse set of commands, I'd go with something like `az @argfile` to avoid figuring out which specific commands must be updated to allow passing a file instead of a list of args.

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.