Hi @Harmeet Kamboj ,
From your first screenshot, the error indicates that the Cosmos DB account name you chose is already in use. Try creating the account with a globally unique name.
From your second screenshot, the error shows that the resource write operation failed and reached the terminal provisioning state 'Failed'
. Means a previous attempt to create a Cosmos DB account with the same name has failed that deployment may still be causing a conflict.
Try with the below code to create Azure Cosmos DB with Mongo using Powershell:
It will create provisioned throughput (RU/s) account, as we use -Kind MongoDB
with New-AzCosmosDBAccount
.
>>$resourceGroup = "*******"
>> $location = "East US"
>> $accountName = "mycosmosmongotest"
>>
>> New-AzResourceGroup -Name $resourceGroup -Location $location
>>
>> New-AzCosmosDBAccount `
>> -ResourceGroupName $resourceGroup `
>> -Name $accountName `
>> -Location $location `
>> -ApiKind MongoDB `
>> -DefaultConsistencyLevel "Session"
Output:
ResourceGroupName : *********
Location : eastus
ProvisioningState : Succeeded
Tags :
ResourceId : /subscriptions/**********/resourceGroups/*********
For more information on Azure Cosmos Mongo DB refer to the below articles,