Problem
Users may encounter an error related to the Microsoft.TimeSeriesInsights resource provider when executing Terraform configurations with the AzureRM provider in versions before 4.x.
The following error message appears:
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 retired the Azure Time Series Insights service in July 2024, transitioning users to Azure Data Explorer. As a result, the Microsoft.TimeSeriesInsights resource provider can no longer be registered.
Terraform provider versions for AzureRM 3.90 and earlier attempt to register this provider, causing the operation to fail. This error can occur even if you do not directly use the Time Series Insights resource in your configuration, as Terraform checks all providers defined within the version you are using.
Solutions
The long-term recommendation is to migrate any Azure Time Series resources to Azure Data Explorer. The following short-term solutions can resolve the provider registration error.
Solution 1: Skip Provider Registration
You can disable the automatic resource provider registration feature in the AzureRM provider. This is the workaround suggested in the error message. For more information, refer to the skip_provider_registration documentation.
Set skip_provider_registration = true in your AzureRM provider block.
provider "azurerm" {
features {}
skip_provider_registration = true
}Alternatively, you can set the ARM_SKIP_PROVIDER_REGISTRATION=true environment variable.
Solution 2: Upgrade the AzureRM Provider
Upgrade your AzureRM provider version to 3.90 or a more recent version. These versions no longer include the retired Time Series Insights resources, which resolves the registration error.
Update the version constraint in your Terraform configuration.
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.90.0"
}
}
}Additional Information
- Microsoft's announcement of this deprecation
-
AzureRM Provider PR #24571, which addressed this issue in version
3.90.