Skip to content

Error: Missing Resource Identity After Read azapi_resource type Microsoft.PolicyInsights/remediations@2024-10-01 #1044

@wylie-j

Description

@wylie-j

After upgrading from azure/azapi version 2.7.0 to version 2.8.0, I get the following error when running an apply to modify existing resources. Switching back to version 2.7.0 resolves the issue.

Error: Missing Resource Identity After Read

│ with module.policy.azapi_resource.remediation["vm-plnd-mnt-VMPlannedMaintenance"],
│ on ......\terraform-registry\modules\azure\policy\main.remediation.tf line 40, in resource "azapi_resource" "remediation":
│ 40: resource "azapi_resource" "remediation" {

│ 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.

The resource block that's being referenced:

resource "azapi_resource" "remediation" {
for_each = local.remediation_tasks_map

type = "Microsoft.PolicyInsights/remediations@2024-10-01"
name = "${each.key}-remediation"
parent_id = each.value.assignment_scope

body = {
properties = {
policyAssignmentId = azapi_resource.assignment[each.value.assignment_name].id
policyDefinitionReferenceId = each.value.policy_ref_id
resourceDiscoveryMode = each.value.resource_discovery_mode
}
}
depends_on = [azapi_resource.assignment]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions