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 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.

Clear-AzContext

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

Clear-AzContext syntax

You may also like following the below articles

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 !!!