4

我将 Azure Cosmos DB 模拟器升级到2.9.2

在 2.9.2 之前就像一个魅力,但现在,忽略了我丢失了数据但这是意料之中的(我不是抱怨),在资源管理器部分我得到了这两个错误

查询报价时出错:{"code":401,"body":{"code":"Unauthorized","message":"输入的授权令牌无法为请求提供服务。请检查预期的有效负载是否构建为根据协议,并检查正在使用的密钥。服务器使用以下有效负载进行签名:'get\noffers\n\nfri, MYDATE \n\n'\r\nActivityId: MYID , Microsoft.Azure.Documents.Common/2.9 .2"},"headers":{"access-control-allow-credentials":"true","access-control-allow-origin":"","content-location":" https://localhost: 8080/offers ","content-type":"application/json","date":" MYDATE","server":"Microsoft-HTTPAPI/2.0","transfer-encoding":"chunked","x-ms-activity-id":"MYID","x-ms-gatewayversion":"version=2.9 .2","x-ms-throttle-retry-count":0,"x-ms-throttle-retry-wait-time-ms":0},"activityId":" MYID "}

和这个:

刷新数据库时出错:{"code":401,"body":{"code":"Unauthorized","message":"输入的授权令牌无法服务于请求。请检查预期的有效负载是否构建为根据协议,并检查正在使用的密钥。服务器使用以下有效负载进行签名:'get\noffers\n\nfri, MYDATE \n\n'\r\nActivityId: MYID , Microsoft.Azure.Documents.Common/2.9 .2"},"headers":{"access-control-allow-credentials":"true","access-control-allow-origin":"","content-location":" https://localhost: 8080/offers ","content-type":"application/json","date":" MYDATE","server":"Microsoft-HTTPAPI/2.0","transfer-encoding":"chunked","x-ms-activity-id":"MYID","x-ms-gatewayversion":"version=2.9 .2","x-ms-throttle-retry-count":0,"x-ms-throttle-retry-wait-time-ms":0},"activityId":" MYID "}

如果我尝试创建一个新数据库:

创建数据库 asd 时出错:{"code":401,"body":{"code":"Unauthorized","message":"输入的授权令牌无法服务于请求。请检查是否构建了预期的有效负载根据协议,并检查正在使用的密钥。服务器使用以下有效负载进行签名:'post\ndbs\n\n" MYDATE2 " \n\n'\r\nActivityId: MYID2 , Microsoft.Azure.Documents.Common /2.9.2"},"headers":{"access-control-allow-credentials":"true","access-control-allow-origin":" https://localhost:8080 ","access-control -expose-headers":"Access-Control-Allow-Origin,Access-Control-Allow-Credentials,Content-Type,x-ms-activity-id,x-ms-gatewayversion","content-type":"application/json","date":" MYDATE2 GMT","server":"Microsoft-HTTPAPI/2.0","transfer-encoding":"chunked","x-ms-activity-id":" MYID2 ","x-ms-gatewayversion":"version= 2.9.2","x-ms-throttle-retry-count":0,"x-ms-throttle-retry-wait-time-ms":0},"activityId":" MYID2 "}

我尝试了来自这个类似线程Cosmos DB Emulator: Failed to get authorization headers for offer但我什么也没得到的答案

MYID、MYID2、MYDATE 和 MYDATE2 只是占位符,我在设置中更改了原始值。

更新
这里是 SDK 的错误

来源:
System.Private.CoreLib / Microsoft.Azure.DocumentDB.Core

信息:

输入授权令牌无法为请求提供服务。请检查预期的有效负载是否按照协议构建,并检查正在使用的密钥。服务器使用以下有效负载进行签名:'get

格林威治标准时间 2020 年 3 月 2 日星期一 11:01:04

' ActivityId: b6a56fc2-093d-4154-a4d6-d64ca08d167d, Microsoft.Azure.Documents.Common/2.9.2, Windows/6.3.9600 documentdb-netcore-sdk/2.6.0

4

1 回答 1

3

我用这个参数运行模拟器

/AllowNetworkAccess /KeyFile=generatedKey /NoFirewall /Port=8080

所以...是存储在文件“generatedKey”(使用参数/GenFileKey 生成)中的密钥导致了我所有的麻烦!

我用默认密钥更改了存储在文件中的密钥并再次工作!

于 2020-03-03T08:33:55.370 回答