title: Cannot delete item from CosmosDB
body: <p>I am trying to use an Azure Functions httpTrigger call to delete an item from my database.</p>
  
  <pre><code>import { CosmosClient,  } from '@azure/cosmos'
  
  const httpTrigger: AzureFunction = async function (context: Context, req: HttpRequest): Promise&lt;void&gt; {
      const client = new CosmosClient(process.env.cosmosDB)
      const database = client.database('testDB');
      const container = database.container('workers');
      const item = container.item('28a31558-ff8c-40c3-a7e8-1e8904c5ff72', '/id')
      console.log(await item.delete())
  }
  </code></pre>
  
  <p>I even tried to hardcode the values into the code (as you can see) but I will always get 404 not found error:</p>
  
  <pre><code>Executed 'Functions.worker-delete' (Failed, Id=81ab43cf-a223-48af-89e1-a15676346ef0)
  System.Private.CoreLib: Exception while executing function: Functions.worker-delete. System.Private.CoreLib: Result: Failure
  Exception: Error: Entity with the specified id does not exist in the system., 
  RequestStartTime: 2020-05-11T12:30:44.4010890Z, RequestEndTime: 2020-05-11T12:30:44.4010890Z,  Number of regions attempted:1
  ResponseTime: 2020-05-11T12:30:44.4010890Z, StoreResult: StorePhysicalAddress: xxx, LSN: 769914, GlobalCommittedLsn: 769914, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 404, SubStatusCode: 0, RequestCharge: 1.24, ItemLSN: -1, SessionToken: -1#769914, UsingLocalLSN: False, TransportException: null, ResourceType: Document, OperationType: Delete
  , Microsoft.Azure.Documents.Common/2.10.0
  Stack: Error: Entity with the specified id does not exist in the system., 
  RequestStartTime: 2020-05-11T12:30:44.4010890Z, RequestEndTime: 2020-05-11T12:30:44.4010890Z,  Number of regions attempted:1
  ResponseTime: 2020-05-11T12:30:44.4010890Z, StoreResult: StorePhysicalAddress: xxx, LSN: 769914, GlobalCommittedLsn: 769914, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 404, SubStatusCode: 0, RequestCharge: 1.24, ItemLSN: -1, SessionToken: -1#769914, UsingLocalLSN: False, TransportException: null, ResourceType: Document, OperationType: Delete
  , Microsoft.Azure.Documents.Common/2.10.0
      at xxx/node_modules/@azure/cosmos/dist/index.js:6973:39
      at Generator.next (&lt;anonymous&gt;)
      at fulfilled (xxx/node_modules/tslib/tslib.js:110:62)
      at process._tickCallback (internal/process/next_tick.js:68:7).
  </code></pre>
  
  <p>I tripple checked:</p>
  
  <ul>
  <li>connection string</li>
  <li>database name</li>
  <li>container name</li>
  <li>item-id</li>
  <li>partition</li>
  </ul>