terraform-provider-azapi icon indicating copy to clipboard operation
terraform-provider-azapi copied to clipboard

Error: Missing Resource Identity After Update - resource group

Open bkainth1 opened this issue 1 month ago • 4 comments

When i am creating the resource group using terraform apply, the code works fine and it creates resource group without any issue. but when i am running terraform apply again ( without making any changes in the code ) i am getting below error

module.lz-selfservice["sub-plm35-devtest"].azapi_resource.app-rg: Modifying... [id=/subscriptions/xxx/resourceGroups/plm35-app-rg] ╷ │ Error: Missing Resource Identity After Update │ │ with module.lz-selfservice["sub-plm35-devtest"].azapi_resource.app-rg, │ on ../modules/subscription/main.tf line 176, in resource "azapi_resource" "app-rg": │ 176: resource "azapi_resource" "app-rg" { │ │ The Terraform Provider unexpectedly returned no resource identity data │ after having no errors in the resource update. This is always an issue in │ the Terraform Provider and should be reported to the provider developers.

Below is the code i am using

resource "azapi_resource" "app-rg" { type = "Microsoft.Resources/resourceGroups@2025-04-01" depends_on = [ null_resource.register_subscription_provider] location = var.location name = var.app_rg_name parent_id = "/subscriptions/${azurerm_subscription.subscription.subscription_id}" schema_validation_enabled = false #tags = var.tags body = {tags = tomap({})} lifecycle { ignore_changes = [identity, body.tags,
] } }

azapi = { source = "Azure/azapi" version = "2.8.0" }

bkainth1 avatar Dec 13 '25 02:12 bkainth1

Hi @bkainth1 ,

Thank you for taking time to report this issue.

I believe it's duplicated with https://github.com/Azure/terraform-provider-azapi/issues/1023. Please use terraform >= 1.12, and I also opened a PR to fix the issue for <= 1.11.

ms-henglu avatar Dec 15 '25 01:12 ms-henglu

Hi @bkainth1,

I don't think it is a duplicate as we experience the same with terraform =1.13.5 and provider version 2.8.0

Error: Missing Resource Identity After Read
with module.mpi_support_secondary.module.backup["intermediate"].azapi_resource.proxy[0]
on .terraform/modules/mpi_support_secondary/backup_vm/guard.tf line 1, in resource "azapi_resource" "proxy":
resource "azapi_resource" "proxy" {
The Terraform Provider unexpectedly returned no resource identity data after having no errors in the resource read. This is always an issue in the Terraform Provider and should be reported to the provider developers. 

Using provider version 2.7.0 works

Olgoetz avatar Dec 17 '25 14:12 Olgoetz

@ms-henglu - I get this issue when doing a Vnet/Subnet deletion. Terraform 1.12.2, and azAPI v2.8.0. Have also had this reported by other consumers for a re-apply. When I switch to v2.7.0, the error is a little more descriptive - "│ Error decoding "module.example_hub.module.ai_lz_vnet.azapi_resource.vnet" from prior state: failed to decode identity: unsupported attribute "id". This is most likely a bug in the Provider, providers must not change the identity │ schema without updating the identity schema version"

jchancellor-ms avatar Dec 17 '25 23:12 jchancellor-ms

I got a similar error │ Error: Missing Resource Identity After Read

This is with version 2.8.0 and terraform version 1.14

rghdrizzle avatar Dec 18 '25 04:12 rghdrizzle

I'm also encountering Error: Missing Resource Identity After Read with AzApi 2.8.0 and Terraform 1.12. Using Terraform 1.14 didn't fix the issue.

With Terraform 1.12 and AzApi 2.7.0, I get: Error: failed to decode identity: unsupported attribute "id". This is most likely a bug in the Provider, providers must not change the identity schema without updating the identity schema version

The only combination that worked so far was AzApi 2.7.0 and Terraform 1.14.

eberkut avatar Dec 29 '25 18:12 eberkut