Get-AzConfig

Gets the configs of Azure PowerShell.

Syntax

Get-AzConfig
   [-AppliesTo <String>]
   [-Scope <ConfigScope>]
   [-DefaultProfile <IAzureContextContainer>]
   [-CheckForUpgrade]
   [-DefaultSubscriptionForLogin]
   [-DisableInstanceDiscovery]
   [-DisplayBreakingChangeWarning]
   [-DisplayRegionIdentified]
   [-DisplaySecretsWarning]
   [-DisplaySurveyMessage]
   [-EnableDataCollection]
   [-EnableErrorRecordsPersistence]
   [-EnableLoginByWam]
   [-LoginExperienceV2]
   [<CommonParameters>]

Description

Gets the configs of Azure PowerShell. By default it lists all the configs. You can filter the result using various parameters.

Note

Configs have priorities. Generally speaking, Process scope has higher priority than CurrentUser scope; a config that applies to a certain cmdlet has higher priority than that applies to a module, again higher than Az. To reduce confusion, the result of Get-AzConfig shows those configs that are taking effect. It is a combination of all the configs, but not literally all the configs. However, you could always view them by applying different filter parameters, such as -Scope.

Examples

Example 1

Get-AzConfig

Key                           Value Applies To Scope       Help Message
---                           ----- ---------- -----       ------------
EnableDataCollection          False Az         CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom…
DefaultSubscriptionForLogin         Az         Default     Subscription name or GUID. Sets the default context for Azure PowerShell when logging in with…
DisplayBreakingChangeWarning  True  Az         Default     Controls if warning messages for breaking changes are displayed or suppressed. When enabled, …

Gets all the configs.

Example 2

Get-AzConfig -EnableDataCollection

Key                           Value Applies To Scope       Help Message
---                           ----- ---------- -----       ------------
EnableDataCollection          False Az         CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom…

Gets the "EnableDataCollection" config.

Parameters

-AppliesTo

Specifies what part of Azure PowerShell the config applies to. Possible values are:

  • "Az": the config applies to all modules and cmdlets of Azure PowerShell.
  • Module name: the config applies to a certain module of Azure PowerShell. For example, "Az.Storage".
  • Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az".
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CheckForUpgrade

When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value is true.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultSubscriptionForLogin

Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableInstanceDiscovery

Set it to true to disable both instance discovery and authority validation. This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack. The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority. By setting this to true, the validation of the authority is disabled. As a result, it is crucial to ensure that the configured authority host is valid and trustworthy.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayBreakingChangeWarning

Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayRegionIdentified

When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplaySecretsWarning

When enabled, a warning message will be displayed when the cmdlet output contains secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplaySurveyMessage

When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableDataCollection

When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableErrorRecordsPersistence

When enabled, error records will be written to ~/.Azure/ErrorRecords.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableLoginByWam

[Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LoginExperienceV2

Only active when authenticating interactively, allows the user to choose the subscription and tenant used in subsequent commands. Possible values ad 'On' (Default) and 'Off'. 'On' requires user's input. 'Off' will use the first tenant and subscription returned by Azure, can change without notice and lead to command execution in an unwanted context (not recommended).

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Scope

Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser.

Type:ConfigScope
Accepted values:CurrentUser, Process, Default, Environment
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSConfig