title: Azure DocumentDB - Requests originating from scripts cannot reference partition keys other than the one for which client request was submitted
body: <p>Using the c# .Net client SDK, I am calling the ExecuteStoredProcedureAsync method as follows:</p>
  
  <pre><code>sproc_response = await client.ExecuteStoredProcedureAsync&lt;Document&gt;(sproc_uri, new RequestOptions { PartitionKey = new PartitionKey( my_partition_key) }, doc_to_create );
  </code></pre>
  
  <p>The stored procedure code is as follows:</p>
  
  <pre><code>     sproc.Body = @"function( doc ) {
  
              var collection = getContext().getCollection();    
  
              var response = getContext().getResponse();    
  
              function create_doc_callback( err, doc_created, options ) {
  
                 if(err) throw new Error('Error creating document: ' + err.message);                              
  
                 response.setBody( doc_created );
  
              }
  
              collection.createDocument( collection.getSelfLink(), doc, {}, create_doc_callback );
  
          }";
  </code></pre>
  
  <p>This ALWAYS results in the following exception being thrown:</p>
  
  <p><strong>Error creating document: Requests originating from scripts cannot reference partition keys other than the one for which client request was submitted.</strong></p>
  
  <p>Is there any documentation or example that clearly shows how to call a stored procedure using a partition key -- obviously, I am missing something!</p>