error retrieving default location Resource group MyResourceGroup could not be found in Azure

0 votes

Hi Team,

I am trying to create a virtual machine in Azure with the CLI. But it is showing me the below error.

$ az vm create -n MyVm -g MyResourceGroup --image UbuntuLTS
error retrieving default location: Resource group 'MyResourceGroup' could not be found.
Nov 10, 2020 in Azure by akhtar
• 38,210 points
533 views

1 answer to this question.

0 votes

Hi@akhtar,

I think you don't have the group created in your Azure Cloud. Or the group may be in different regions. If you want to create a group, you can use the below command.

$ az group create -l westus -n MyResourceGroup
{
  "id": "/subscriptions/xxxxxxxxxxxxxxxxx/resourceGroups/MyResourceGroup",
  "location": "westus",
  "managedBy": null,
  "name": "MyResourceGroup",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}


Hope it helps!

To know more about Azure, join Azure architect certification course today.

Thank you!!

answered Nov 10, 2020 by MD
• 95,300 points

Related Questions In Azure

0 votes
1 answer

Resource group in Azure.

An Azure resource group is a way ...READ MORE

answered Jan 20, 2020 in Azure by Sirajul
• 59,070 points
131 views
0 votes
2 answers

In Azure powershell Select-AzureSubscription command fetching error: the subscription name doesn't exist

The problem you're having is that the ...READ MORE

answered Aug 16, 2018 in Azure by Priyaj
• 58,140 points
5,196 views
+1 vote
10 answers

How can the NuGet packages be used in Azure Functions?

Yes! Although the Azure Functions portal does ...READ MORE

answered Jun 8, 2018 in Azure by club_seesharp
• 3,450 points
12,148 views
0 votes
1 answer

Azure: Getting error in loading 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache'

The error is occurring because you are trying ...READ MORE

answered Mar 26, 2019 in Azure by p
• 1,960 points
242 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to create a resource group lock in Azure?

Hi@akhtar, Resource Manager Locks provide a way for ...READ MORE

answered Nov 15, 2020 in Azure by MD
• 95,300 points
89 views
0 votes
1 answer

How to update a resource group lock with new notes and type in Azure?

Hi@akhtar, You can update the group lock with ...READ MORE

answered Nov 15, 2020 in Azure by MD
• 95,300 points
100 views