azure - Azure 负载均衡器的 ARM 模板部署失败 - Jenkins 未给出任何错误

标签 azure jenkins azure-load-balancer

我当前正在尝试部署 Azure 负载均衡器实例以提供对两个防火墙的负载均衡访问。这是为了提供伪 HA 配置。

但是,当我尝试使用 Jenkins 部署此模板时,它给出了以下无用的响应(即使使用 --debug 命令):

DEBUG: attempting to read file Test/deployment/azuredeploy.json as utf-8-sig
DEBUG: attempting to read file Test/parameters/deploymentParameters.json as utf-8-sig
DEBUG: No tty
available.
ERROR:

所以它说有一个错误,但无法告诉我错误是什么。

我有两个请求:

  1. 有人可以告诉我如何找出导致此错误的原因吗?有什么我不知道的命令或工具吗?

  2. 如果有人熟悉 ARM 的 Azure 负载均衡器语法,那么您可以关注我的部署模板,并让我知道它是否有任何直接缺陷。代码如下。

代码:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "virtualNetworkName": {
            "type": "string",
            "metadata": {
                "description": "vnet name"
            }
        },
        "subnet1Name": {
            "type": "string",
            "metadata": {
                "description": "Subnet 1 name"
            }
        },
        "subnet2Name": {
            "type": "string",
            "metadata": {
                "description": "Subnet 2 name"
            }
        },
        "loadBalancerName": {
            "type": "string",
            "metadata": {
                "description": "name of the load balancer instance"
            }
        },
        "nicName1": {
            "type": "string",
            "metadata": {
                "description": "name of NIC 1"
            }
        },
        "nicName2": {
            "type": "string",
            "metadata": {
                "description": "name of NIC 2"
            }
        },
        "nicName3": {
            "type": "string",
            "metadata": {
                "description": "name of NIC 3"
            }
        },
        "nicName4": {
            "type": "string",
            "metadata": {
                "description": "name of NIC 4"
            }
        },
        "location": {
            "type": "string",
            "defaultValue": "[resourceGroup().location]",
            "metadata": {
                "description": "Location for all resources."
            }
        }
    },
    "variables": {
        "virtualNetworkName": "[parameters('virtualNetworkName')]",
        "subnet1Name": "[parameters('subnet1Name')]",
        "subnet2Name": "[parameters('subnet2Name')]",
        "loadBalancerName": "[parameters('loadBalancerName')]",
        "nicName1": "[parameters('nicName1')]",
        "nicName2": "[parameters('nicName2')]",
        "nicName3": "[parameters('nicName3')]",
        "nicName4": "[parameters('nicName4')]",
        "subnetRef1": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnet1Name'))]",
        "subnetRef2": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnet2Name'))]"
    },
    "resources": [
        {
            "apiVersion": "2018-08-01",
            "type": "Microsoft.Network/networkInterfaces",
            "name": "[variables('nicName1')]",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/loadBalancers/', variables('loadBalancerName'))]"
            ],
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig-firewallBE",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef1')]"
                            },
                            "loadBalancerBackendAddressPools": [
                                {
                                    "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')),'/backendAddressPools/firewallBE-subnet-pool')]"
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2018-08-01",
            "type": "Microsoft.Network/networkInterfaces",
            "name": "[variables('nicName2')]",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/loadBalancers/', variables('loadBalancerName'))]"
            ],
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig-firewallBE",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef1')]"
                            },
                            "loadBalancerBackendAddressPools": [
                                {
                                    "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')),'/backendAddressPools/firewallBE-subnet-pool')]"
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2018-08-01",
            "type": "Microsoft.Network/networkInterfaces",
            "name": "[variables('nicName3')]",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/loadBalancers/', variables('loadBalancerName'))]"
            ],
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig-firewallFE",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef2')]"
                            },
                            "loadBalancerBackendAddressPools": [
                                {
                                    "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')),'/backendAddressPools/firewallFE-subnet-pool')]"
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2018-08-01",
            "type": "Microsoft.Network/networkInterfaces",
            "name": "[variables('nicName4')]",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/loadBalancers/', variables('loadBalancerName'))]"
            ],
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig-firewallFE",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef2')]"
                            },
                            "loadBalancerBackendAddressPools": [
                                {
                                    "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')),'/backendAddressPools/firewallFE-subnet-pool')]"
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "apiVersion": "2017-08-01",
            "name": "[variables('loadBalancerName')]",
            "type": "Microsoft.Network/loadBalancers",
            "location": "[parameters('location')]",
            "sku": {
                "name": "Standard"
            },
            "properties": {
                "frontendIPConfigurations": [
                    {
                        "name": "firewallBE-FrontEnd",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef1')]"
                            }
                        }
                    },
                    {
                        "name": "firewallFE-FrontEnd",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef2')]"
                            }
                        }
                    }
                ],
                "backendAddressPools": [
                    {
                        "name": "firewallBE-subnet-pool"
                    },
                    {
                        "name": "firewallFE-subnet-pool"
                    }
                ],
                "loadBalancingRules": [
                    {
                        "properties": {
                            "frontendIPConfiguration": {
                                "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')), '/frontendIpConfigurations/firewallBE-FrontEnd')]"
                            },
                            "backendAddressPool": {
                                "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')), '/backendAddressPools/firewallBE-subnet-pool')]"
                            },
                            "probe": {
                                "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')), '/probes/firewall-lb-probe')]"
                            },
                            "protocol": "All",
                            "frontendPort": 0,
                            "backendPort": 0
                        },
                        "name": "firewallBE-subnet-rule"
                    },
                    {
                        "properties": {
                            "frontendIPConfiguration": {
                                "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')), '/frontendIpConfigurations/firewallFE-FrontEnd')]"
                            },
                            "backendAddressPool": {
                                "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')), '/backendAddressPools/firewallFE-subnet-pool')]"
                            },
                            "probe": {
                                "id": "[concat(resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName')), '/probes/firewall-lb-probe')]"
                            },
                            "protocol": "All",
                            "frontendPort": 0,
                            "backendPort": 0
                        },
                        "name": "firewallFE-subnet-rule"
                    }
                ],
                "probes": [
                    {
                        "properties": {
                            "protocol": "Tcp",
                            "port": 0,
                            "intervalInSeconds": 15,
                            "numberOfProbes": 2
                        },
                        "name": "firewall-lb-probe"
                    }
                ]
            }
        }
    ]
}          

最佳答案

在本例中,错误是由于缺少需要传递给模板的参数

关于azure - Azure 负载均衡器的 ARM 模板部署失败 - Jenkins 未给出任何错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54042290/

相关文章:

javascript - 调试azure sdk(如何显示相关的REST API)

asp.net - 如何在 REST Web 服务中处理使用 100 Continue?

jenkins - 在 Jenkins 中测试 Docker 集群

azure - 如何在使用 Terraform 创建时将 Health Probe id 添加到 LB 规则

Azure kubernetes - 具有内部负载均衡器的 Istio Controller

Azure TCP 分段和 HTTP block

azure - .NET Core 2.2 无法发布到 Azure

github - Gulp不会在 Jenkins (Jenkins)工作

java - 强制 Jenkins 返回稳定版本?

azure - 如何更新 VMSS 以使用 Azure 中的现有 LB