Skip to content

Fix/storage tables missing identity#147

Open
antonp-semperis wants to merge 3 commits intoupbound:mainfrom
antonp-semperis:fix/storage-tables-missing-identity
Open

Fix/storage tables missing identity#147
antonp-semperis wants to merge 3 commits intoupbound:mainfrom
antonp-semperis:fix/storage-tables-missing-identity

Conversation

@antonp-semperis
Copy link
Copy Markdown

fix: downgrade terraform-provider-azapi to v2.7.0 to fix ResourceWithIdentity incompatibility

Problem

The terraform-provider-azapi v2.8.0 introduced support for Terraform 1.12's ResourceWithIdentity interface. However, upjet does not implement this interface, causing 'Missing Resource Identity After Read' errors when managing resources like Azure Storage Tables.

Error

cannot run refresh: refresh failed: Missing Resource Identity After Read: 
The provider returned a resource with no identity set in the ReadResource response. 
Resources of type "azapi_resource" should always include an identity value in the 
ReadResource response to support identity-based imports.

Root Cause

  • terraform-provider-azapi v2.8.0 implements ResourceWithIdentity interface (Terraform Plugin Framework)
  • upjet v2.2.1 does not support ResourceWithIdentity - it has stub implementations that panic
  • When Terraform Plugin Framework validates the resource, it requires identity to be non-null after Read for resources implementing this interface

Solution

Downgrade to terraform-provider-azapi v2.7.0-upjet.1 which does not implement ResourceWithIdentity, allowing the provider to work correctly with upjet.

Testing

Verified that Azure Storage Tables now create/update/delete correctly with full management policies.

Related

  • Terraform Plugin Framework validation: server_readresource.go:203-210
  • terraform-provider-azapi v2.8.0 release notes mention: "Add support for identity-based import"

…ources

Azure Storage Tables API (Microsoft.Storage/storageAccounts/tableServices/tables)
and some other nested resources don't return the standard ARM 'id' field in their
API response. This causes upjet's IDAsExternalName to fail with 'cannot find id
in tfstate' error, which surfaces as 'Missing Resource Identity After Read'.

This fix overrides GetExternalNameFn to fall back to constructing the resource
identity from parent_id + name when the id field is missing or empty.

Fixes: Missing Resource Identity After Read error for storage tables
…Identity incompatibility

The terraform-provider-azapi v2.8.0 introduced support for Terraform 1.12's
ResourceWithIdentity interface. However, upjet does not implement this interface,
causing 'Missing Resource Identity After Read' errors when managing resources
like Azure Storage Tables.

This commit downgrades to terraform-provider-azapi v2.7.0-upjet.1 which does not
implement ResourceWithIdentity, allowing the provider to work correctly with upjet.

Fixes: Storage Tables fail with 'Missing Resource Identity After Read' error
@Upbound-CLA
Copy link
Copy Markdown

Upbound-CLA commented Jan 23, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants