According to azuread_application_identifier_uri | Resources | hashicorp/azuread | Terraform | Terraform Registry
Application Identifier URIs can be imported using the object ID of the application and the base64-encoded identifier URI, in the following format.
So I have an object
local {
api_uris = [ "https://example.net" ]
}
resource "azuread_application_identifier_uri" "uri" {
for_each = toset(local.api_uris)
application_id = azuread_application.ar.id
identifier_uri = each.value
}
And the following import statement
import {
to = module.my_app.azuread_application_identifier_uri.uri["https://example.net"]
id = "/applications/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/identifierUris/aHR0cHM6Ly9leGFtcGxlLm5ldC8="
}
I verified the application object id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx which is correct.
I verified the identifier_uri https://example.net and it is present in the object xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
However the import just fails
│ Error: Cannot import non-existent remote object
│
│ While attempting to import an existing object to
│ "module.my_app.azuread_application_identifier_uri.uri[\"https://example.net\"]", the provider detected that no object
│ exists with the given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the provider's configured region
│ or endpoint, or use "terraform apply" to create a new remote object for this resource.
Not sure if that’s a bug or I am doing something wrong?