In git
, when setting username and email, the commands are
git config --global user.name "Mona Lisa"
git config --global user.email "[email protected]"
The corresponding ~/.gitconfig
:
[user]
name = Mona Lisa
email = [email protected]
az configure
currently only supports setting and listing the default
section:
> az configure -h
Command
az configure : Manage Azure CLI configuration. This command is interactive.
Arguments
--defaults -d : Space-separated 'name=value' pairs for common argument defaults.
--list-defaults -l : List all applicable defaults. Allowed values: false, true.
--scope : Scope of defaults. Using "local" for settings only effective under current
folder. Allowed values: global, local. Default: global.
For other sections described in Azure CLI configuration, users will have to manually edit the ~/.azure/config
file, like
[core]
collect_telemetry = no
no_color = yes
[logging]
enable_log_file = no
This is inconvenient. To improve the user experience, az configure
needs to ...
These can be implemented in 2 ways:
az configure [--set] ...
az configure --get ...
az configure --unset ...
az configure
is already used as a command. It is not possible to use it as a command group anymore. We need a another command group, like config
:
az config set ...
az config show ...
az config remove ...
By using config
, we can start from scratch and introduce new features without making breaking changes.
However, as Azure CLI doesn't support positional arguments, the config entry has to be prefixed by a parameter name like --name
.
Also there is a design decision for how to divide the config entry:
[section].[name]=[value]
# Use `--set` as an argument
az configure --set core.no_color=true
# or use `set` as a sub-command
az config set --name core.no_color=true
# or omit `--name` and use positional argument
az config set core.no_color=true
az configure --section core --set no_color=true
# or
az config set --section core --name no_color=true
az configure --set core.no_color --value true
# or
az config set --name core.no_color --value true
az configure --section core --set no_color --value true
# or
az config set --section core --name no_color --value true
⚠ Anyway, it is the destiny of --defaults
and --list-defaults
to be deprecated.
This will greatly simplify the configuration process and make experimental features easier to use, like
az configure --set core.no_color=true
az configure --set core.command_index=on
az configure --set logging.log_dir=D:\logs
settings.json
is the latest unwritten convention of Microsoft open source project, like Visual Studio Code and Windows Terminal.
The config file is at C:\Users\xxx\AppData\Roaming\Code\User\settings.json
:
The config file is at C:\Users\xxx\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
:
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"profiles":
[
{
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
...
],
...
}
Using settings.json
will open up more possibilities like "hover" help (controlled by editor.hover.enabled
in VSCode) using the "$schema"
property: