0

对于带有自定义图像和 elb 的 VMSS,我遇到了以下错误

我的模板链接:https ://github.com/linuxgambler/azure/blob/master/vmss_elb.json

错误:“错误”:{“详细信息”:[{“代码”:“未找到”,“消息”:“资源 /subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-WEST/providers/未找到 Microsoft.Network/loadBalancers/AZURE-TESLB。” } ], "code": "InvalidResourceReference", "message": "Resource /subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-WEST/providers/Microsoft.Network/loadBalancers/AZURE-TESLB 引用通过资源 /subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-West/providers/Microsoft.Compute/virtualMachineScaleSets/azure-tes 未找到。

4

1 回答 1

0

您需要将dependsOn属性添加到 VMSS 定义。

"type": "Microsoft.Compute/virtualMachineScaleSets",
"name": "[variables('vmssName')]",
"location": "[resourceGroup().location]",
"apiVersion": "2016-04-30-preview",
"dependsOn": [
    "[variables('lbID')]"
],
"sku": {
    "name": "[parameters('vmSku')]",
    "tier": "Standard",
    "capacity": "[parameters('instanceCount')]"
},

现在它是在负载均衡器之前创建的,这就是它出错的原因。

于 2017-06-20T08:50:43.167 回答