Cosmos DB with default identity type as UserAssignedIdentity

While trying to setup cosmosdb with default_identity_type as UserAssignedIdentity not working as expected.
Getting error like → Code=“BadRequest” Message="Database account creation failed. Operation Id: 9ead9225-XXXXXXXXXfdb1383cfa, Error : Updating default identity not allowed. Cannot set default identity to UserAssigned because the account doesn’t have any UserAssigned identities.

But we don’t have the provision to create user assigned identity for cosmos account via terraform, in the Identity block it’s mentioned that

A identity block supports the following:

  • type - (Required) Specifies the type of Managed Service Identity that should be configured on this Cosmos Account. Possible value is only SystemAssigned .

But in default_identity_type we have the option to start with UserAssignedIdentity, how we can enable this to use an existing managed identity

  • default_identity_type - (Optional) The default identity for accessing Key Vault. Possible values are FirstPartyIdentity , SystemAssignedIdentity or start with UserAssignedIdentity . Defaults to FirstPartyIdentity .

It is now possible to set UserAssigned identity IDs that can then be used with default_identity_type as of azurerm v3.23.0