使用Azure CLI创建Cosmos DB容器时出现错误“找不到资源”

时间:2019-11-24 23:55:40

标签: azure azure-cosmosdb azure-cli

我正在运行以下命令为我的Cosmos DB创建一个容器,该容器是我从手册中复制并用我的帐户值替换的。

az cosmosdb sql container create -g pluralSight -a pluralsightgreetingbot -d greetingbot -n messages --partition-key-path "/messages"

错误显示“找不到资源”。我仔细检查了输入内容,一切似乎都还可以。

enter image description here

这是输出的完整错误:

Command group 'cosmosdb sql' is in preview. It may be changed/removed in a future release.
Deployment failed. Correlation ID: 13db110d-62e6-4a8e-93f9-27c6fbcde5e9. Message: {"code":"NotFound","message":"Message: {\"Errors\":[\"Resource Not Found\"]}\r\nActivityId: b8e95cb7-0f13-11ea-a134-f4f26d19196a, Request URI: /apps/d56d4719-881c-450a-8a93-f55ae16f5b41/services/01ec4f79-1a4b-4571-8706-a9d9e210e4db/partitions/fff88e8a-d1bf-4dc0-812f-cc8c8b985b82/replicas/132188457808536080s, RequestStats: \r\nRequestStartTime: 2019-11-24T23:40:02.0661568Z, RequestEndTime: 2019-11-24T23:40:02.0661568Z,  Number of regions attempted:1\r\nResponseTime: 2019-11-24T23:40:02.0661568Z, StoreResult: StorePhysicalAddress: rntbd://10.0.0.26:11300/apps/d56d4719-881c-450a-8a93-f55ae16f5b41/services/01ec4f79-1a4b-4571-8706-a9d9e210e4db/partitions/fff88e8a-d1bf-4dc0-812f-cc8c8b985b82/replicas/132188457808536080s, LSN: 3, GlobalCommittedLsn: 3, PartitionKeyRangeId: , IsValid: True, StatusCode: 404, SubStatusCode: 0, RequestCharge: 1, ItemLSN: -1, SessionToken: -1#3, UsingLocalLSN: False, TransportException: null, ResourceType: Database, OperationType: Read\r\nResponseTime: 2019-11-24T23:40:02.0661568Z, StoreResult: StorePhysicalAddress: rntbd://10.0.0.24:11000/apps/d56d4719-881c-450a-8a93-f55ae16f5b41/services/01ec4f79-1a4b-4571-8706-a9d9e210e4db/partitions/fff88e8a-d1bf-4dc0-812f-cc8c8b985b82/replicas/132189292853257376s, LSN: 3, GlobalCommittedLsn: 3, PartitionKeyRangeId: , IsValid: True, StatusCode: 404, SubStatusCode: 0, RequestCharge: 1, ItemLSN: -1, SessionToken: -1#3, UsingLocalLSN: False, TransportException: null, ResourceType: Database, OperationType: Read\r\n, SDK: Microsoft.Azure.Documents.Common/2.7.0"}, Request URI: /dbs/MyDatabase/colls, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0, Microsoft.Azure.Documents.Common/2.7.0

1 个答案:

答案 0 :(得分:2)

您需要首先分别创建数据库资源。收藏创建不会同时创建数据库。相当确定“找不到资源”是仍需要创建的数据库。

这是通过类似的az命令完成的。就您而言,类似:

az cosmosdb sql database create -a pluralsightgreetingbot -g pluralSight -n greetingbot --throughput 400