Retirement Announcement - Update to version 3 of the Azure Cosmos DB .NET SDK by 31 August 2024

HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
2021-08-26T23:17:33.397+00:00

Because version 3 of the Azure Cosmos DB .NET SDK includes updated features and improved performance, we'll retire version 2.x of this SDK on 31 August 2024. As a result, you'll need to update your SDK to version 3 by that date. If you have a question, please post it in this thread.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,664 questions
{count} vote

Accepted answer
  1. Saurabh Sharma 23,816 Reputation points Microsoft Employee
    2021-08-26T23:20:03.427+00:00

    Learn more from this migration document.

    If you have any additional queries regarding this retirement, please use comments on this thread to ask your specific queries and we will try our best to answer those queries. Thank you


1 additional answer

Sort by: Most helpful
  1. 29728762 1 Reputation point
    2022-12-07T09:20:28.7+00:00

    I upgraded the version of azure/cosmos to 3.17.2 from 2.XX.X. After upgradation I am getting below error while starting the application.
    Error: Message: {"Errors":["PartitionKey extracted from document doesn't match the one specified in the header. Learn more: https://aka.ms/CosmosDB/sql/errors/wrong-pk-value"\]}
    ActivityId: e38b112a-4121-4764-87fc-d887f29426e2, Request URI: /apps/534cf430-b4d9-46ae-bd93-cb6c549364da/services/7da4dd07-13c3-4c52-aa9f-65e26dada7c4/partitions/94dceb92-c8e8-4408-ac15-ad6bde96b35c/replicas/133095755327040778p/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.19041 cosmos-netstandard-sdk/3.18.0
    at httpRequest (E:\node_modules\@azure\cosmos\dist\index.js:7910:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async execute (E:\node_modules\@azure\cosmos\dist\index.js:7745:26)
    at async ClientContext.upsert (E:\node_modules\@azure\cosmos\dist\index.js:8482:30)
    at async Items.upsert (E:\node_modules\@azure\cosmos\dist\index.js:5475:26)
    at async writeAsync (E:\api\shared\cosmosdb-cache-interface.js:23:3) {
    code: 400,
    body: {
    code: 'BadRequest',
    message: Message: {"Errors":["PartitionKey extracted from document doesn't match the one specified in the header. Learn more: https:\\/\\/aka.ms\\/CosmosDB\\/sql\\/errors\\/wrong-pk-value"]}\r\n +
    'ActivityId: e38b112a-4121-4764-87fc-d887f29426e2, Request URI: /apps/534cf430-b4d9-46ae-bd93-cb6c549364da/services/7da4dd07-13c3-4c52-aa9f-65e26dada7c4/partitions/94dceb92-c8e8-4408-ac15-ad6bde96b35c/replicas/133095755327040778p/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.19041 cosmos-netstandard-sdk/3.18.0'
    },
    headers: {
    date: 'Wed, 07 Dec 2022 07:55:14 GMT',
    'transfer-encoding': 'chunked',
    'content-type': 'application/json',
    'x-ms-activity-id': 'e38b112a-4121-4764-87fc-d887f29426e2',
    'x-ms-last-state-change-utc': 'Wed, 12 Oct 2022 21:14:54.370 GMT',
    'x-ms-schemaversion': '1.14',
    lsn: '25962',
    'x-ms-request-charge': '1.24',
    'x-ms-quorum-acked-lsn': '25962',
    'x-ms-substatus': '1001',
    'x-ms-current-write-quorum': '3',
    'x-ms-current-replica-set-size': '4',
    'x-ms-documentdb-partitionkeyrangeid': '0',
    'x-ms-xp-role': '1',
    'x-ms-global-committed-lsn': '25962',
    'x-ms-number-of-read-regions': '0',
    'x-ms-transport-request-id': '1',
    'x-ms-cosmos-llsn': '25962',
    'x-ms-cosmos-quorum-acked-llsn': '25962',
    'x-ms-session-token': '0:-1#25962',
    'x-ms-request-duration-ms': '0.663',
    'x-ms-serviceversion': 'version=2.14.0.0',
    server: 'Compute',
    'x-ms-gatewayversion': '2.0.0',
    'x-ms-throttle-retry-count': 0,
    'x-ms-throttle-retry-wait-time-ms': 0
    },
    activityId: 'e38b112a-4121-4764-87fc-d887f29426e2',
    substatus: 1001
    }
    Reading container: UserXXXXXXXXXXXXXX

    But before updating it was working good.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.