Skip to content

Commit 458258c

Browse files
committed
updates register resource provider
1 parent 17f59ea commit 458258c

File tree

8 files changed

+93
-44
lines changed

8 files changed

+93
-44
lines changed
Lines changed: 93 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,166 @@
11
---
22
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.
44
ms.topic: troubleshooting
5-
ms.date: 02/15/2019
5+
ms.date: 11/18/2021
66
ms.custom: devx-track-azurepowershell
77
---
8+
89
# Resolve errors for resource provider registration
910

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.
1112

1213
[!INCLUDE [updated-for-az](../../../includes/updated-for-az.md)]
1314

1415
## Symptom
1516

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:
1718

18-
```
19+
```Output
1920
Code: NoRegisteredProviderFound
2021
Message: No registered resource provider found for location {location}
2122
and API version {api-version} for type {resource-type}.
2223
```
2324

24-
Or, you may receive a similar message that states:
25+
Or, you might receive a similar message that states:
2526

26-
```
27+
```Output
2728
Code: MissingSubscriptionRegistration
2829
Message: The subscription is not registered to use namespace {resource-provider-namespace}
2930
```
3031

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.
3233

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:
3435

35-
```
36+
```Output
3637
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 ...
3840
```
3941

4042
## Cause
4143

4244
You receive these errors for one of these reasons:
4345

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.
4850

49-
## Solution 1 - PowerShell
51+
## Solution
5052

51-
For PowerShell, use **Get-AzResourceProvider** to see your registration status.
53+
# [PowerShell](#tab/azure-powershell)
5254

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
5463
Get-AzResourceProvider -ListAvailable
5564
```
5665

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`.
5867

59-
```powershell
60-
Register-AzResourceProvider -ProviderNamespace Microsoft.Cdn
68+
```azurepowershell-interactive
69+
Get-AzResourceProvider -ListAvailable |
70+
Where-Object -Property RegistrationState -EQ -Value "Registered"
6171
```
6272

63-
To get the supported locations for a particular type of resource, use:
73+
To get the registration status for a specific resource provider:
6474

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"
6778
```
6879

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.
7081

71-
```powershell
72-
((Get-AzResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).ApiVersions
82+
```azurepowershell-interactive
83+
Register-AzResourceProvider -ProviderNamespace "Microsoft.Cdn"
7384
```
7485

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.
76106

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`.
78108

79109
```azurecli-interactive
80-
az provider list
110+
az provider list --output table
81111
```
82112

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.
84126

85127
```azurecli-interactive
86128
az provider register --namespace Microsoft.Cdn
87129
```
88130

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):
90132

91133
```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"
93135
```
94136

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)
96144

97145
You can see the registration status and register a resource provider namespace through the portal.
98146

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**.
100150

101-
![Select all services](./media/error-register-resource-provider/select-all-services.png)
151+
:::image type="content" source="media/error-register-resource-provider/select-subscriptions.png" alt-text="Screenshot that shows how to select a subscription.":::
102152

103-
1. Select **Subscriptions**.
104153

105-
![Select subscriptions](./media/error-register-resource-provider/select-subscriptions.png)
154+
1. Select the subscription you want to use to register a resource provider.
106155

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.":::
108157

109-
![Select subscription to register resource provider](./media/error-register-resource-provider/select-subscription-to-register.png)
158+
1. To see the list of resource providers, under **Settings** select **Resource providers**.
110159

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.":::
112161

113-
![Select resource providers](./media/error-register-resource-provider/select-resource-provider.png)
162+
1. To register a resource provider, select the resource provider and then select **Register** .
114163

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.":::
116165

117-
![List resource providers](./media/error-register-resource-provider/list-resource-providers.png)
166+
---
14.5 KB
Loading
Loading
Loading
-2.05 KB
Loading

0 commit comments

Comments
 (0)