Skip to content

Latest commit

 

History

History
331 lines (228 loc) · 13.1 KB

resource-providers-and-types.md

File metadata and controls

331 lines (228 loc) · 13.1 KB
title description ms.topic ms.date ms.custom
Resource providers and resource types
Describes the resource providers that support Azure Resource Manager. It describes their schemas, available API versions, and the regions that can host the resources.
conceptual
08/05/2022
devx-track-azurecli, devx-track-azurepowershell

Azure resource providers and types

An Azure resource provider is a collection of REST operations that provide functionality for an Azure service. For example, the Key Vault service consists of a resource provider named Microsoft.KeyVault. The resource provider defines REST operations for working with vaults, secrets, keys, and certificates.

The resource provider defines the Azure resources that are available for you to deploy to your account. The name of a resource type is in the format: {resource-provider}/{resource-type}. The resource type for a key vault is Microsoft.KeyVault/vaults.

In this article, you learn how to:

  • View all resource providers in Azure
  • Check registration status of a resource provider
  • Register a resource provider
  • View resource types for a resource provider
  • View valid locations for a resource type
  • View valid API versions for a resource type

You can do these steps through the Azure portal, Azure PowerShell, or Azure CLI.

For a list that maps resource providers to Azure services, see Resource providers for Azure services.

Register resource provider

Before using a resource provider, your Azure subscription must be registered for the resource provider. Registration configures your subscription to work with the resource provider.

Important

Only register a resource provider when you're ready to use it. The registration step enables you to maintain least privileges within your subscription. A malicious user can't use resource providers that aren't registered.

Some resource providers are registered by default. For a list of resource providers registered by default, see Resource providers for Azure services.

Other resource providers are registered automatically when you take certain actions. When you create a resource through the portal, the resource provider is typically registered for you. When you deploy an Azure Resource Manager template or Bicep file, resource providers defined in the template are registered automatically. However, if a resource in the template creates supporting resources that aren't in the template, such as monitoring or security resources, you need to manually register those resource providers.

For other scenarios, you may need to manually register a resource provider.

Important

Your application code shouldn't block the creation of resources for a resource provider that is in the registering state. When you register the resource provider, the operation is done individually for each supported region. To create resources in a region, the registration only needs to be completed in that region. By not blocking a resource provider in the registering state, your application can continue much sooner than waiting for all regions to complete.

You must have permission to do the /register/action operation for the resource provider. The permission is included in the Contributor and Owner roles.

You can't unregister a resource provider when you still have resource types from that resource provider in your subscription.

Azure portal

Register resource provider

To see all resource providers, and the registration status for your subscription:

  1. Sign in to the Azure portal.

  2. On the Azure portal menu, search for Subscriptions. Select it from the available options.

    :::image type="content" source="./media/resource-providers-and-types/search-subscriptions.png" alt-text="search subscriptions":::

  3. Select the subscription you want to view.

    :::image type="content" source="./media/resource-providers-and-types/select-subscription.png" alt-text="select subscriptions":::

  4. On the left menu, under Settings, select Resource providers.

    :::image type="content" source="./media/resource-providers-and-types/select-resource-providers.png" alt-text="select resource providers":::

  5. Find the resource provider you want to register, and select Register. To maintain least privileges in your subscription, only register those resource providers that you're ready to use.

    :::image type="content" source="./media/resource-providers-and-types/register-resource-provider.png" alt-text="register resource providers":::

Important

As noted earlier, don't block the creation of resources for a resource provider that is in the registering state. By not blocking a resource provider in the registering state, your application can continue much sooner than waiting for all regions to complete.

View resource provider

To see information for a particular resource provider:

  1. Sign in to the Azure portal.

  2. On the Azure portal menu, select All services.

  3. In the All services box, enter resource explorer, and then select Resource Explorer.

    select All services

  4. Expand Providers by selecting the right arrow.

    Select providers

  5. Expand a resource provider and resource type that you want to view.

    Select resource type

  6. Resource Manager is supported in all regions, but the resources you deploy might not be supported in all regions. Also, there may be limitations on your subscription that prevent you from using some regions that support the resource. The resource explorer displays valid locations for the resource type.

    Show locations

  7. The API version corresponds to a version of REST API operations that are released by the resource provider. As a resource provider enables new features, it releases a new version of the REST API. The resource explorer displays valid API versions for the resource type.

    Show API versions

Azure PowerShell

To see all resource providers in Azure, and the registration status for your subscription, use:

Get-AzResourceProvider -ListAvailable | Select-Object ProviderNamespace, RegistrationState

The command returns:

ProviderNamespace                RegistrationState
-------------------------------- ------------------
Microsoft.ClassicCompute         Registered
Microsoft.ClassicNetwork         Registered
Microsoft.ClassicStorage         Registered
Microsoft.CognitiveServices      Registered
...

To see all registered resource providers for your subscription, use:

 Get-AzResourceProvider -ListAvailable | Where-Object RegistrationState -eq "Registered" | Select-Object ProviderNamespace, RegistrationState | Sort-Object ProviderNamespace

To maintain least privileges in your subscription, only register those resource providers that you're ready to use. To register a resource provider, use:

Register-AzResourceProvider -ProviderNamespace Microsoft.Batch

The command returns:

ProviderNamespace : Microsoft.Batch
RegistrationState : Registering
ResourceTypes     : {batchAccounts, operations, locations, locations/quotas}
Locations         : {West Europe, East US, East US 2, West US...}

Important

As noted earlier, don't block the creation of resources for a resource provider that is in the registering state. By not blocking a resource provider in the registering state, your application can continue much sooner than waiting for all regions to complete.

To see information for a particular resource provider, use:

Get-AzResourceProvider -ProviderNamespace Microsoft.Batch

The command returns:

{ProviderNamespace : Microsoft.Batch
RegistrationState : Registered
ResourceTypes     : {batchAccounts}
Locations         : {West Europe, East US, East US 2, West US...}

...

To see the resource types for a resource provider, use:

(Get-AzResourceProvider -ProviderNamespace Microsoft.Batch).ResourceTypes.ResourceTypeName

The command returns:

batchAccounts
operations
locations
locations/quotas

The API version corresponds to a version of REST API operations that are released by the resource provider. As a resource provider enables new features, it releases a new version of the REST API.

To get the available API versions for a resource type, use:

((Get-AzResourceProvider -ProviderNamespace Microsoft.Batch).ResourceTypes | Where-Object ResourceTypeName -eq batchAccounts).ApiVersions

The command returns:

2017-05-01
2017-01-01
2015-12-01
2015-09-01
2015-07-01

Resource Manager is supported in all regions, but the resources you deploy might not be supported in all regions. Also, there may be limitations on your subscription that prevent you from using some regions that support the resource.

To get the supported locations for a resource type, use.

((Get-AzResourceProvider -ProviderNamespace Microsoft.Batch).ResourceTypes | Where-Object ResourceTypeName -eq batchAccounts).Locations

The command returns:

West Europe
East US
East US 2
West US
...

Azure CLI

To see all resource providers in Azure, and the registration status for your subscription, use:

az provider list --query "[].{Provider:namespace, Status:registrationState}" --out table

The command returns:

Provider                         Status
-------------------------------- ----------------
Microsoft.ClassicCompute         Registered
Microsoft.ClassicNetwork         Registered
Microsoft.ClassicStorage         Registered
Microsoft.CognitiveServices      Registered
...

To see all registered resource providers for your subscription, use:

az provider list --query "sort_by([?registrationState=='Registered'].{Provider:namespace, Status:registrationState}, &Provider)" --out table

To maintain least privileges in your subscription, only register those resource providers that you're ready to use. To register a resource provider, use:

az provider register --namespace Microsoft.Batch

The command returns a message that registration is on-going.

To see information for a particular resource provider, use:

az provider show --namespace Microsoft.Batch

The command returns:

{
    "id": "/subscriptions/####-####/providers/Microsoft.Batch",
    "namespace": "Microsoft.Batch",
    "registrationsState": "Registering",
    "resourceTypes:" [
        ...
    ]
}

Important

As noted earlier, don't block the creation of resources for a resource provider that is in the registering state. By not blocking a resource provider in the registering state, your application can continue much sooner than waiting for all regions to complete.

To see the resource types for a resource provider, use:

az provider show --namespace Microsoft.Batch --query "resourceTypes[*].resourceType" --out table

The command returns:

Result
---------------
batchAccounts
operations
locations
locations/quotas

The API version corresponds to a version of REST API operations that are released by the resource provider. As a resource provider enables new features, it releases a new version of the REST API.

To get the available API versions for a resource type, use:

az provider show --namespace Microsoft.Batch --query "resourceTypes[?resourceType=='batchAccounts'].apiVersions | [0]" --out table

The command returns:

Result
---------------
2017-05-01
2017-01-01
2015-12-01
2015-09-01
2015-07-01

Resource Manager is supported in all regions, but the resources you deploy might not be supported in all regions. Also, there may be limitations on your subscription that prevent you from using some regions that support the resource.

To get the supported locations for a resource type, use.

az provider show --namespace Microsoft.Batch --query "resourceTypes[?resourceType=='batchAccounts'].locations | [0]" --out table

The command returns:

Result
---------------
West Europe
East US
East US 2
West US
...

Next steps