-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New-CosmosDbAttachment -PartitionKey support #274
Comments
Thanks for raising this @ruipach - I'll get onto looking at this tonight |
I have managed to replicate this now. Unfortunately the REST API documentation hasn't been updated yet, so I'm going to need to go blind on this one: https://docs.microsoft.com/en-us/rest/api/cosmos-db/create-an-attachment |
I've completed the support for this and I'll try and have this in the PS Gallery for you by tomorrow. |
Added support for PartitionKey in *-CosmosDBAttachment functions - Fixes #274
Hi @ruipach - no bother at all! That is good info! Could you clarify what you mean by the SYNTAX Context(default)? The strange thing about the PartitionKey when creating a collection is that it doesn't seem to YET be mandatory (I have even got integration tests that validate this: https://github.com/PlagueHO/CosmosDB/blob/dev/test/Integration/CosmosDB.integration.Tests.ps1#L514). The REST API docs also refer to this as optional: https://docs.microsoft.com/en-us/rest/api/cosmos-db/create-a-collection However, this might be a change that hasn't yet made it through all the docs. So I'll reach out to the CosmosDB team and point out the conflicting info and see if I can get them to clear it up one way or another. If the PartitionKey does become mandatory I'd need to make a breaking change (which I hate doing). Using a default PartitionKey might be risky. I'll raise a separate issue here in GH to track the issue. |
Hi @ruipach - I've done a bit more digging and it does look like PartitionKey will be required in the portal. It is mentioned that you can still create collections without PartitionKeys for now via the SDK (which uses the REST APIs like I do). So I suspect this may become completely mandatory in future and I've raised an issue to track it: Finally: I've released the new version of CosmosDB to PSGallery: |
Hi Daniel, I was mentioning the reference to [-PartitionKey <String[]>] in documentation: Thanks a lot! |
Ah right! Cool! I've updating the Wiki now so should be good to go 😁 I've asked the Cosmos DB team how they'd normally communicate change. |
Issue
New-CosmosDbAttachment does not support PartitionKey for latest API version, HTTP 400 without it.
The text was updated successfully, but these errors were encountered: