From e3802bc3538a1071737cd51a2cfd2e0b091e1a96 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Wed, 15 Oct 2025 09:26:32 +0100 Subject: [PATCH] Extract canonical ID when importing Prefer to read the canonical ID from the response if inputs are nil. --- provider/pkg/provider/provider.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provider/pkg/provider/provider.go b/provider/pkg/provider/provider.go index 6364fc0401b8..fbfe6ff73fdb 100644 --- a/provider/pkg/provider/provider.go +++ b/provider/pkg/provider/provider.go @@ -1358,6 +1358,10 @@ func (k *azureNativeProvider) Read(ctx context.Context, req *rpc.ReadRequest) (* if inputs == nil { // There may be no old state (i.e., importing a new resource). + // Read the canonical ID from the response. + if azureId, ok := response["id"].(string); ok { + id = azureId + } // Extract inputs from resource's ID and response body. pathItems, err := resources.ParseResourceID(id, res.Path) if err != nil {