In this Azure PowerShell article, we will discuss the syntax and usage of the Set-AzDefault Azure PowerShell command with examples of how to use the Set-AzDefault PowerShell command.
Table of Contents
Set-AzDefault
This is a very good PowerShell command that can help you to add or edit or set a default to your current Azure Context.
Syntax
Below is the syntax of the Set-AzDefault PowerShell command.
Set-AzDefault
[-ResourceGroupName <String>]Well, let’s discuss an example of how to use the Set-AzDefault PowerShell command with an example.
Example
You can execute the below Azure PowerShell command that can set the MyrsgGroup as the default Resource Group for you.
Set-AzDefault -ResourceGroupName newresgroupAfter executing the above Azure PowerShell command, I got the below output.
PS C:\WINDOWS\system32> Set-AzDefault -ResourceGroupName newresgroup
Id : /subscriptions/1cdf4300-dee5-4518-8c8c-feaa72a5ckl1/resourceGroups/newres
group
Name : newresgroup
Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupPropert
ies
Location : centralus
ManagedBy :
Tags : You can see the same output below

Set-AzDefault – Video Tutorial
You can use the Clear-AzDefault PowerShell command to clear the default set by the user.
You may also like following the articles below
Wrapping Up
In this Azure PowerShell article, we discussed the syntax and usage of the Set-AzDefault PowerShell command with an example. Thanks for showing interest in reading this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
