Share via

Help in creating Resource group using powershell

David 40 Reputation points
2026-03-14T11:44:55.0333333+00:00

I have all the required permissions to create Resource group
Thanks in advance

Azure Advisor
Azure Advisor

An Azure personalized recommendation engine that helps users follow best practices to optimize Azure deployments.

0 comments No comments

Answer accepted by question author
  1. Naveena Patlolla 9,565 Reputation points Microsoft External Staff Moderator
    2026-03-14T11:51:35.4+00:00

    Hi David
    Make sure that the subscription you are using has the necessary permissions to create resource groups.

    Please follow the below steps to create a resource group using PowerShell

    1)Login to Azure PowerShell

    Connect-AzAccount
    

    2)Get all subscriptions

    Get-AzSubscription
    

    3)Set your subscription

    Set-AzContext -SubscriptionId xxxxxxx
    

    4)Try creating the resource group again

    New-AzResourceGroup -Name AzureRG -Location WestUS
    

    I tested this in my test environment, and it worked. Below is the output screenshot. User's image

    Please refer the below documents

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-powershell

    https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroup?view=azps-13.3.0

    https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/create-sql-vm-powershell?view=azuresql#create-a-resource-group

    Let us know if you have any further queries. I’m happy to assist you further.

    Provide your valuable Comments.

    Please do not forget to "Accept the answer” and “upvote it” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-14T11:45:05.8133333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Use Azure PowerShell and the Az.Resources module to create the resource group.

    1. Connect to Azure and select the subscription (if not already done):
    Connect-AzAccount
    # Optional: set subscription
    # Set-AzContext -SubscriptionId <your-subscription-id>
    
    1. (Optional) List available locations so a valid region can be chosen:
    Get-AzLocation | Select-Object Location
    
    1. Create the resource group with New-AzResourceGroup:
    New-AzResourceGroup -Name "myResourceGroup" -Location "WestUS"
    

    Replace myResourceGroup with the desired name and WestUS with any supported region (for example, eastus2, westus, EastUS). If permissions are correct, the command returns the new resource group details with ProvisioningState : Succeeded.

    If a variable is preferred for location:

    $location = "westus"
    New-AzResourceGroup -Name "rbac-tutorial-resource-group" -Location $location
    

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.