You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version 5.0 of the Azure Provider is a major release that includes breaking changes and behavioural differences. This guide covers the most significant changes and explains how to upgrade from v4.x to v5.0.
14
14
15
15
### Pinning your Provider Version
16
16
17
-
TODO
17
+
We recommend pinning the version of each Provider you use in Terraform. You can do this using the `version` attribute within the `required_providers` block:
18
+
19
+
```hcl
20
+
terraform {
21
+
required_providers {
22
+
azurerm = {
23
+
source = "hashicorp/azurerm"
24
+
version = "=5.0.0"
25
+
}
26
+
}
27
+
}
28
+
29
+
provider "azurerm" {
30
+
features {}
31
+
}
32
+
```
33
+
34
+
More information on [how to pin the version of a Terraform Provider being used can be found on the Terraform Website](https://developer.hashicorp.com/terraform/language/providers/requirements#require-providers).
35
+
36
+
---
18
37
19
38
## What's available in Version 5.0 of the Azure Provider?
*[Breaking Changes in Resources](#breaking-changes-in-resources)
24
44
*[Breaking Changes in Data Sources](#breaking-changes-in-data-sources)
25
45
46
+
## Resource Provider Registration Changes
47
+
48
+
In version 5.0, the default behaviour for Resource Provider registration has changed. The `resource_provider_registrations` property now defaults to `none` instead of `legacy`.
49
+
50
+
### What this means
51
+
52
+
Previously, the provider would automatically attempt to register a large set of Azure Resource Providers (~60 RPs) when initializing. This could:
53
+
54
+
* Add delay to provider startup due to sequential RP registration checks
55
+
* Cause permission errors for users with restricted access to their subscription
56
+
* Register RPs that users may not need or want
57
+
58
+
In v5.0, no Resource Providers are registered by default. This gives users full control over RP registration and avoids potential permission issues.
59
+
60
+
### Registering specific Resource Providers
61
+
62
+
The recommendation is to only register the specific Resource Providers that your configuration requires, using the `resource_providers_to_register` property:
63
+
64
+
```hcl
65
+
provider "azurerm" {
66
+
resource_providers_to_register = [
67
+
"Microsoft.Compute",
68
+
"Microsoft.Network",
69
+
"Microsoft.Storage",
70
+
]
71
+
72
+
features {}
73
+
}
74
+
```
75
+
### How to replicate the previous behaviour
76
+
77
+
If you want to maintain the v4.x behaviour and automatically register the same set of Resource Providers as before, explicitly set `resource_provider_registrations` to the `legacy` resource provider set in your provider block:
78
+
79
+
```hcl
80
+
provider "azurerm" {
81
+
resource_provider_registrations = "legacy"
82
+
features {}
83
+
}
84
+
```
85
+
86
+
For more information, see the [Resource Provider Registrations](index.html#resource-provider-registrations) section in the provider documentation.
Copy file name to clipboardExpand all lines: website/docs/index.html.markdown
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,11 +197,11 @@ For some advanced scenarios, such as where more granular permissions are necessa
197
197
198
198
*`auxiliary_tenant_ids` - (Optional) Contains a list of (up to 3) other Tenant IDs used for cross-tenant and multi-tenancy scenarios with multiple AzureRM provider definitions. The list of `auxiliary_tenant_ids` in a given AzureRM provider definition contains the other, remote Tenants and should not include its own `subscription_id` (or `ARM_SUBSCRIPTION_ID` Environment Variable).
199
199
200
-
*`resource_provider_registrations` - (Optional) Specifies a pre-determined set of [Azure Resource Providers](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types) to automatically register when initializing the AzureRM Provider. Allowed values for this property are `core`, `extended`, `all`, or `none`. This can also be sourced from the `ARM_RESOURCE_PROVIDER_REGISTRATIONS` environment variable. For more information about which resource providers each set contains, see the [Resource Provider Registrations](#resource-provider-registrations) section below.
200
+
*`resource_provider_registrations` - (Optional) Specifies a pre-determined set of [Azure Resource Providers](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types) to automatically register when initializing the AzureRM Provider. Allowed values for this property are `core`, `extended`, `all`, `legacy`, or `none`. This can also be sourced from the `ARM_RESOURCE_PROVIDER_REGISTRATIONS` environment variable. For more information about which resource providers each set contains, see the [Resource Provider Registrations](#resource-provider-registrations) section below. Defaults to `legacy` in v4.x and `none` in v5.0+.
201
201
202
202
*`resource_providers_to_register` - (Optional) A list of arbitrary [Azure Resource Providers](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types) to automatically register when initializing the AzureRM Provider. Can be used in combination with the `resource_provider_registrations` property. For more information, see the [Resource Provider Registrations](#resource-provider-registrations) section below.
203
203
204
-
-> **Note:**By default, Terraform will attempt to register any Resource Providers that it supports, even if they're not used in your configurations, to be able to display more helpful error messages. If you're running in an environment with restricted permissions, or wish to manage Resource Provider Registration outside of Terraform you may wish to disable this by setting `resource_provider_registrations` to `none`; however, please note that the error messages returned from Azure may be confusing as a result.
204
+
-> **Note:**In version 5.0 and later, the default value for `resource_provider_registrations` is `none`, meaning no Resource Providers will be automatically registered. If you're upgrading from v4.x and want to maintain the previous behaviour, set `resource_provider_registrations = "legacy"` in your provider block. If you're running in an environment with restricted permissions, or wish to manage Resource Provider Registration outside of Terraform, `none` is the recommended setting.
205
205
206
206
*`storage_use_azuread` - (Optional) Should the AzureRM Provider use AzureAD to connect to the Storage Blob & Queue APIs, rather than the SharedKey from the Storage Account? This can also be sourced from the `ARM_STORAGE_USE_AZUREAD` Environment Variable. Defaults to `false`.
0 commit comments