我正在尝试使用ARM模板(特别是针对API版本2019-08-01)为CosmosDB帐户创建/更新Gremlin db及其吞吐量。
创建帐户没有问题,但是我似乎无法创建数据库。
如果以前有人这样做,我将非常感谢一些提示!
模板:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
},
"variables": {
},
"resources": [
{
"type": "Microsoft.DocumentDb/databaseAccounts",
"name": "[concat('sec-', uniqueString('unique','dbName'))]",
"kind": "GlobalDocumentDB",
"apiVersion": "2019-08-01",
"location": "eastus2",
"properties": {
"capabilities": [
{
"name": "EnableGremlin"
}
],
"databaseAccountOfferType": "Standard",
"isVirtualNetworkFilterEnabled": false,
"virtualNetworkRules": [
],
"ipRangeFilter": "",
"enableMultipleWriteLocations": false,
"locations": [
{
"locationName": "East US 2",
"failoverPriority": 0,
"id": "[concat(concat('sec-', uniqueString('unique','dbName')), '-', 'eastus2')]"
}
]
},
"resources": [
],
"dependsOn": [
]
},
{
"type": "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases",
"name": "[concat('gremlinDatabases/', 'gremlinDB')]",
"apiVersion": "2019-08-01",
"properties": {
"options": {
"Throughput": 800
},
"resource": {
"id": "gremlinDB"
}
},
"dependsOn": [
"[resourceId('Microsoft.DocumentDb/databaseAccounts',concat('sec-', uniqueString('unique','dbName')))]"
]
}
]
}
错误消息:
New-AzureRmResourceGroupDeployment : 6:17:06 PM - Resource Microsoft.DocumentDB/databaseAccounts/gremlinDatabases 'gremlinDatabases/gremlinDB' failed with message '{
"error": {
"code": "ResourceNotFound",
"message": "The Resource 'Microsoft.DocumentDB/databaseAccounts/gremlinDatabases' under resource group 'my-resource-group-name' was not found."
}
}'
At C:\dev\PoshArm-Deployment\src\PoshArmDeployment\Public\Publish-ArmResourceGroup.ps1:68 char:33
+ ... $deploymentResult = New-AzureRmResourceGroupDeployment @deployment
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet