LinuxCommandLibrary

az-config

Manage Azure App Configuration resources

TLDR

Print all configurations

$ az config get
copy

Print configurations for a specific section
$ az config get [section_name]
copy

Set a configuration
$ az config set [configuration_name]=[value]
copy

Unset a configuration
$ az config unset [configuration_name]
copy

SYNOPSIS

az config {show | set | get | unset | param-group} [options]

PARAMETERS

show
    Displays the entire active Azure CLI configuration, showing settings from all loaded scopes (global, local, environment variables).

set <key>=<value> [<key>=<value> ...]
    Sets one or more configuration properties. For example, az config set core.output=jsonc. This command can be used to define defaults for output format, subscription, and more.

get [<key> [<key> ...]]
    Retrieves the value of one or more specified configuration properties. If no <key> is provided, it displays all currently set values. Example: az config get core.output.

unset <key> [<key> ...]
    Removes one or more configuration properties from the active configuration. Example: az config unset core.output. Unsetting a local value will revert to the global or system default if one exists.

param-group {command} [options]
    Manages parameter groups for CLI commands. This advanced feature allows users to define groups of parameters to be automatically applied to specific Azure CLI commands.

--local
    Applies the configuration change to the local project scope, saving it in a .azure/config file within the current working directory. These settings take precedence over global settings for commands run in that directory.

--help, -h
    Displays help information for the az config command or its subcommands.

DESCRIPTION

The az config command is an essential component of the Azure Command-Line Interface (CLI), a powerful, cross-platform tool used for managing Azure resources. While not a standalone Linux executable, it serves as a crucial subcommand within the Azure CLI. Its primary purpose is to allow users to efficiently view, set, retrieve, and delete configuration settings that control the behavior of the Azure CLI itself. These configurable aspects include, but are not limited to, default output formats, preferred Azure subscriptions, default resource locations, logging verbosity, and confirmation prompts for destructive actions. By leveraging az config, users can personalize their CLI experience, streamline their workflows, and reduce the need to repeatedly specify common parameters in their Azure commands, thereby enhancing productivity and consistency across their cloud operations. It centralizes the management of both global and project-specific CLI configurations.

CAVEATS

The az config command is a subcommand of the Azure CLI (az), meaning it must be invoked through az config and requires the Azure CLI to be installed on your system. It is not a standalone Linux executable. Configuration settings are loaded hierarchically, with command-line parameters always taking precedence over configured defaults. Sensitive information, such as credentials, should generally not be stored directly in plain text configuration files; use secure methods like environment variables or Azure Key Vault for such data.

CONFIGURATION HIERARCHY

Azure CLI loads configuration settings from multiple locations in a specific order of precedence. Settings from later sources override earlier ones:
1. Global configuration file (e.g., ~/.azure/config on Linux/macOS, %USERPROFILE%\az.azure\config on Windows)
2. Local configuration file (.azure/config in the current working directory)
3. Environment variables (e.g., AZURE_CORE_OUTPUT)
4. Command-line parameters
For example, a setting in a local configuration file will override the same setting defined in the global file.

COMMON CONFIGURATION KEYS

Some frequently utilized configuration keys that can be managed with az config include:
core.output: Specifies the default output format (e.g., json, jsonc, table, tsv, yaml, none).
core.no_confirm: A boolean flag; if True, it disables confirmation prompts for destructive operations.
core.subscription: Sets the default Azure subscription ID or name to be used for commands.
core.cloud: Defines the default Azure cloud instance (e.g., AzureCloud, AzureUSGovernment).
logging.level: Controls the verbosity of logging (e.g., info, debug, warning, error).
telemetry.enable_telemetry: A boolean flag that controls whether usage data is sent to Microsoft (default is True).

HISTORY

The Azure Command-Line Interface was initially released in 2016. The az config command has been a fundamental part of the Azure CLI since its early versions, providing users with essential capabilities to customize their command-line environment for Azure. Over time, it has evolved to incorporate features such as local configuration scoping and the management of parameter groups, continually enhancing the flexibility and user-friendliness of the Azure CLI experience.

SEE ALSO

az(1), az account(1), az group(1)

Copied to clipboard