- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the Azure resource group using Azure CLI in PowerShell?
To get all the Azure resource groups connected to the particular subscription use the az group command.
Before using this command make sure you are connected with the Azure account and if not connect the azure account with the “Az login”
Once you are connected to the Azure account, set the subscription name for which you want to retrieve the resource groups.
az account set --subscription 'subscription name or id'
Once you have set the subscription, use the below command to retrieve all the resource groups.
PS C:\> az group list -otable
To get the particular resource group details, use the below command.
PS C:\> az group show -n resourcegroupname
The above command output is in JSON format. To get the output in the table format, use the below command.
PS C:\> az group show -n ResourceGroupName -otable
To search for the specific resource group using CLI, we need to use the JMESPATH query as shown below
PS C:\> az group list --query "[?name=='AzRG']" -otable
The above command will find the resource group name ‘AzRG’ from the list.
- Related Articles
- How to get the Azure VM Size using Azure CLI in PowerShell?
- How to get the Azure VM username using Azure CLI in PowerShell?
- How to delete the Azure Resource Group using PowerShell?
- How to get the azure resources from the resource group using PowerShell?
- How to get the available azure VM size using Azure CLI in PowerShell?
- How to get the location of the Azure VM using Azure CLI in PowerShell?
- How to get all the available azure VM images using Azure CLI in PowerShell?
- How to retrieve the Azure VM resource group using PowerShell?
- How to list the Azure VMs using Azure CLI in PowerShell?
- How to deallocate the Azure VM using Azure CLI in PowerShell?
- How to start the Azure VM using Azure CLI in PowerShell?
- How to stop the Azure VM using Azure CLI in PowerShell?
- How to restart the Azure VM using Azure CLI in PowerShell?
- How to resize the Azure VM using Azure CLI in PowerShell?
- How to connect to the Azure subscription using Azure CLI in PowerShell?
