Azure 模板 : Parameter 'osProfile' is not allowed and Required parameter 'osProfile' is missing

标签 azure azure-virtual-machine azure-deployment azure-autoscaling-block azure-vm-scale-set

我正在尝试使用 VHD 创建自动缩放,这是我的模板:

...
{
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "sku": {
    "name": "[parameters('vmSize')]",
    "tier": "Standard",
    "capacity": "[parameters('instanceCount')]"
  },
  "name": "[variables('namingInfix')]",
  "apiVersion": "2016-03-30",
  "location": "[variables('location')]",
  "tags": {
    "displayName": "VMScaleSet"
  },
  "properties": {
    "overprovision": "true",
    "upgradePolicy": {
      "mode": "Manual"
    },
    "virtualMachineProfile": {
      "storageProfile": {
        "osDisk": {
          "name": "vmname",
          "osType": "Linux",
          "caching": "ReadWrite",
          "vhd": {
            "uri": "https://myvhd.vhd"
          },
          "createOption": "Attach"
        }
      },
      "osProfile": {
        "computerNamePrefix": "[parameters('vmSSName')]",
        "adminUsername": "[parameters('adminUsername')]",
        "adminPassword": "[parameters('adminPassword')]"
      },
      "networkProfile": {
      }
    }
  }
}
...

不幸的是,当我传递osProfile时,我收到了这个错误:

Parameter 'osProfile' is not allowed. (Code: InvalidParameter)

但是如果我删除 osProfile 我收到此错误:

Required parameter 'osProfile' is missing (null). (Code: InvalidParameter)

最佳答案

看来这里的问题是“createOption”:“Attach” 您需要直接从镜像创建规模集的 VM。 IE。 “createOption”:“fromImage”。

关于Azure 模板 : Parameter 'osProfile' is not allowed and Required parameter 'osProfile' is missing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37625738/

相关文章:

azure - 如何在 Windows Azure 上设置具有 2 个不同区域的连接虚拟机

iis - 发布到 Azure VM 后对 Web 应用程序进行更改

angular - 在 Azure 中部署 Angular 应用程序,但刷新时出现 URL 重写模块错误

azure - 无法发布azure函数

node.js - azure cosmosdb 中的更新插入功能

c# - Braintree所有交易搜索

powershell - 如何在 VSTS 任务中使用最新的 AzureRM

Azure VM 定价 - 拥有 80 台单核机器还是 10 台 8 核机器更好?

c# - 一个 Function App 中包含多个已编译的库

azure - 无法使用 ARM 模板创建服务