Microsoft.DBforMySQL /服务器手臂部署上的OperationTimedOut

时间:2018-10-24 14:10:30

标签: azure-resource-manager arm-template

我已经尝试过几次部署以下arm模板(删除为简洁起见成功部署的资源)。
我总是在MySQL部署部分收到以下错误。

New-AzureRmResourceGroupDeployment : 9:21:31 AM - Resource Microsoft.DBforMySQL/servers 'webarm01' failed with
message '{
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "OperationTimedOut",
        "message": "The operation timed out and automatically rolled back. Please retry the operation."
      }
    ]
  }
}'

这是手臂模板

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "administratorLogin": {
            "type": "String"
        },
        "administratorLoginPassword": {
            "type": "SecureString"
        },
        "servers_analytics_name": {
            "defaultValue": "analyticsarmmodel",
            "type": "String"
        },
        "databases_analytics_name": {
            "defaultValue": "analytics",
            "type": "String"
        },
        "location": {
            "type": "string",
            "defaultValue": "[resourceGroup().location]",
            "metadata": {
              "description": "Location for all resources."
            }
          }
    },
    "variables": {
        "databases_sys_name": "sys",
        "databases_mysql_name": "mysql",
        "databases_information_schema_name": "information_schema",
        "databases_performance_schema_name": "performance_schema",
        "firewallRules_AllowAllWindowsAzureIps_name": "AllowAllWindowsAzureIps"
    },
    "resources": [
        {
            "type": "Microsoft.DBforMySQL/servers",
            "sku": {
                "name": "B_Gen5_1",
                "tier": "Basic",
                "family": "Gen5",
                "capacity": 1
            },
            "name": "[parameters('servers_analytics_name')]",
            "apiVersion": "2017-12-01-preview",
            "location": "[parameters('location')]",
            "scale": null,
            "properties": {
                "administratorLogin": "[parameters('administratorLogin')]",
                "administratorLoginPassword": "[parameters('administratorLoginPassword')]",
                "storageProfile": {
                    "storageMB": 5120,
                    "backupRetentionDays": 7,
                    "geoRedundantBackup": "Disabled"
                },
                "version": "5.7",
                "sslEnforcement": "Disabled"
            },
            "dependsOn": []
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('databases_information_schema_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "utf8",
                "collation": "utf8_general_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', parameters('databases_analytics_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "utf8",
                "collation": "utf8_general_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('databases_mysql_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "latin1",
                "collation": "latin1_swedish_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('databases_performance_schema_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "utf8",
                "collation": "utf8_general_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('databases_sys_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "utf8",
                "collation": "utf8_general_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/firewallRules",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('firewallRules_AllowAllWindowsAzureIps_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "startIpAddress": "0.0.0.0",
                "endIpAddress": "0.0.0.0"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        }
    ]
}

我的问题:如何在不超时的情况下使用arm部署MySQL服务器+数据库?

1 个答案:

答案 0 :(得分:0)

与Microsoft进行一些内部讨论之后,即使将administratorLoginPassword参数标记为安全字符串,您也应该输入明文密码。
安全字符串太长,会使部署挂起。
Microsoft正在研究更好的错误消息,并最终适当地支持安全字符串。
另外一些参数可能会冲突,这是一个对我有用的更新模板。

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "administratorLogin": {
            "type": "String"
        },
        "administratorLoginPassword": {
            "type": "SecureString"
        },
        "servers_analytics_name": {
            "defaultValue": "analyticsarmmodel",
            "type": "String"
        },
        "databases_analytics_name": {
            "defaultValue": "analytics",
            "type": "String"
        },
        "location": {
            "type": "string",
            "defaultValue": "[resourceGroup().location]",
            "metadata": {
              "description": "Location for all resources."
            }
          }
    },
    "variables": {
        "databases_sys_name": "sys",
        "databases_mysql_name": "mysql",
        "databases_performance_schema_name": "performance_schema",
        "firewallRules_AllowAllWindowsAzureIps_name": "AllowAllWindowsAzureIps"
    },
    "resources": [
        {
            "type": "Microsoft.DBforMySQL/servers",
            "sku": {
                "name": "B_Gen5_1",
                "tier": "Basic",
                "family": "Gen5",
                "capacity": 1
            },
            "name": "[parameters('servers_analytics_name')]",
            "apiVersion": "2017-12-01-preview",
            "location": "[parameters('location')]",
            "scale": null,
            "properties": {
                "administratorLogin": "[parameters('administratorLogin')]",
                "administratorLoginPassword": "[parameters('administratorLoginPassword')]",
                "storageProfile": {
                    "storageMB": 5120,
                    "backupRetentionDays": 7,
                    "geoRedundantBackup": "Disabled"
                },
                "version": "5.7",
                "sslEnforcement": "Disabled"
            },
            "dependsOn": []
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('databases_information_schema_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "utf8",
                "collation": "utf8_general_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', parameters('databases_analytics_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "utf8",
                "collation": "utf8_general_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/databases",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('databases_mysql_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "charset": "latin1",
                "collation": "latin1_swedish_ci"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        },
        {
            "type": "Microsoft.DBforMySQL/servers/firewallRules",
            "name": "[concat(parameters('servers_analytics_name'), '/', variables('firewallRules_AllowAllWindowsAzureIps_name'))]",
            "apiVersion": "2017-12-01-preview",
            "scale": null,
            "properties": {
                "startIpAddress": "0.0.0.0",
                "endIpAddress": "0.0.0.0"
            },
            "dependsOn": [
                "[resourceId('Microsoft.DBforMySQL/servers', parameters('servers_analytics_name'))]"
            ]
        }
    ]
}
相关问题