title: How do I supply PartitionKey for RegisterObserverFactoryAsync function in Cosmos DB Change Feed processor?
body: <p>I am running the Change Feed Processor sample from the path <a href="https://github.com/Azure/azure-documentdb-dotnet/tree/master/samples/ChangeFeedMigrationTool" rel="nofollow noreferrer">https://github.com/Azure/azure-documentdb-dotnet/tree/master/samples/ChangeFeedMigrationTool</a> as is. I have only changed the required key values in the App.config file to point to my Cosmos DB.</p>
  
  <p>When I run this sample against partitioned collection, I get exception while registering the observer factory.</p>
  
  <pre><code>await host.RegisterObserverFactoryAsync(docObserverFactory);
  </code></pre>
  
  <p>The exception details:</p>
  
  <pre><code>InvalidOperationException: PartitionKey value must be supplied for this operation.
  
     at Microsoft.Azure.Documents.Client.DocumentClient.&lt;AddPartitionKeyInformationAsync&gt;d__34f.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
  ...
  at ChangeFeedMigrationSample.Program.&lt;RunChangeFeedHostAsync&gt;d__18.MoveNext() in D:\temp\samples\code-samples\ChangeFeedProcessor\Program.cs:line 181
  --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
     at ChangeFeedMigrationSample.Program.&lt;MainAsync&gt;d__16.MoveNext() in D:\temp\samples\code-samples\ChangeFeedProcessor\Program.cs:line 92
  </code></pre>
  
  <p>But the function does not accept any partition key. And I don't know how to pass one. Am I missing anything in this? Also, my understanding is Cosmos DB Change Feed Processor library manages all partitions implicitly.</p>