gpt4 book ai didi

azure - 使用 Azure CLI 将 VMSS 添加到应用程序网关的后端池

转载 作者:行者123 更新时间:2023-12-03 06:16:11 26 4
gpt4 key购买 nike

我尝试使用以下方法将 VMSS 添加到应用程序网关的后端池

  1. 使用 az network application-gateway backend-pool add-servers
az network application-gateway address-pool update --resource-group "Resource group name" --gateway-name "Application Gateway name" --name "backend address pool name" --add backendAddresses "ip/fqdn"

实现此目的的唯一方法是使用实​​例的 IP 地址或 FQDN,但我希望能够将整个 VMSS 添加到后端(我们可以使用控制台将 VMSS 添加到后端,但 azure CLI文档没有任何关于添加整个 VMSS 的内容)。

为什么我要添加整个 VMSS?实例可能会在 VMSS 内轮换,并且 ip/fqdn 将发生变化。为什么我只寻找 CLI 命令?我正在编写一个自动化脚本。

  • 更新 VMSS
  • az vmss update --resource-group "resource group name" --name "VMSS name" --set virtualMachineProfile.networkProfile.networkInterfaceConfigurations."[0]".ipConfigurations."[0]".applicationGatewayBackendAddressPools."[]".id="Application Gateway backend address pool id"

    使用此方法时出现以下错误

    Couldn't find '[]' in 'virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations[0].applicationGatewayBackendAddressPools'. 'virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations[0].applicationGatewayBackendAddressPools' does not support further indexing.

    请提出任何替代方法,或者如果您认为我做错了什么,请指出?我还联系了 Azure 支持,他们说添加到应用程序网关后端地址池的唯一方法是使用 IP 地址和 FQDN。

    最佳答案

    我建议在 VMSS 前面使用内部负载均衡器,并将负载均衡器的私有(private) IP 地址用于应用网关后端池。

    关于azure - 使用 Azure CLI 将 VMSS 添加到应用程序网关的后端池,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76233584/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com