Skip to content

Commit cda6f78

Browse files
authored
Merge pull request #180456 from davidsmatlak/ds-tsdocs-1116
Updates register resource provider
2 parents f9680bc + 25e7867 commit cda6f78

File tree

8 files changed

+99
-50
lines changed

8 files changed

+99
-50
lines changed
Lines changed: 99 additions & 50 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 for resources 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-
# Resolve errors for resource provider registration
98

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
1110

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

1413
## Symptom
1514

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

18-
```
17+
```Output
1918
Code: NoRegisteredProviderFound
2019
Message: No registered resource provider found for location {location}
2120
and API version {api-version} for type {resource-type}.
2221
```
2322

24-
Or, you may receive a similar message that states:
23+
Or, you might receive a similar message that states:
2524

26-
```
25+
```Output
2726
Code: MissingSubscriptionRegistration
2827
Message: The subscription is not registered to use namespace {resource-provider-namespace}
2928
```
3029

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

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

35-
```
34+
```Output
3635
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 ...
3838
```
3939

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+
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+
# [Azure CLI](#tab/azure-cli)
5254

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

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

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
6164
```
6265

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

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
6770
```
6871

69-
To get the supported API versions for a particular type of resource, use:
72+
Get the registration status for a specific resource provider:
7073

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
7376
```
7477

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

7980
```azurecli-interactive
80-
az provider list
81+
az provider register --namespace Microsoft.Cdn
8182
```
8283

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

8586
```azurecli-interactive
86-
az provider register --namespace Microsoft.Cdn
87+
az provider show --namespace Microsoft.Web --query "resourceTypes[?resourceType=='sites'].locations"
8788
```
8889

89-
To see the supported locations and API versions for a resource type, use:
90+
Get a resource type's supported API versions:
9091

9192
```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"
9394
```
9495

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)
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/).
100148

101-
![Select all services](./media/error-register-resource-provider/select-all-services.png)
149+
1. In the search box, enter _subscriptions_. Or if you've recently viewed your subscription, select **Subscriptions**.
102150

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

105-
![Select subscriptions](./media/error-register-resource-provider/select-subscriptions.png)
106153

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

109-
![Select subscription to register resource provider](./media/error-register-resource-provider/select-subscription-to-register.png)
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.":::
110157

111-
1. For your subscription, select **Resource providers**.
158+
1. To see the list of resource providers, under **Settings** select **Resource providers**.
112159

113-
![Select resource providers](./media/error-register-resource-provider/select-resource-provider.png)
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.":::
114161

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

117-
![List resource providers](./media/error-register-resource-provider/list-resource-providers.png)
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+
---
14.5 KB
Loading
Loading
Loading
-2.05 KB
Loading

0 commit comments

Comments
 (0)