1

I am running the following command to create a container for my Cosmos DB, that I copied from the manual and replaced with my account values.

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

Error says "Resource not found". I double checked my inputs and all seem to be OK.

enter image description here

This is the complete error as output:

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 Answer 1

2

You need to create your database resource first, separately. Collection-creation doesn't create the database at the same time. Pretty sure the "resource not found" is the database that still needs to be created.

This is done with a similar az command. In your case, something like:

az cosmosdb sql database create -a pluralsightgreetingbot -g pluralSight -n greetingbot --throughput 400 
Sign up to request clarification or add additional context in comments.

1 Comment

if you read through the error carefully you will notice the following: ResourceType: Database, so your assumption is probably correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.