Closed koumdev closed 7 months ago
@koumdev Did the PoserShell approach work, or did it return the same 400
error? If the latter, then that would point to a possible issue with the runtime or component rather than the .NET SDK. In that case, I might ask the question in the dapr/components-contrib repo which would be more familiar with Azure Cosmos DB.
@philliphoff thank you for your reply and sorry for posting in the wrong place. Yes, I get the same 400 error with PowerShell. I posted in the components repo here.
Closing this in favor of the components-contrib issue.
Ask your question here
Hello,
I'm trying to use ExecuteStateTransactionAsync() with Azure Cosmos DB state store, but it does not work. I keep getting
"error while executing state transaction: transaction failed due to operation 0 which failed with status code 400"
exception.I tried exactly what is in the Dapr documentation in .NET here:
I also tried it with PowerShell:
Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '{"operations": [{"operation":"upsert", "request": {"key": "order_1", "value": "250"}}, {"operation":"upsert", "request": {"key": "order_2", "value": "450"}}]}' -Uri 'http://localhost:3500/v1.0/state/statestorecosmos/transaction'
The documentation says that Azure Cosmos DB state store supports transactional operations.
What am I doing wrong?
Thanks!