When you run a ESXCLI host management command, authentication happens in order of precedence.

The order of precedence is described in the following table. This order of precedence always applies. That means, for example, that you cannot override an environment variable setting in a configuration file.

If you are authenticating through vCenter Single Sign-On, the order of precedence is preserved. For example, information you specify on the command line overrides information in an environment variable.

Authentication Description See
Command line Password (--password), session file (--sessionfile), or configuration file (--config) specified on the command line. vSphere SDK for Perl Programming Guide
Environment variable Password specified in an environment variable. Using Environment Variables
Configuration file Password specified in a configuration file. Using a Configuration File
Current account (Active Directory) Current account information used to establish an SSPI connection. Available only on Windows. Using the Microsoft Windows Security Support Provider Interface
Credential store Password retrieved from the credential store. vSphere Web Services SDK Programming Guide and vSphere SDK for Perl Programming Guide
Prompt the user for a password Password is not echoed to screen.