从密钥库(证书)在应用程序网关中添加 https 侦听器的 Azure CLI 命令是什么?

what is the Azure CLI command to add https listener in application gateway from key-vault (Cert)?

我正在尝试使用 Azure CLI 命令(键入 HTTPs)将侦听器添加到应用程序网关,并且证书在 Key-vault 中可用。我从文档中尝试过,但最终感到困惑。任何人都可以让我知道 azure cli 命令吗?

问题请参考以下脚本。我 运行 Azure 云中的脚本 shell。

  1. 创建用户管理的身份
objId=$(az identity create -g $groupName  -n $msiName --query 'principalId' -o json)
  1. 为 msi 配置访问策略
az keyvault set-policy -n $vaultName --secret-permissions get --object-id $objId
  1. 将 msi 分配给应用程序网关
az network application-gateway identity assign --identity $msiName -g $groupName  --gateway-name $appgwName
  1. 在应用程序网关中创建 ssl 证书

#configure access policy for the account you log in if the account haa no permissions
az keyvault set-policy -n $vaultName --certificate-permissions  create get import list  --upn "<>"
ssl=$(az keyvault certificate show -n test --vault-name $vaultName --query 'sid'  -o json)
#remove the version form cert url
ssl=$(echo ${ssl:1:-1})
sslurl=$(dirname $ssl)
#create ssl
(az network application-gateway ssl-cert create -n mysslcet -g $groupName --gateway-name $appgwName --key-vault-secret-id $sslurl) 
  1. 创建堡垒港口
az network application-gateway frontend-port create  -g $groupName --gateway-name $appgwName -n <port name> --port 448
  1. 创建 HTTP 侦听器
az network application-gateway http-listener create  -n MyHttpListener12 -g $groupName --gateway-name $appgwName --frontend-port <port name> --frontend-ip <appGwPublicFrontendIp name> --ssl-cert <the name of SSL cert you create>