 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- 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 resources from the resource group using PowerShell?
To get the available resources from the resource groups using PowerShell, we need to use the Get-AZResource command. Suppose we have the resource group name AnsibleTestRG and we need to retrieve the resources from the resource group, then we will use the below command.
Example
Get-AzResource -ResourceGroupName AnsibleTestRG
To filter the output,
Output
Get-AzResource -ResourceGroupName AnsibleTestRG | Select Name, ResourceType, Location
Output

If there are multiple resource groups in the particular subscription, we can use the below commands to export the resources from the resource group to the CSV file.
Example
$ErrorActionPreference = "Stop" try {     Connect-AZAccount     Set-AzContext -SubscriptionName 'Your Subscription Name'     $rgs = Get-AzResourceGroup     foreach ($rg in $rgs.ResourceGroupName) {         Write-Output "Checking Resource Group: $rg"         Get-AzResource -ResourceGroupName $rg | Select Name, ResourceGroupName, Type, Location | Export-Csv .\AzureResources.csv -Append -Force -NoTypeInformation     } } catch {     Write-Host "$($_.Exception.Message)" -BackgroundColor DarkRed }Advertisements
 