Hi @Anonymous Thank you for posting your question on Microsoft Q&A and for using Azure Services.
As per my understanding you are trying to automatically set a partition key on Cosmos DB. Please let me know if my understanding is not correct.
Programmatically setting partition KEY in Azure Cosmos DB is not yet available. You can choose the partition key for your container but cannot automatically set up partition key.
Azure Cosmos DB automatically can create new physical partitions by splitting existing ones. see Partitioning and horizontal scaling in Azure Cosmos DB
Regards,
Oury