在负载均衡器下部署 VM 在 Azure 中出现错误

Deploying a VM under load balancer gives me an error in Azure

我有一个 VN 和其中的两个子网,我正在创建一个在区域 1 上没有 public IP 的 VM。然后我创建了一个负载平衡并创建了一个后端池并将后端池放入与 VM 相同的 VN。

我现在尝试将后端池与 VM 相关联。正如我所说,我的 VM 在 Zone1 中。当我尝试将我的 VM 关联到负载均衡器的后端池时,出现以下错误

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\": {\r\n \"code\": \"ComputeResourceZoneConstraintDoesNotMatchPublicIPAddressZoneConstraint\",\r\n \"message\": \"Compute resource /subscriptions/69c94256-2d95-43fa-8c2e-ac669cdb621d/resourceGroups/thermo-breast-cancer-rg/providers/Microsoft.Compute/virtualMachines/thermo-breast-cancer-devvm1 has a zone constraint 1 but the PublicIPAddress /subscriptions/69c94256-2d95-43fa-8c2e-ac669cdb621d/resourceGroups/thermo-breast-cancer-rg/providers/Microsoft.Network/publicIPAddresses/12.12.25.25 used by the compute resource via NetworkInterface or LoadBalancer has a different zone constraint Regional.\",\r\n \"details\": []\r\n }\r\n}"}]}

我不知道我哪里做错了?

您可以创建一个标准 负载均衡器,而不是使用与后端 VM 区域相同的区域的基本 SKU。

To align and guarantee your frontend and backend with a single zone, only place virtual machines within the same zone into the corresponding backend pool.

To address virtual machines across multiple zones, place virtual machines from multiple zones into the same backend pool.

阅读 Standard Load Balancer and Availability Zones 了解更多详情。