设置Azure ARM模板serverfarm的sku名称和层

时间:2015-10-27 16:23:36

标签: json azure

我们正在使用Azure资源管理器创建部署模板。我们几乎所有设置都已设置,但创建的主机规划没有获得正确的定价等级。无论我们使用什么价值观,它似乎总是默认为免费' ' F1'定价计划。

这是

部分
{
        "apiVersion": "2015-08-01",
        "type": "Microsoft.Web/serverfarms",
        "name": "[variables('sitePlanName')]",
        "location": "[resourceGroup().location]",
        "sku": {
            "name": "B1",
            "tier": "Basic",
            "capacity": 1
        },
        "properties": {
            "numberOfWorkers": 1
        }
    },

任何想法都会非常感激。

此致

2 个答案:

答案 0 :(得分:6)

您可以尝试在"属性中指定SKU" serverfarms描述的节点,类似于:

{
  "apiVersion":"2015-08-01",
  "name":"[variables('hostingPlanName')]",
  "type":"Microsoft.Web/serverfarms",
  "location":"[resourceGroup().location]",
  "properties":{
    "name":"[variables('hostingPlanName')]",
    "sku":"Basic",
    "workerSize":"1"
    "numberOfWorkers":1
  }
}

" sku"的可能值是:免费,共享,基本,标准,高级

对于基本,标准和高级SKU," workerSize"可能的值可以是0(小),1(中)或2(大):

"sku": {
    "type": "string",
        "allowedValues": [
            "Free",
            "Shared",
            "Basic",
            "Standard",
            "Premium"
        ],
        "defaultValue": "Free"
    },
    "workerSize": {
        "type": "string",
        "allowedValues": [
            "0",
            "1",
            "2"
        ],
        "defaultValue": "0"
    }
}

希望这有帮助。

于连

答案 1 :(得分:3)

尝试使用此资源块(适用于我)来创建S1实例:

  {
      "apiVersion": "2015-08-01",
      "type": "Microsoft.Web/serverfarms",
      "name": "[parameters('hostingPlanName')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "name": "[parameters('hostingPlanName')]",
        "workerSize": "0",
        "numberOfWorkers": 1
      },
      "sku": {
        "name": "S1",
        "tier": "Standard",
        "size": "S1",
        "family": "S",
        "capacity": "1"
      }
    }

对于基本层使用此sku:

"sku": {
        "name": "B1",
        "tier": "Basic",
        "size": "B1",
        "family": "B",
        "capacity": 1
      }