|
1 | 1 | ---
|
2 | 2 | title: Resource provider registration errors
|
3 |
| -description: Describes how to resolve Azure resource provider registration errors when deploying resources with Azure Resource Manager. |
| 3 | +description: Describes how to resolve Azure resource provider registration errors for resources deployed with Azure Resource Manager. |
4 | 4 | ms.topic: troubleshooting
|
5 |
| -ms.date: 02/15/2019 |
| 5 | +ms.date: 11/18/2021 |
6 | 6 | ms.custom: devx-track-azurepowershell
|
7 | 7 | ---
|
8 |
| -# Resolve errors for resource provider registration |
9 | 8 |
|
10 |
| -This article describes the errors you may encounter when using a resource provider that you haven't previously used in your subscription. |
| 9 | +# Resolve errors for resource provider registration |
11 | 10 |
|
12 |
| -[!INCLUDE [updated-for-az](../../../includes/updated-for-az.md)] |
| 11 | +This article describes the errors that might occur when you use a resource provider that you haven't previously used in your subscription. |
13 | 12 |
|
14 | 13 | ## Symptom
|
15 | 14 |
|
16 |
| -When deploying resource, you may receive the following error code and message: |
| 15 | +When a resource is deployed, you might receive the following error code and message: |
17 | 16 |
|
18 |
| -``` |
| 17 | +```Output |
19 | 18 | Code: NoRegisteredProviderFound
|
20 | 19 | Message: No registered resource provider found for location {location}
|
21 | 20 | and API version {api-version} for type {resource-type}.
|
22 | 21 | ```
|
23 | 22 |
|
24 |
| -Or, you may receive a similar message that states: |
| 23 | +Or, you might receive a similar message that states: |
25 | 24 |
|
26 |
| -``` |
| 25 | +```Output |
27 | 26 | Code: MissingSubscriptionRegistration
|
28 | 27 | Message: The subscription is not registered to use namespace {resource-provider-namespace}
|
29 | 28 | ```
|
30 | 29 |
|
31 |
| -The error message should give you suggestions for the supported locations and API versions. You can change your template to one of the suggested values. Most providers are registered automatically by the Azure portal or the command-line interface you're using, but not all. If you haven't used a particular resource provider before, you may need to register that provider. |
| 30 | +The error message should give you suggestions for the supported locations and API versions. You can change your template to use a suggested value. Most providers are registered automatically by the Microsoft Azure portal or the command-line interface, but not all. If you haven't used a particular resource provider before, you might need to register that provider. |
32 | 31 |
|
33 |
| -Or, when disabling auto-shutdown for virtual machines, you may receive an error message similar to: |
| 32 | +When virtual machine (VM) auto-shutdown is disabled, you might receive an error message similar to: |
34 | 33 |
|
35 |
| -``` |
| 34 | +```Output |
36 | 35 | Code: AuthorizationFailed
|
37 |
| -Message: The client '<identifier>' with object id '<identifier>' does not have authorization to perform action 'Microsoft.Compute/virtualMachines/read' over scope ... |
| 36 | +Message: The client '<identifier>' with object id '<identifier>' does not have authorization to perform |
| 37 | +action 'Microsoft.Compute/virtualMachines/read' over scope ... |
38 | 38 | ```
|
39 | 39 |
|
| 40 | +An unexpected error can occur for a resource provider that's not in your ARM template or Bicep file. This error might happen when a resource is deployed that creates other supporting resources. For example, the resource in your template adds monitoring or security resources. The error message indicates the resource provider namespace you need to register is for the supporting resource. |
| 41 | + |
40 | 42 | ## Cause
|
41 | 43 |
|
42 | 44 | You receive these errors for one of these reasons:
|
43 | 45 |
|
44 |
| -* The required resource provider hasn't been registered for your subscription |
45 |
| -* API version not supported for the resource type |
46 |
| -* Location not supported for the resource type |
47 |
| -* For auto-shutdown of VMs, the Microsoft.DevTestLab resource provider must be registered. |
| 46 | +- The required resource provider hasn't been registered for your subscription. |
| 47 | +- API version not supported for the resource type. |
| 48 | +- Location not supported for the resource type. |
| 49 | +- For VM auto-shutdown, the `Microsoft.DevTestLab` resource provider must be registered. |
48 | 50 |
|
49 |
| -## Solution 1 - PowerShell |
| 51 | +## Solution |
50 | 52 |
|
51 |
| -For PowerShell, use **Get-AzResourceProvider** to see your registration status. |
| 53 | +# [Azure CLI](#tab/azure-cli) |
52 | 54 |
|
53 |
| -```powershell |
54 |
| -Get-AzResourceProvider -ListAvailable |
55 |
| -``` |
| 55 | +You can use Azure CLI to get information about a resource provider's registration status and |
| 56 | +register a resource provider. |
56 | 57 |
|
57 |
| -To register a provider, use **Register-AzResourceProvider** and provide the name of the resource provider you wish to register. |
| 58 | +Use [az provider list](/cli/azure/provider#az_provider_list) to display the registration status for your subscription's resource providers. The examples use the `--output table` parameter to filter the output for readability. You can omit the parameter to see all properties. |
58 | 59 |
|
59 |
| -```powershell |
60 |
| -Register-AzResourceProvider -ProviderNamespace Microsoft.Cdn |
| 60 | +The following command lists all the subscription's resource providers and whether they're `Registered` or `NotRegistered`. |
| 61 | + |
| 62 | +```azurecli-interactive |
| 63 | +az provider list --output table |
61 | 64 | ```
|
62 | 65 |
|
63 |
| -To get the supported locations for a particular type of resource, use: |
| 66 | +You can filter the output by registration state. Replace the query value with `Registered` or `NotRegistered`. |
64 | 67 |
|
65 |
| -```powershell |
66 |
| -((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).Locations |
| 68 | +```azurecli-interactive |
| 69 | +az provider list --query "[?registrationState=='Registered']" --output table |
67 | 70 | ```
|
68 | 71 |
|
69 |
| -To get the supported API versions for a particular type of resource, use: |
| 72 | +Get the registration status for a specific resource provider: |
70 | 73 |
|
71 |
| -```powershell |
72 |
| -((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).ApiVersions |
| 74 | +```azurecli-interactive |
| 75 | +az provider list --query "[?namespace=='Microsoft.Compute']" --output table |
73 | 76 | ```
|
74 | 77 |
|
75 |
| -## Solution 2 - Azure CLI |
76 |
| - |
77 |
| -To see whether the provider is registered, use the `az provider list` command. |
| 78 | +To register a resource provider, use the [az provider register](/cli/azure/provider#az_provider_register) command, and specify the _namespace_ to register. |
78 | 79 |
|
79 | 80 | ```azurecli-interactive
|
80 |
| -az provider list |
| 81 | +az provider register --namespace Microsoft.Cdn |
81 | 82 | ```
|
82 | 83 |
|
83 |
| -To register a resource provider, use the `az provider register` command, and specify the *namespace* to register. |
| 84 | +To get a resource type's supported locations, use [az provider show](/cli/azure/provider#az_provider_show): |
84 | 85 |
|
85 | 86 | ```azurecli-interactive
|
86 |
| -az provider register --namespace Microsoft.Cdn |
| 87 | +az provider show --namespace Microsoft.Web --query "resourceTypes[?resourceType=='sites'].locations" |
87 | 88 | ```
|
88 | 89 |
|
89 |
| -To see the supported locations and API versions for a resource type, use: |
| 90 | +Get a resource type's supported API versions: |
90 | 91 |
|
91 | 92 | ```azurecli-interactive
|
92 |
| -az provider show -n Microsoft.Web --query "resourceTypes[?resourceType=='sites'].locations" |
| 93 | +az provider show --namespace Microsoft.Web --query "resourceTypes[?resourceType=='sites'].apiVersions" |
93 | 94 | ```
|
94 | 95 |
|
95 |
| -## Solution 3 - Azure portal |
| 96 | +# [PowerShell](#tab/azure-powershell) |
| 97 | + |
| 98 | +You can use Azure PowerShell to get information about a resource provider's registration status and |
| 99 | +register a resource provider. |
| 100 | + |
| 101 | +Use [Get-AzResourceProvider](/powershell/module/az.resources/get-azresourceprovider) to display the registration status for your subscription's resource providers. |
| 102 | + |
| 103 | +The following command lists all the subscription's resource providers and whether they're `Registered` or `NotRegistered`. |
| 104 | + |
| 105 | +```azurepowershell-interactive |
| 106 | +Get-AzResourceProvider -ListAvailable |
| 107 | +``` |
| 108 | + |
| 109 | +To list only `Registered` resource providers, omit the `ListAvailable` parameter. You can also filter the output by registration state. Replace the value with `Registered` or `NotRegistered`. |
| 110 | + |
| 111 | +```azurepowershell-interactive |
| 112 | +Get-AzResourceProvider -ListAvailable | |
| 113 | + Where-Object -Property RegistrationState -EQ -Value "Registered" |
| 114 | +``` |
| 115 | + |
| 116 | +Get the registration status for a specific resource provider: |
| 117 | + |
| 118 | +```azurepowershell-interactive |
| 119 | +Get-AzResourceProvider -ListAvailable | |
| 120 | + Where-Object -Property ProviderNamespace -Like -Value "Microsoft.Compute" |
| 121 | +``` |
| 122 | + |
| 123 | +To register a provider, use [Register-AzResourceProvider](/powershell/module/az.resources/register-azresourceprovider) and provide the resource provider's name. |
| 124 | + |
| 125 | +```azurepowershell-interactive |
| 126 | +Register-AzResourceProvider -ProviderNamespace "Microsoft.Cdn" |
| 127 | +``` |
| 128 | + |
| 129 | +Get a resource type's supported locations: |
| 130 | + |
| 131 | +```azurepowershell-interactive |
| 132 | +((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | |
| 133 | + Where-Object -Property ResourceTypeName -EQ -Value "sites").Locations |
| 134 | +``` |
| 135 | + |
| 136 | +Get a resource type's supported API versions: |
| 137 | + |
| 138 | +```azurepowershell-interactive |
| 139 | +((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | |
| 140 | + Where-Object -Property ResourceTypeName -EQ -Value "sites").ApiVersions |
| 141 | +``` |
| 142 | + |
| 143 | +# [Portal](#tab/azure-portal) |
96 | 144 |
|
97 | 145 | You can see the registration status and register a resource provider namespace through the portal.
|
98 | 146 |
|
99 |
| -1. From the portal, select **All services**. |
| 147 | +1. Sign in to [Azure portal](https://portal.azure.com/). |
100 | 148 |
|
101 |
| -  |
| 149 | +1. In the search box, enter _subscriptions_. Or if you've recently viewed your subscription, select **Subscriptions**. |
102 | 150 |
|
103 |
| -1. Select **Subscriptions**. |
| 151 | + :::image type="content" source="media/error-register-resource-provider/select-subscriptions.png" alt-text="Screenshot that shows how to select a subscription."::: |
104 | 152 |
|
105 |
| -  |
106 | 153 |
|
107 |
| -1. From the list of subscriptions, select the subscription you want to use for registering the resource provider. |
| 154 | +1. Select the subscription you want to use to register a resource provider. |
108 | 155 |
|
109 |
| -  |
| 156 | + :::image type="content" source="media/error-register-resource-provider/select-subscription-to-register.png" alt-text="Screenshot of link to subscription that's used to register a resource provider."::: |
110 | 157 |
|
111 |
| -1. For your subscription, select **Resource providers**. |
| 158 | +1. To see the list of resource providers, under **Settings** select **Resource providers**. |
112 | 159 |
|
113 |
| -  |
| 160 | + :::image type="content" source="media/error-register-resource-provider/select-resource-providers.png" alt-text="Screenshot of a subscription's list of resource providers."::: |
114 | 161 |
|
115 |
| -1. Look at the list of resource providers, and if necessary, select the **Register** link to register the resource provider of the type you're trying to deploy. |
| 162 | +1. To register a resource provider, select the resource provider and then select **Register**. |
116 | 163 |
|
117 |
| -  |
| 164 | + :::image type="content" source="media/error-register-resource-provider/select-register.png" alt-text="Screenshot of button that registers a selected resource provider."::: |
| 165 | + |
| 166 | +--- |
0 commit comments