If the type of identity is set to SystemAssigned, UserAssigned(w/space), Terraform will return the following 400 error even though the type has not changed when updating the resource. It is caused by the internal error (internal error: the legacy SystemAssigned,UserAssigned identity type should be being converted to the schema type - this is a bug). In this case, the type value returned from API is SystemAssigned,UserAssigned(no space) causing this internal error to occur.
Error:
`performing CreateOrUpdate: unexpected status 400 with error: InvalidResource: The resource definition is invalid.`
If the
type
ofidentity
is set toSystemAssigned, UserAssigned
(w/space), Terraform will return the following 400 error even though thetype
has not changed when updating the resource. It is caused by the internal error (internal error: the legacy SystemAssigned,UserAssigned identity type should be being converted to the schema type - this is a bug). In this case, the type value returned from API isSystemAssigned,UserAssigned
(no space) causing this internal error to occur.Use the consistent value
SystemAssigned, UserAssigned
internally - transform from the API value (SystemAssigned,UserAssigned
) as required when Unmarshalling the JSON payload to fix https://github.com/hashicorp/terraform-provider-azurerm/issues/24390.Test result: PASS: TestLegacySystemAndUserAssignedMapUnmarshal (0.00s)
Related PR: https://github.com/hashicorp/terraform-provider-azurerm/pull/25542