Frequently asked questions about Azure PowerShell

What is Azure PowerShell?

Azure PowerShell is a set of cmdlets that allows you to manage Azure resources directly with PowerShell. In December 2018, the Az PowerShell module became generally available. It's now the recommended PowerShell module for interacting with Azure. To learn more about the Az PowerShell module, see Introducing the Az PowerShell module.

How do I disable breaking change warning messages in Azure PowerShell?

To suppress the breaking change warning messages in Azure PowerShell, you'll need to set the environment variable SuppressAzurePowerShellBreakingChangeWarnings to true.

Set-Item -Path Env:\SuppressAzurePowerShellBreakingChangeWarnings -Value $true

How do I disable the AzureRM retirement warning message in Azure PowerShell?

To suppress the AzureRM retirement warning message in Azure PowerShell, you'll need to set the environment variable SuppressAzureRmModulesRetiringWarning to true.

Set-Item -Path Env:\SuppressAzureRmModulesRetiringWarning -Value $true

One disadvantage of the previous example is you'll need to run the command for each new PowerShell session unless you add it to your PowerShell profile.

To set the environment variable permanently, you can also use the following example.

[System.Environment]::SetEnvironmentVariable('SuppressAzureRmModulesRetiringWarning', 'true', [System.EnvironmentVariableTarget]::User)

How do I determine the max HTTP retry times in Azure PowerShell?

For general HTTP response (except response status code is 429), Azure PowerShell uses the value defined in the AZURE_PS_HTTP_MAX_RETRIES environment variable. Its minimum value is 0. If not specified, Azure PowerShell uses the SDK default value.

[System.Environment]::SetEnvironmentVariable('AZURE_PS_HTTP_MAX_RETRIES ', 3, [System.EnvironmentVariableTarget]::User)

If the HTTP response status code is 429, Azure PowerShell uses the value defined in the AZURE_PS_HTTP_MAX_RETRIES_FOR_429 environment variable. Its minimum value is 1. The total retry times of status code 429 is (AZURE_PS_HTTP_MAX_RETRIES + 1) * AZURE_PS_HTTP_MAX_RETRIES_FOR_429 - 1. If not specified, Azure PowerShell uses the SDK default value.

[System.Environment]::SetEnvironmentVariable('AZURE_PS_HTTP_MAX_RETRIES_FOR_429 ', 3, [System.EnvironmentVariableTarget]::User)