5

In the CosmosDB emulator v1.22.0.0 I can't create a collection with the following properties:

CollectionName: HuntAttendees StorageCapacity: Unlimited PartitionKey: /accountId Throughput: 10000

I've narrowed it down to having to do with the StorageCapacity and partitionkey. The value I specify for the partitionkey doesn't make a different. If I remove the partitionKey value and change the StorageCapacity to Fixed it works fine.

An unrelated issue is that the email address listed in the error doesn't exist.

Error:

{"code":503,"body":"{\"code\":\"ServiceUnavailable\",\"message\":\"Sorry, we are currently experiencing high demand in this region, and cannot fulfill your request at this time. We work continuously to bring more and more capacity online, and encourage you to try again. Please do not hesitate to email docdbswat@microsoft.com at any time or for any reason.\r\nActivityId: 589c9444-4a48-4536-9ce7-da1e29717afe, Microsoft.Azure.Documents.Common/1.22.0.0\"}","activityId":"589c9444-4a48-4536-9ce7-da1e29717afe","substatus":1007}

  • Well that's interesting. If I set all the values for the collection including partitionkey and then change it back to fixed but don't delete the partitionkey value then it create the collection as specified WITH the partitionkey and storage capacity set to unlimited. Unfortunately this doesn't help my code to deal with this bug. I guess for this ONE collection I'll have to manually create as needed. – Robin Sanner Jul 17 '18 at 18:57

1 Answers1

2

My colleague and I had the same issue, the reason is: the local emulator is restricted with only 25 single-partition collections.

You can increase the quantity by performing these steps:

  • Delete all local Azure Cosmos DB Emulator data by right-clicking the Azure Cosmos DB Emulator icon on the system tray, and then clicking Reset Data….

  • Delete all emulator data in this folder %LOCALAPPDATA%\CosmosDBEmulator. [NB]: I think better to exit all instances at first from the next step and then delete this data.

  • Exit all open instances by right-clicking the Azure Cosmos DB Emulator icon on the system tray, and then clicking Exit. It may take a minute for all instances to exit.

  • Install the latest version of the Azure Cosmos DB Emulator.

  • Launch the emulator with the PartitionCount flag by setting a value <= 250. For example: C:\Program Files\Azure Cosmos DB Emulator>
    Microsoft.Azure.Cosmos.Emulator.exe /PartitionCount=100.

And there is already a nice answer to this question: https://stackoverflow.com/a/51617916/6095199