-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{Misc.} az --version
: Show config directory location
#30662
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
@@ -410,6 +411,7 @@ def _get_version_string(name, version_dict): | |||
_print() | |||
|
|||
_print("Python location '{}'".format(os.path.abspath(sys.executable))) | |||
_print("Config directory '{}'".format(get_config_dir())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling get_config_dir()
is the official way of retrieving Azure CLI's config dir. azure.cli.core.auth.identity.Identity
also uses it:
config_dir = get_config_dir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to get config dir is from azure.cli.core.AzCli.config.config_dir
, but this requires a AzCli
instance which may not always be available.
Related command
az --version
Description
Show the config directory location actually used by Azure CLI in the output of
az --version
.The default config directory is
$HOME/.azure
and can be overridden withAZURE_CONFIG_DIR
: https://learn.microsoft.com/en-us/cli/azure/azure-cli-configuration#cli-configuration-fileCurrently, it is not very convenient to get the config directory location: actions/runner-images#11173 (comment). It is only shown in the
--debug
log.Testing Guide