title: Cosmos DB with multiple partition keys
body: <p>We're looking at potentially using a <strong>single Cosmos DB collection</strong> to hold <strong>multiple document types</strong> in a <strong>multi-tenanted environment</strong> using a <strong>tenant ID as the partition key</strong>. The <strong><em>path to tenant id may change in each document type</em></strong> and I am therefore looking at various was of exposing the partition key to Cosmos DB to enable correct partitioning / querying.</p>
  
  <p>I have noticed that the Paths property of DocumentCollection.PartitionKey is a collection and was therefore wondering whether it is possible to pass multiple paths during the creation of a document collection and what the behaviour of this might be. Ideally, I would like Cosmos to scan each of these paths and use the first value or aggregate of values as the partition key but cannot find any documentation suggesting that this is indeed the behaviour.</p>
  
  <p>The <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.partitionkeydefinition.paths?view=azure-dotnet#Microsoft_Azure_Documents_PartitionKeyDefinition_Paths" rel="nofollow noreferrer">MSDN documentation for this property</a> is pretty useless and none of the <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/partition-data" rel="nofollow noreferrer">associated</a> <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/performance-tips" rel="nofollow noreferrer">documentation</a> seems to answer the question. Does anyone know about or previously used multiple partition key paths in a collection?</p>
  
  <p>To be clear, I'm looking for links to additional documentation about and/or direct experience of the Cosmos DB's behaviour when specifying multiple partition keys in the PartitionKey.Paths collection when creating a DocumentCollection.</p>
  
  <p>This question has also been posted in the <a href="https://social.msdn.microsoft.com/Forums/en-US/d7113e26-f814-4e7d-bd52-9bee3dc70511/cosmos-db-with-multiple-partition-keys?forum=windowsazuredata" rel="nofollow noreferrer">Azure Community Support forums</a>.</p>
  
  <p>Thanks, Ian</p>