In this Azure PowerShell article, we will discuss all the syntax and usage of Clear-AzContext Azure PowerShell cmdlet with examples.
Table of Contents
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 above Azure PowerShell cmdlet, you will get the below confirmation pop-up. Click on the Yes button for confirmation of the removal process and you are done.

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

You may also like following the below articles
- Clear-AzDefault
- Get-AzContext
- Disconnect-AzAccount
- connect-azaccount
- Get-AzLocation
- Get-AzDeployment
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 !!!