-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3.98.0: azurerm_application_insights_api_key fails with error due to casing in resourcegroup
#25522
Comments
I have similar Output and indeed this did not happen with 3.97.1 and now occurs with 3.98.0. Our output: Error: parsing "/subscriptions/ac4c0c2c-af8a-42de-b36d-29b37fe715ce/resourceGroups/<our_resource_group>/providers/microsoft.insights/components/<our_appi_id>": parsing segment "staticMicrosoftInsights": parsing the Component ID: the segment at position 5 didn't match
│
│ Expected a Component ID that matched:
│
│ > /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentValue
│
│ However this value was provided:
│
│ > /subscriptions/ac4c0c2c-af8a-42de-b36d-29b37fe715ce/resourceGroups/<our_resource_group>/providers/microsoft.insights/components/<our_appi_id>
│
│ The parsed Resource ID was missing a value for the segment at position 5
│ (which should be the name of the Resource Provider [for example 'Microsoft.Insights']). |
I believe this might have been caused by #25376 |
I am facing also similar issue. Output:
|
I would like to reopen this issue, as even with v3.99.0 set, the issue still persists. See the terraform init and plan below: Initializing provider plugins...
- Finding hashicorp/azuread versions matching "2.47.0"...
- Finding azure/azapi versions matching "1.12.1"...
- Finding latest version of hashicorp/random...
- Finding hashicorp/azurerm versions matching "3.99.0"...
- Installing hashicorp/azuread v2.47.0...
- Installed hashicorp/azuread v2.47.0 (signed by HashiCorp)
- Installing azure/azapi v1.12.1...
- Installed azure/azapi v1.12.1 (signed by a HashiCorp partner, key ID 6F0B91BDE98478CF)
- Installing hashicorp/random v3.6.0...
- Installed hashicorp/random v3.6.0 (signed by HashiCorp)
- Installing hashicorp/azurerm v3.99.0...
- Installed hashicorp/azurerm v3.99.0 (signed by HashiCorp)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized! Next pipeline task (plan): Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: parsing "/subscriptions/af9cf5e1-3be2-4ad2-808b-2c1f6648200b/resourceGroups/<redacted-lowercase-rg>/providers/microsoft.insights/components/<redacted-lowercase-resource>": parsing segment "staticMicrosoftInsights": parsing the Component ID: the segment at position 5 didn't match
│
│ Expected a Component ID that matched:
│
│ > /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentValue
│
│ However this value was provided:
│
│ > /subscriptions/af9cf5e1-3be2-4ad2-808b-2c1f6648200b/resourceGroups/<redacted-lowercase-rg>/providers/microsoft.insights/components/<redacted-lowercase-resource>
│
│ The parsed Resource ID was missing a value for the segment at position 5
│ (which should be the name of the Resource Provider [for example 'Microsoft.Insights']).
│
│
│
│ with module.ai.azurerm_application_insights.ai,
│ on .terraform/modules/ai/main.tf line 1, in resource "azurerm_application_insights" "ai":
│ 1: resource "azurerm_application_insights" "ai" {
│
╵ I saw mention of a state-migration in the PR that was supposed to fix this and assumed that would happen automatically. @stephybun Could you confirm/deny that this bug could still be present and/or explain what steps are needed? |
@Devvox93 apologies for the inconvenience here, it appears that a second state migration is needed on that resource too - @stephybun can you take a look at that adding that one? Alternatively/in the interim you should be able to workaround that by using |
Thanks for confirming it's not on our side and not blaming anyone. We're all human! Unfortunately, this runs in separated environments, each with isolated state backends with no direct way of accessing them. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Terraform Version
1.7.5
AzureRM Provider Version
3.98.0
Affected Resource(s)/Data Source(s)
azurerm_application_insights_api_key
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
resource is created
Actual Behaviour
error occurs (see debug output)
Steps to Reproduce
terraform plan
The issue occurs after updating the provider to v3.98.0 and running a plan.
The issue did not occur with provider version 3.97.1
I think it is probably an error in the Azure REST API, which returns the value
resourcegroup
in lower casing. The validation expect its with an upperg
(resourceGroup
)Important Factoids
No response
References
Maybe it is related to this change: #25376
The text was updated successfully, but these errors were encountered: