What is a resource group?
A resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to add resources to resource groups based on what makes the most sense for your organization. Generally, add resources that share the same lifecycle to the same resource group so you can easily deploy, update, and delete them as a group.
The resource group stores metadata about the resources. When you specify a location for the resource group, you’re specifying where that metadata is stored. For compliance reasons, you may need to ensure that your data is stored in a particular region.
How to create an Azure resource group using Azure CLI?
Prerequisites: Azure CLI installed and configured.
How to create a new Azure resource group using Azure CLI?
1 2 3 4 |
## Create a new Azure resource group az group create \ --name MyResourceGroup \ --location centralindia |
How to list all Azure resources groups in your account using Azure CLI?
1 2 |
## List all Azure resource groups az group list |
How to get details on a particular Azure resource group using Azure CLI?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
## Get details on a particular resource group az group show \ --name MyResourceGroup ## returns ## [ ## { ## "id": "/subscriptions/ ## "location": "centralindia", ## "managedBy": null, ## "name": "MyResourceGroup", ## "properties": { ## "provisioningState": "Succeeded" ## }, ## "tags": null, ## "type": "Microsoft.Resources/resourceGroups" ## } ## ] |
How to create a resource in a specific resource group using Azure CLI?
1 2 3 4 5 6 7 |
## Create a new resouces using azure resources group az storage account create \ --resource-group MyResourceGroup \ --name cloudaffairesa \ --location centralindia \ --sku Standard_LRS \ --kind StorageV2 |
How to delete an Azure resource group using Azure CLI?
1 2 3 4 |
## Delete the resource group az group delete \ --name MyResourceGroup \ --yes |