且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将证书添加到Azure的RM网站使用PowerShell

更新时间:2023-11-24 23:46:22

在Azure中的PowerShell 1.1.0的最新版本,有一些新的指令来处理Azure的Web应用程序的SSL证书

In the latest release of Azure PowerShell v 1.1.0, there is a number of new commands to handle SSL certificates in Azure Web Apps

您可以上传证书并将其绑定到使用主机名

You can upload the certificate and bind it to hostname using

New-AzureRmWebAppSSLBinding -ResourceGroupName myresourcegroup -WebAppName mytestapp -CertificateFilePath PathToPfxFile -CertificatePassword PlainTextPwd -Name www.contoso.com

然后删除绑定,但不删除证书,应用程序应该能够添加一个应用程序设置引用该证书后使用它(这应该使用门户来完成 - PowerShell命令这样做将很快到来 - 无ETA现在)

And then remove the binding but without removing the certificate, the app should be able to use it after you add a app setting referencing that cert (this should be done using the portal - the PowerShell command to do so will come soon - No ETA for now)

Remove-AzureRmWebAppSSLBinding -ResourceGroupName myresourcegroup -WebAppName mytestapp -Name www.contoso.com -DeleteCertificate $false