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

Azure Application Gateway : How to add authorization certificate to httpsettings

以下命令在 powershell 中,它添加了授权证书以及新的 httpsettings

$poolSetting = New-AzureRmApplicationGatewayBackendHttpSettings -Name 'setting01' -Port 443 -Protocol Https -CookieBasedAffinity Enabled -AuthenticationCertificates $authcert

我们如何通过 az CLI (Azure CLI) 执行此操作?在那里我找不到 AuthenticationCertificates 属性。

创建应用网关时,没有这个命令。但是你可以用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"