Container migration from non-partitioned to partitioned does not work as in demo
See original GitHub issueDescribe the bug
According to this migration demo reading the non-partitioned container (e.g. created in SDK v2) with SDK v3 should return the container with the PartitionKeyPath
populated with default value (_partitionKey
, I suppose). Instead, its value is null
and the demo throws an exception.
To Reproduce
Run the NonPartitionContainerMigration
demo.
Expected behavior
Container is read with default value of PartitionKeyPath
other than null.
Actual behavior
Exception is being thrown as the read container does not have PartitionKeyPath
set (property’s value is null).
Environment summary SDK Version: 3.0.0, 3.1.1, 3.2.0-preview2 OS Version: Windows
Additional context I haven’t found any working solution to migrate the container from non-partitioned to partitioned. This prevents us from migrating to the newer version of SDK and utilizing additional features, including partitioning. Official docs aren’t really helpful and point to this not working demo.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top GitHub Comments
Seems like the issue is related with the Cosmos emulator version; I had 2.2.x version installed, after updating to 2.5.6 demo started working, so did the reading and writing items using the new SDK with PK set to
PartitionKey.None
. Maybe some update of the docs indicating the minimal emulator version would be useful?One thing that needs an update in the docs is removal of reference to
CosmosContainerSettings.NonePartitionKeyValue
(likely to be replaced withPartitionKey.None
?) from there, which I also reported to the azure-docs team.