question

Cairn-3868 avatar image
0 Votes"
Cairn-3868 asked bhargaviannadevara-msft rolled back

Get list of ARM Resource providers and types

Looking at the Azure documentation its possible to get a list of all the providers and offerings using either the portal, PowerShell and CLI to list providers and resource types. IS there a way to do this either using .net or via REST API's. Looking at the online docs it does not appear to offer this type of functionality.

azure-dtl-arm-enviorments
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

bhargaviannadevara-msft avatar image
0 Votes"
bhargaviannadevara-msft answered bhargaviannadevara-msft rolled back

@Cairn-3868 Yes, you can. Although not listed on this doc, the Provider Resource Types - List API should help you list the resource types for a specified resource provider.

The sample response from this API for the Microsoft.Batch resource provider namespace for one of my Subscriptions looks like the following:

{
  "value": [
    {
      "resourceType": "batchAccounts",
      "locations": [
        "West Europe",
        "East US",
        ..
      ],
      "apiVersions": [
        "2021-01-01",
        "2020-09-01",
        ..
      ],
      "defaultApiVersion": "2021-01-01",
      "apiProfiles": [
        {
          "profileVersion": "2018-06-01-profile",
          "apiVersion": "2017-09-01"
        }
      ],
      "capabilities": "CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"
    },
    {
      "resourceType": "batchAccounts/pools",
      "locations": [
        "West Europe",
        "East US",
        ..
      ],
      "apiVersions": [
        "2021-01-01",
        "2020-09-01",
        ..
      ],
      "defaultApiVersion": "2021-01-01",
      "apiProfiles": [
        {
          "profileVersion": "2018-06-01-profile",
          "apiVersion": "2017-09-01"
        }
      ],
      "capabilities": "None"
    },
    ..
  ]
}

Further, if you want to perform other operations like list all the resource providers for a subscription, or register/unregister a subscription with/from a resource provider, check out the Providers API.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for this, but how do you get the list of providers first of all.

0 Votes 0 ·

@Cairn-3868 The Providers API should be the one to look at. The Providers - List API gets all the resource providers for a given subscription.
Other supported operations are documented here: Providers Operations


0 Votes 0 ·

@Cairn-3868 Hope the above inputs help. Are there any further questions here?

0 Votes 0 ·