Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of all azure resource types in Azure?

Is there anywhere you can get a full list of all the resource types offered by Azure? I'm doing policy/role management and there doesn't seem to be a great place to look for all resource types. Currently I've been using the Get-AzureRmProviderOperation but this still doesn't show everything. For example, there's no option for Microsoft.Botservice

like image 450
user9360564 Avatar asked Apr 16 '18 16:04

user9360564


People also ask

What are the types of Azure resources?

In this section, we will explore the three most common types of Azure resources used by MSPs when deploying IT environments: Compute (virtual machines), Storage, and Network.

How many Azure resources are there?

You can deploy up to 800 instances of a resource type in each resource group.

How do I get a list of resources in Azure?

In case you need to get a list of resources you have created in Microsoft Azure, use Get-AzureRMResource PowerShell cmdlet. Above command exports all Azure Resources in a CSV named AllAzureRes. CSV. The CSV file also contains the Resource Group name for each resource.


2 Answers

Flagging the entire list is also available here for the resource providers and here for the types and actions

like image 60
Alberto Avatar answered Oct 20 '22 21:10

Alberto


You can use the Providers - List API along with the $expand=resourceTypes/aliases query a parameter to give you everything that you need.

You can get all the resource types by 1. Appending namespace and resourceTypes[*].resourceType within each provider returned 2. The name of each alias is a resource type name already

Here is a simple nodejs script to get all the resource types sorted into a file

const fs = require('fs');

var a = <resource-provider-api-response-as-json-object>;

let final = [];

var b = a.value.forEach(p => {
  let ns = p.namespace;

  let rsts = p.resourceTypes.map(rst => ns + '/' + rst.resourceType);
  final = final.concat(rsts);

  p.resourceTypes.forEach(rst => {
    let aliases = rst.aliases.map(a => a.name)

    final = final.concat(aliases);
  });
});

final.sort();

fs.writeFile("random.data", final.join('\n'), function(err) {
  if(err) {
      return console.log(err);
  }

  console.log("The file was saved!");
}); 

Also, if you using bash with az and jq installed, you could simply run this :)

az provider list --expand resourceTypes/aliases | jq '[ .[].namespace + "/" + .[].resourceTypes[].resourceType , .[].resourceTypes[].aliases[]?.name ] | unique | sort' | less

You could just pipe the output to a file too for your use in other scripts, etc.

like image 33
PramodValavala-MSFT Avatar answered Oct 20 '22 19:10

PramodValavala-MSFT