|
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 when resources are 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 | + |
8 | 9 | # Resolve errors for resource provider registration
|
9 | 10 |
|
10 |
| -This article describes the errors you may encounter when using a resource provider that you haven't previously used in your subscription. |
| 11 | +This article describes the errors that might occur when you use a resource provider that you haven't previously used in your subscription. |
11 | 12 |
|
12 | 13 | [!INCLUDE [updated-for-az](../../../includes/updated-for-az.md)]
|
13 | 14 |
|
14 | 15 | ## Symptom
|
15 | 16 |
|
16 |
| -When deploying resource, you may receive the following error code and message: |
| 17 | +When a resource is deployed, you might receive the following error code and message: |
17 | 18 |
|
18 |
| -``` |
| 19 | +```Output |
19 | 20 | Code: NoRegisteredProviderFound
|
20 | 21 | Message: No registered resource provider found for location {location}
|
21 | 22 | and API version {api-version} for type {resource-type}.
|
22 | 23 | ```
|
23 | 24 |
|
24 |
| -Or, you may receive a similar message that states: |
| 25 | +Or, you might receive a similar message that states: |
25 | 26 |
|
26 |
| -``` |
| 27 | +```Output |
27 | 28 | Code: MissingSubscriptionRegistration
|
28 | 29 | Message: The subscription is not registered to use namespace {resource-provider-namespace}
|
29 | 30 | ```
|
30 | 31 |
|
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. |
| 32 | +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 | 33 |
|
33 |
| -Or, when disabling auto-shutdown for virtual machines, you may receive an error message similar to: |
| 34 | +When virtual machine (VM) auto-shutdown is disabled, you might receive an error message similar to: |
34 | 35 |
|
35 |
| -``` |
| 36 | +```Output |
36 | 37 | Code: AuthorizationFailed
|
37 |
| -Message: The client '<identifier>' with object id '<identifier>' does not have authorization to perform action 'Microsoft.Compute/virtualMachines/read' over scope ... |
| 38 | +Message: The client '<identifier>' with object id '<identifier>' does not have authorization to perform |
| 39 | +action 'Microsoft.Compute/virtualMachines/read' over scope ... |
38 | 40 | ```
|
39 | 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 | +# [PowerShell](#tab/azure-powershell) |
52 | 54 |
|
53 |
| -```powershell |
| 55 | +You can use Azure PowerShell to get information about a resource provider's registration status and |
| 56 | +register a resource provider. |
| 57 | + |
| 58 | +Use [Get-AzResourceProvider](/powershell/module/az.resources/get-azresourceprovider) to display the registration status for your subscription's resource providers. |
| 59 | + |
| 60 | +The following command lists all the subscription's resource providers and whether they're `Registered` or `NotRegistered`. |
| 61 | + |
| 62 | +```azurepowershell-interactive |
54 | 63 | Get-AzResourceProvider -ListAvailable
|
55 | 64 | ```
|
56 | 65 |
|
57 |
| -To register a provider, use **Register-AzResourceProvider** and provide the name of the resource provider you wish to register. |
| 66 | +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`. |
58 | 67 |
|
59 |
| -```powershell |
60 |
| -Register-AzResourceProvider -ProviderNamespace Microsoft.Cdn |
| 68 | +```azurepowershell-interactive |
| 69 | +Get-AzResourceProvider -ListAvailable | |
| 70 | + Where-Object -Property RegistrationState -EQ -Value "Registered" |
61 | 71 | ```
|
62 | 72 |
|
63 |
| -To get the supported locations for a particular type of resource, use: |
| 73 | +To get the registration status for a specific resource provider: |
64 | 74 |
|
65 |
| -```powershell |
66 |
| -((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).Locations |
| 75 | +```azurepowershell-interactive |
| 76 | +Get-AzResourceProvider -ListAvailable | |
| 77 | + Where-Object -Property ProviderNamespace -Like -Value "Microsoft.Compute" |
67 | 78 | ```
|
68 | 79 |
|
69 |
| -To get the supported API versions for a particular type of resource, use: |
| 80 | +To register a provider, use [Register-AzResourceProvider](/powershell/module/az.resources/register-azresourceprovider) and provide the resource provider's name. |
70 | 81 |
|
71 |
| -```powershell |
72 |
| -((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).ApiVersions |
| 82 | +```azurepowershell-interactive |
| 83 | +Register-AzResourceProvider -ProviderNamespace "Microsoft.Cdn" |
73 | 84 | ```
|
74 | 85 |
|
75 |
| -## Solution 2 - Azure CLI |
| 86 | +To get a resource type's supported locations: |
| 87 | + |
| 88 | +```azurepowershell-interactive |
| 89 | +((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | |
| 90 | + Where-Object -Property ResourceTypeName -EQ -Value "sites").Locations |
| 91 | +``` |
| 92 | + |
| 93 | +To get a resource type's supported API versions: |
| 94 | + |
| 95 | +```azurepowershell-interactive |
| 96 | +((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | |
| 97 | + Where-Object -Property ResourceTypeName -EQ -Value "sites").ApiVersions |
| 98 | +``` |
| 99 | + |
| 100 | +# [Azure CLI](#tab/azure-cli) |
| 101 | + |
| 102 | +You can use Azure CLI to get information about a resource provider's registration status and |
| 103 | +register a resource provider. |
| 104 | + |
| 105 | +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. |
76 | 106 |
|
77 |
| -To see whether the provider is registered, use the `az provider list` command. |
| 107 | +The following command lists all the subscription's resource providers and whether they're `Registered` or `NotRegistered`. |
78 | 108 |
|
79 | 109 | ```azurecli-interactive
|
80 |
| -az provider list |
| 110 | +az provider list --output table |
81 | 111 | ```
|
82 | 112 |
|
83 |
| -To register a resource provider, use the `az provider register` command, and specify the *namespace* to register. |
| 113 | +You can filter the output by registration state. Replace the query value with `Registered` or `NotRegistered`. |
| 114 | + |
| 115 | +```azurecli-interactive |
| 116 | +az provider list --query "[?registrationState=='Registered']" --output table |
| 117 | +``` |
| 118 | + |
| 119 | +To get the registration status for a specific resource provider: |
| 120 | + |
| 121 | +```azurecli-interactive |
| 122 | +az provider list --query "[?namespace=='Microsoft.Compute']" --output table |
| 123 | +``` |
| 124 | + |
| 125 | +To register a resource provider, use the [az provider register](/cli/azure/provider#az_provider_register) command, and specify the _namespace_ to register. |
84 | 126 |
|
85 | 127 | ```azurecli-interactive
|
86 | 128 | az provider register --namespace Microsoft.Cdn
|
87 | 129 | ```
|
88 | 130 |
|
89 |
| -To see the supported locations and API versions for a resource type, use: |
| 131 | +To get a resource type's supported locations, use [az provider show](/cli/azure/provider#az_provider_show): |
90 | 132 |
|
91 | 133 | ```azurecli-interactive
|
92 |
| -az provider show -n Microsoft.Web --query "resourceTypes[?resourceType=='sites'].locations" |
| 134 | +az provider show --namespace Microsoft.Web --query "resourceTypes[?resourceType=='sites'].locations" |
93 | 135 | ```
|
94 | 136 |
|
95 |
| -## Solution 3 - Azure portal |
| 137 | +To get a resource type's supported API versions: |
| 138 | + |
| 139 | +```azurecli-interactive |
| 140 | +az provider show --namespace Microsoft.Web --query "resourceTypes[?resourceType=='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/). |
| 148 | + |
| 149 | +1. In the search box, enter _subscriptions_. Or if you've recently viewed your subscription, select **Subscriptions**. |
100 | 150 |
|
101 |
| -  |
| 151 | + :::image type="content" source="media/error-register-resource-provider/select-subscriptions.png" alt-text="Screenshot that shows how to select a subscription."::: |
102 | 152 |
|
103 |
| -1. Select **Subscriptions**. |
104 | 153 |
|
105 |
| -  |
| 154 | +1. Select the subscription you want to use to register a resource provider. |
106 | 155 |
|
107 |
| -1. From the list of subscriptions, select the subscription you want to use for registering the resource provider. |
| 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."::: |
108 | 157 |
|
109 |
| -  |
| 158 | +1. To see the list of resource providers, under **Settings** select **Resource providers**. |
110 | 159 |
|
111 |
| -1. For your subscription, select **Resource providers**. |
| 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."::: |
112 | 161 |
|
113 |
| -  |
| 162 | +1. To register a resource provider, select the resource provider and then select **Register** . |
114 | 163 |
|
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. |
| 164 | + :::image type="content" source="media/error-register-resource-provider/select-register.png" alt-text="Screenshot of button that registers a selected resource provider."::: |
116 | 165 |
|
117 |
| -  |
| 166 | +--- |
0 commit comments