Clear-AzContext

In this Azure PowerShell article, we will discuss all the syntax and usage of Clear-AzContext Azure PowerShell cmdlet with examples.

Clear-AzContext

Clear-AzContext is the Azure PowerShell cmdlet that can help you to delete/clear all the Azure credentials, subscription and account details, etc.

Syntax

Below is the syntax of the Clear-AzContext Azure PowerShell cmdlet.

Clear-AzContext

Example

Execute the below Azure PowerShell cmdlet that can help you to delete/clear all the Azure credentials, subscription and account details, etc for any PowerShell session.

Clear-AzContext -Scope CurrentUser

After executing the Azure PowerShell cmdlet, you will get the confirmation pop-up below. You are done by clicking the Yes button to confirm the removal process.

Clear-AzContext

When you try executing any Azure PowerShell cmdlet, it will ask you to run Connect-AzAccount to log in.

clear azcontext

You may also like following the articles below

Conclusion

In this Azure PowerShell article, we discussed the syntax and usage of Clear-AzContext Azure PowerShell cmdlet with examples. Thanks for reading this quick article !!!