在 Azure 的应用程序网关的 ARM 中获取动态 IP

Fetching dynamic IP in ARM of Application gateway in Azure

在应用程序网关分配 IP 地址后,我们能否在输出中提取 动态 分配的 public IP 地址,静态 IP 地址工作正常。

  {
            "type": "Microsoft.Network/publicIPAddresses",
            "apiVersion": "2019-04-01",
            "name": "[variables('publicIpName')]",
            "location": "[resourceGroup().location]",
            "condition": "[variables('usePublicIp')]",
            "properties": {
                "publicIPAllocationMethod": "Dynamic"
            }
        },

        "outputs": {
            "IpAddress": {
            "type": "String",
            "value": "reference(variables('publicIpName')).IpAddress]"
        }
    }

错误:

github issue 解决了与您相同的问题。

有一个解决问题的技巧,这个模板可以帮助您理解如何:https://github.com/Azure/azure-quickstart-templates/tree/master/201-application-gateway-webapp-iprestriction

希望对您有所帮助!