插入数据时出错 [英] Error while inserting data
问题描述
两个应用程序,WebApi和 控制台应用程序尝试在CosmosDb中批量插入数据.两者都使用完全相同的代码.
Two applications, WebApi and console application trying to bulk insert data in CosmosDb. Both are using exactly using same code.
WebApi运行正常,但在插入n条记录后,控制台应用程序失败,并出现以下错误.它先插入200、2,然后再插入117条记录,但失败了.我正在为CosmosDB使用.net库,
WebApi works fine but console application fails with following error after inserting n number of records. It has inserted 200, 2, and then 117 records and failed. I am using .net Libraries for CosmosDB,
错误:Microsoft.Azure.Documents.DocumentClientException:'缺少必需的标题授权.确保传递了有效的授权令牌.
Error: Microsoft.Azure.Documents.DocumentClientException: 'Required Header authorization is missing. Ensure a valid Authorization token is passed.
推荐答案
Kaka2k,
Hi Kaka2k,
能否请您提供正在关注的教程的链接?我假设您正在学习教程.如果不是,是否可以提供您所使用的REQUEST对象的示例?而您是否获得了RESPONSE的4XX响应代码?
Can you please provide a link to the tutorial you are following? I assume you are following a tutorial. If not, can you provide examples for the REQUEST object you are using? And are you getting a 4XX Response Code for the RESPONSE?
谢谢
迈克
Update to post: Providing additional information: What is the correct way to create the authorization payload for a DocumentDb query post?
客户端操作未正确处理某些事情.
Something is not being handled correctly by the client operation.
这篇关于插入数据时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!