Azure应用程序网关:如何将授权证书添加到httpsettings

时间:2018-01-25 09:35:18

标签: powershell azure azure-cli

以下命令位于powershell中,它将授权证书与新Server:openresty Date:Thu, 25 Jan 2018 09:30:11 GMT Content-Type:text/html; charset=UTF-8 Connection:keep-alive X-Powered-By:PHP/5.5.38 Vary:Origin 一起添加。

{
"countries_info": [
        {"country_name": {
                "1_1_2018": {
                    "allEvents": {
                        "passed": 5,
                        "fails": 2
                    },
                    "city_1_events": {
                        "passed": 2,
                        "fails": 0
                    },
                    "city_2_events": {
                        "passed": 3,
                        "fails": 2
                    }
                },
                "1_2_2018": {
                        "allEvents": {
                            "passed": 4,
                            "fails": 2
                        },
                        "city_1_events": {
                            "passed": 2,
                            "fails": 1
                        },
                        "city_2_events": {
                            "passed": 2,
                            "fails": 0
                        }
                    },
                "all_dates": {
                        "allEvents": {
                            "passed": 9,
                            "fails": 4
                        },
                        "city_1_events": {
                            "passed": 4,
                            "fails": 1
                        },
                        "city_2_events": {
                            "passed": 5,
                            "fails": 3
                        }
                    }
            }},
            {"all_countries": {
                "1_1_2018": {
                    "allEvents": {
                        "passed": 5,
                        "fails": 2
                    },
                    "city_1_events": {
                        "passed": 2,
                        "fails": 0
                    },
                    "city_2_events": {
                        "passed": 3,
                        "fails": 2
                    }
                },
                "1_2_2018": {
                        "allEvents": {
                            "passed": 4,
                            "fails": 2
                        },
                        "city_1_events": {
                            "passed": 2,
                            "fails": 1
                        },
                        "city_2_events": {
                            "passed": 2,
                            "fails": 0
                        }
                    },
                "all_dates": {
                        "allEvents": {
                            "passed": 9,
                            "fails": 4
                        },
                        "city_1_events": {
                            "passed": 4,
                            "fails": 1
                        },
                        "city_2_events": {
                            "passed": 5,
                            "fails": 3
                        }
                    }
            }}
            ]
}

我们如何通过httpsettings CLI(Azure CLI)执行此操作?在那里,我无法找到$poolSetting = New-AzureRmApplicationGatewayBackendHttpSettings -Name 'setting01' -Port 443 -Protocol Https -CookieBasedAffinity Enabled -AuthenticationCertificates $authcert 属性。

1 个答案:

答案 0 :(得分:1)

创建应用程序网关时,没有此类命令。但您可以使用az network application-gateway http-settings update对其进行修改。

请参阅此link

az network application-gateway http-settings create  --gateway-name yugangw-ag-1 -g yugangw-ag  --port 443 -n yugangw-ag-1-be-http-settings  --protocol https
az network application-gateway auth-cert create --cert-file d:\temp\TestCert.cer --gateway-name yugangw-ag-1 -n yugangw-ag-1-auth-cert -g yugangw-ag
az network application-gateway http-settings update  --gateway-name yugangw-ag-1 -g yugangw-ag -n yugangw-ag-1-be-http-settings --add authenticationCertificates id="/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/yugangw-ag/providers/Microsoft.Network/applicationGateways/yugangw-ag-1/authenticationCertificates/yugangw-ag-1-auth-cert"