I am trying to restore a dumped DB on Cosmos using mongorestore command but unfortunately it is throwing an error as follows:
error running create command: (Unauthorized) Error=13, Details='Response status code does not indicate success: Forbidden (403); Substatus: 0; ActivityId: 421d33eb-dea0-4372-92b0-ece63fd2b357; Reason: ("Operation 'POST' on resource 'dbs' is not allowed through Azure Cosmos DB endpoint. Please switch on such operations for your account, or perform this operation through Azure Resource Manager, Azure Portal, Azure CLI or Azure Powershell" ActivityId: 421d33eb-dea0-4372-92b0-ece63fd2b357, Microsoft.Azure.Documents.Common/2.11.0, Please see CosmosDiagnostics, Windows/10.0.14393 cosmos-netstandard-sdk/3.3.2); 2020-08-25T20:47:42.088+0530 0 document(s) restored successfully. 0 document(s) failed to restore.
I am following this link provided by Microsoft to migrate data: https://azure.microsoft.com/en-in/resources/videos/using-mongodb-tools-with-azure-cosmos-db/
The command used for restoring the DB is as follows:
mongorestore --host HOSTNAME:PORT -u USERNAME -p PASSWORD --db DBNAME DUMPED_DB_DIRECTORY_PATH --ssl --sslAllowInvalidCertificates
Which account it is referring to enable the operation and How do I enable the operation on my account as highlighted by the logs ? Is there any equivalent of mongorestore in Azure CLI or Portal ?
I tried restoring a single collection also but the same error came up. I was successfully able to dump the data from my another Cosmos DB instance.
mongorestore
command line (just be sure to obfuscate your actual endpoint name and key). As written, it's not entirely clear what that looks like. Also, are you specifying a collection name? – David Makogon