Azure / ALZ-PowerShell-Module

The Azure Landing Zones Accelerators PowerShell module
https://www.powershellgallery.com/packages/ALZ/
MIT License
72 stars 36 forks source link

Bug: Cannot register provider: Microsoft.TimeSeriesInsights - AzureRM version issue? #191

Closed richardf5 closed 1 month ago

richardf5 commented 1 month ago

Is there an existing issue for this?

Infrastructure as Code Type? (Required)

terraform

Module Versions (Required)

ALZ PowerShell Module: 3.0.1 Accelerator Bootstrap Modules: 3.1.2 Terraform Starter Modules: 2.3.2

Input arguments of the ALZ-PowerShell-Module (Optional)

GitHub. Copy of the Complete starter (extra resources specified in it) along with some policy enforcement exceptions.

Debug Output/Panic Output (Optional)

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'

Expected Behaviour (Required)

Bootstrap to finish.

Actual Behaviour (Required)

Bootstrap retries a few times then stops working.

Steps to Reproduce (Optional)

Standard way to initiate bootstrap.

Important Factoids (Optional)

Looks like an issue created by Microsoft retiring the Time Series Insights! https://github.com/hashicorp/terraform-provider-azurerm/issues/27466

https://azure.microsoft.com/en-us/updates/we-re-retiring-azure-time-series-insights-on-7-july-2024-transition-to-azure-data-explorer/

References (Optional)

No response

richardf5 commented 1 month ago

I have a fix (of sorts). Removing the restriction on AzureRM (search and replace across the board) from:

version = "~> 3.105"

to

version = "> 3.105"

works.

I'm guessing there's a more specific version you'd prefer however and my full search and replace may break something else!!

richardf5 commented 1 month ago

Same issue with Azure DevOps!

│ Error: Failed to perform action │ │ with module.azure.azapi_resource_action.resource_provider_registration["_Microsoft.TimeSeriesInsights"], │ on ....\modules\azure\resource_providers.tf line 17, in resource "azapi_resource_action" "resource_provider_registration": │ 17: resource "azapi_resource_action" "resource_provider_registration" { │ │ performing action providers/Microsoft.TimeSeriesInsights/register of "Resource: (ResourceId │ \"/subscriptions/\" / Api Version \"2021-04-01\")": POST │ https://management.azure.com/subscriptions//providers/Microsoft.TimeSeriesInsights/register │ -------------------------------------------------------------------------------- │ RESPONSE 400: 400 Bad Request │ ERROR CODE: DisallowedProvider

jaredfholgate commented 1 month ago

This is an odd one. I would expect to see the second error where azapi attempts to register the provider, but we are targeting ~> 3.105 throughout, which would take the latest 3.x version of azurerm. The issue is only present in lower than 3.89, so don't understand how you could be seeing the provider level error? In any case we'll fix the azapi error and see if we get any more reports of a provider level issue.

jaredfholgate commented 1 month ago

Fix released in bootstrap modules latest version. Unable to to replicate the provider level issue, so closing this.