Hi @bmittathullil,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
We would like to inform you that, control plane operations can be used to create databases and containers. Which require the use of the Azure.ResourceManager.CosmosDB client and not the Microsoft.Azure.Cosmos SDK. The Microsoft.Azure.Cosmos SDK with Azure AD credentials is limited to data plane operations and it doesn’t support control plane operations directly.
The Cosmos DB Operator and DocumentDB Account Contributor roles should theoretically grant access to perform control plane operations, but these need to be executed through the Azure.ResourceManager.CosmosDB client in combination with DefaultAzureCredential. To create a database or container using Managed Identity, use the Azure.ResourceManager SDK.
We request you to refer the below mentioned links for more information.
https://learn.microsoft.com/en-us/dotnet/azure/sdk/resource-management?tabs=PowerShell
https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/troubleshoot-forbidden
I hope, This response will address your query and helped you to overcome on your challenges.
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.