title: Cosmos DB entity not found on delete but exists and able to get
body: <p>Whenever I try to delete an Item using it's id, I get an entity not found error, but the Item exists in the DB and I'm also able to retrieve it using the SQL format.</p>
  <p>I'm not understanding where am I wrong in the code but whenever I retrieve an item with it's ID I'm able to find it, whenever I try to delete it it fails.</p>
  <p>This is my code to get:</p>
  <pre><code>async getAsset(assetId: string): Promise&lt;Asset&gt; {
      const assetsDb = await getDbClient(cosmoDBContainers.assets);
      const response = await assetsDb.items
        .query&lt;Asset&gt;({
          query: `SELECT * FROM ${cosmoDBContainers.assets} A 
                  WHERE A.id = @id`,
          parameters: [{ name: &quot;@id&quot;, value: assetId }],
        }).fetchAll();
      return response.resources.map(x =&gt; new Asset(
        x.id,
        x.orgId,
        x.assetType,
        x.title,
        x.createdAt,
        x.lastUpdate,
        x.fileStorageId,
      ))[0];
  } // item successfully retrieved
  </code></pre>
  <p>This is the code to delete (note I'm calling the getAsset function):</p>
  <pre><code>async removeAsset(assetId: string): Promise&lt;void&gt; {
      const assetsDb = await getDbClient(cosmoDBContainers.assets);
  
      const asset = await this.getAsset(assetId); // calling this in order to check that the Ids are the same, which they are
      const item = assetsDb.item(asset.Id); // this line seems to work
      await item.delete(); // error is thrown here
    }
  </code></pre>
  <p>The partition key in CosmosDB is &quot;/id&quot;, I've tried adding it when calling <code>assetsDb.item(asset.Id, &quot;/id&quot;)</code> but I still get the same not found error.</p>
  <p>This is the full error</p>
  <pre><code> Error: Entity with the specified id does not exist in the system.
  </code></pre>
  <p>I've tried a few things from other answers in SO but nothing seems to be working, I suspect it might be an issue on my side, but I'm completely lost at this point, any idea would be super helpful.</p>
  <p>I'm using TypeScript and <code> &quot;@azure/cosmos&quot;: &quot;^3.11.0&quot;</code></p>
  <p>Thanks.</p>