“错误”;“未找到资源”;使用Azure CLI创建Cosmos DB容器

“错误”;“未找到资源”;使用Azure CLI创建Cosmos DB容器,azure,azure-cosmosdb,azure-cli,Azure,Azure Cosmosdb,Azure Cli,我正在运行以下命令为我的Cosmos DB创建一个容器,我从手册中复制了该容器,并将其替换为我的帐户值 az cosmosdb sql container create -g pluralSight -a pluralsightgreetingbot -d greetingbot -n messages --partition-key-path "/messages" 错误为“未找到资源”。我仔细检查了我的输入,似乎一切正常 这是作为输出的完整错误: Command group 'cosmo

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

az cosmosdb sql container create -g pluralSight -a pluralsightgreetingbot -d greetingbot -n messages --partition-key-path "/messages"
错误为“未找到资源”。我仔细检查了我的输入,似乎一切正常

这是作为输出的完整错误:

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

您需要首先单独创建数据库资源。集合创建不会同时创建数据库。非常确定“未找到资源”是仍然需要创建的数据库

这是通过类似的
az
命令完成的。在您的情况下,类似于:

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

如果仔细阅读错误,您将注意到以下内容:
ResourceType:Database
,因此您的假设可能是正确的。