代码之家  ›  专栏  ›  技术社区  ›  Evandro Pomatti

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

  •  0
  • Evandro Pomatti  · 技术社区  · 5 年前

    我正在运行以下命令为我的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
    
    0 回复  |  直到 5 年前
        1
  •  2
  •   David Makogon    5 年前

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

    这是用类似的方法完成的 az 命令在您的情况下,类似于:

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