terraform-provider-azurerm: Error parsing segment "staticResourceGroups": expected the segment "resourcegroups" to be "resourceGroups"

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

v0.13.5

AzureRM Provider Version

v2.99.0

Affected Resource(s)/Data Source(s)

resource “azurerm_app_service” and resource “azurerm_function_app”

Terraform Configuration Files

resource "azurerm_app_service" "appservice" {
  name                    = var.appservice_app_name
  location                = var.location
  resource_group_name     = var.app_resource_group
  app_service_plan_id     = data.azurerm_app_service_plan.app_service_plan.id
  https_only              = true
  client_affinity_enabled = var.client_affinity_enabled

  app_settings = merge(var.appsettings, local.app_settings)

  identity {
    type         ="UserAssigned"
    identity_ids = var.user_assigned_managed_identity_ids
  } 

  site_config {
    always_on                 = var.always_on
    default_documents         = var.default_documents
    use_32_bit_worker_process = var.use_32_bit_worker_process

    cors {
      allowed_origins = var.cors_origins
    }
  }
 
}

Debug Output/Panic Output

Error parsing segment "staticResourceGroups": expected the segment "resourcegroups" to be "resourceGroups"

Expected Behaviour

Saw one thread which says this has been fixed in azurerm version v2.88.1 https://github.com/hashicorp/terraform-provider-azurerm/issues/14456 But we still get issue while using the version v2.99.0 When pinning to azurerm = v2.87.0" this is working. Should work with versions greater than v2.88.1

Actual Behaviour

Throws error Error parsing segment “staticResourceGroups”: expected the segment “resourcegroups” to be “resourceGroups” while creating function app and app service.

Steps to Reproduce

resource “azurerm_app_service” “appservice” { name = var.appservice_app_name location = var.location resource_group_name = var.app_resource_group app_service_plan_id = data.azurerm_app_service_plan.app_service_plan.id https_only = true client_affinity_enabled = var.client_affinity_enabled

app_settings = merge(var.appsettings, local.app_settings)

identity { type =“UserAssigned” identity_ids = var.user_assigned_managed_identity_ids }

site_config { always_on = var.always_on default_documents = var.default_documents use_32_bit_worker_process = var.use_32_bit_worker_process

cors {
  allowed_origins = var.cors_origins
}

}

}

Important Factoids

No response

References

https://github.com/hashicorp/terraform-provider-azurerm/issues/14456

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 15
  • Comments: 15 (4 by maintainers)

Most upvoted comments

the same issue with kubernetes AKS │ Error: parsing “/subscriptions/ID/resourcegroups/RG/providers/Microsoft.ContainerService/managedClusters/1AKS”: parsing segment “staticResourceGroups”: expected the segment “resourcegroups” to be “resourceGroups”

The same issue appeared on “azurerm_kubernetes_cluster”:

parsing segment "staticResourceGroups": expected the segment "resourcegroups" to be "resourceGroups"

Terraform v1.3.9 azurerm v3.40.0

Still happening for azurerm_monitor_diagnostic_setting resources with version 3.22.0.

Need to pin version 3.20 to work.

Edit, including screenshot. image

Any update on this please?

Hey ya’ll 👋

We’re aware of this issue and actively working on a fix, thanks to everyone for the reporting on/upvoting this issue for visibility! @dan-leanix my response on a similar issue https://github.com/hashicorp/terraform-provider-azurerm/issues/18235#issuecomment-1239823447 gives a little context into why these issues tend to come up every now and then.

Regarding AKS, the following versions worked for me: 3.10.0 and 3.22.0 to 3.28.0 I tried using versions 3.20.0, 3.21.0 and 3.29.0 to 3.44.1, but got the same

parsing segment “staticResourceGroups”: expected the segment “resourcegroups” to be “resourceGroups”

error on refresh on the azurerm_kubernetes_cluster resource.

The same issue appeared on “azurerm_virtual_machine”:

Error: flattening storage_os_disk: &errors.errorString{s:“parsing Disk ID "/subscriptions/XXX/resourcegroups/XXX/providers/Microsoft.Compute/disks/XXX": parsing "/subscriptions/XXX/resourcegroups/XXX/providers/Microsoft.Compute/disks/XXX": parsing segment "staticResourceGroups": expected the segment "resourcegroups" to be "resourceGroups"”}

@Amier3 we can see from other threads that this has been fixed in azurerm version [v3.22.0]. But the resource https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service itself is not supported in version 3.0. Is there any chance we can get this issue fixed in azurerm ~> 2.20 version. It is difficult to switch to new TF resource( azurerm_linux_web_app and azurerm_windows_web_app) for existing appservices created via azurerm_app_service resource

I have just opened a new issue for azurerm_monitor_diagnostic_setting: https://github.com/hashicorp/terraform-provider-azurerm/issues/18346