Introduction
Users have been reporting AzureRM errors related to the resource provider, Microsoft.TimeSeriesInsights when executing Terraform modules in major releases before 4.x:
Error: Error ensuring Resource Providers are registered.
Terraform automatically attempts to register the Resource Providers it supports to ensure it's able to provision resources. If you don't have permission to register Resource Providers you may wish to use the "skip_provider_registration" flag in the Provider block to disable this functionality. Please note that if you opt out of Resource Provider Registration and Terraform tries to provision a resource from a Resource Provider which is unregistered, then the errors may appear misleading - for example: > API version 2019-XX-XX was not found for Microsoft.Foo Could indicate either that the Resource Provider "Microsoft.Foo" requires registration, but this could also indicate that this Azure Region doesn't support this API version. More information on the "skip_provider_registration" flag can be found here: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#skip_provider_registration
Original Error: determining which Required Resource Providers require registration: the required Resource Provider "Microsoft.TimeSeriesInsights" wasn't returned from the Azure API Original Error: Cannot register providers: Microsoft.TimeSeriesInsights. Errors were: Cannot register provider Microsoft.TimeSeriesInsights with Azure Resource Manager: unexpected status 400 with error: DisallowedProvider: The operation is not permitted for namespace 'Microsoft.TimeSeriesInsights'
Cause
Microsoft has retired the resource provider, Azure Time Series Insights, effective July 2024 in favor of fully transitioning their users to Azure Data Explorer, and later decommissioned the usage of this completely. Resources related to Time Series Insights are no longer available in the AzureRM Provider version 4.x and higher, and many users on provider versions 3.90 or earlier are experiencing errors related to various functions involving Microsoft.TimeSeriesInsights as it relates its resource provider registration process, which is no longer possible.
Some users may not directly use this resource, but this error will occur in versions 3.90 and earlier if Terraform defines it at any time when it checks to see if required providers are registered.
Solution
The long-term solution is to transition Azure Time Series resources to Azure Data Explorer. However, there are a two short-term solutions in the meantime:
- If using AzureRM 3.89 or earlier, set
skip_provider_registration = true
in the AzureRM provider block to opt out of Resource Provider Registration, as is suggested in the error. You can also use an environment variableARM_SKIP_PROVIDER_REGISTRATION=true
- Upgrade your AzureRM Provider version to 3.90 or later.
Additional References:
- Microsoft's announcement of this deprecation: https://azure.microsoft.com/en-us/updates/we-re-retiring-azure-time-series-insights-on-7-july-2024-transition-to-azure-data-explorer/
- AzureRM PR, released with 3.90, addressing this family of errors: https://github.com/hashicorp/terraform-provider-azurerm/pull/24571