我有以下的ARM資源Azure的ARM dependson數據庫條款
{
"name": "[parameters('dbServerName')]",
"type": "Microsoft.Sql/servers",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "SqlServer"
},
"apiVersion": "2014-04-01-preview",
"properties": {
"administratorLogin": "[parameters('dbuser')]",
"administratorLoginPassword": "[parameters('dbpassword')]",
"version": "12.0"
},
"resources": [
{
"name": "[parameters('dbName')]",
"type": "databases",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "[parameters('dbName')]"
},
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[parameters('dbServerName')]"
],
"properties": {
"edition": "[parameters('edition')]",
"collation": "[parameters('collation')]",
"maxSizeBytes": "[parameters('maxSizeBytes')]",
"requestedServiceObjectiveName": "[parameters('requestedServiceObjectiveName')]"
}
},
{
"name": "[parameters('hivedbName')]",
"type": "databases",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "[parameters('hivedbName')]"
},
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[parameters('dbServerName')]"
],
"properties": {
"edition": "[parameters('edition')]",
"collation": "[parameters('collation')]",
"maxSizeBytes": "[parameters('maxSizeBytes')]",
"requestedServiceObjectiveName": "[parameters('requestedServiceObjectiveName')]"
}
},
{
"name": "[parameters('ooziedbName')]",
"type": "databases",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "[parameters('ooziedbName')]"
},
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[parameters('dbServerName')]"
],
"properties": {
"edition": "[parameters('edition')]",
"collation": "[parameters('collation')]",
"maxSizeBytes": "[parameters('maxSizeBytes')]",
"requestedServiceObjectiveName": "[parameters('requestedServiceObjectiveName')]"
}
},
{
"type": "firewallrules",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[parameters('dbServerName')]"
],
"location": "[resourceGroup().location]",
"name": "AllowAllWindowsAzureIps",
"properties": {
"endIpAddress": "0.0.0.0",
"startIpAddress": "0.0.0.0"
}
}
]
},
希望有以上,所以我嘗試添加在dependson按照我的下一個資源
[concat('Microsoft.Sql/servers,'/',parameters('dbServerName'),'/databases/',parameters('hivedbName'))]
另一個資源dependson卻得到了以下錯誤:
New-AzureRmResourceGroupDeployment : 4:46:59 PM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'Circular dependency detected on resource: '/subscriptions/######/resourceGroups/QA/providers/Microsoft.Sql/servers/sparkqa/databases/SparkQAHive'.
然後我試了
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('dbServerName'))]",
"[concat('Microsoft.Sql/servers,'/',parameters('dbServerName'),'/databases/',parameters('hivedbName'))]"
],
但它仍然開始甚至concat('Microsoft.Sql/servers,'/',parameters('dbServerName'),'/databases/',parameters('hivedbName'))
之前部署的資源創建
下面是完整的模板https://paste.fedoraproject.org/454465/14767382/raw/
任何人都知道什麼是錯在這裏?
後的變化 – itaysk
後,我已經添加了鏈接,完整模板的完整的JSON模板,在此情況下的https:/ /paste.fedoraproject.org/454465/14767382/raw/ – roy
因此HDInsight集羣是在SQL Server和DB之前創建的?你怎麼看? – itaysk