Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an SSL certificate to an azure website using powershell?

I am working on automatic deployment + azure. I'm at the point where i'm adding an ssl cert to the website. Does anyone know how to use PowerShell to upload an SSL certificate to a website using the PowerShell command (Add - Get - Set based commands)? I'm able to add a certificate to a cloud service using ...

New-AzureService $Program -Location 'East US'
Add-AzureCertificate -Password Cert123! -ServiceName $Program -CertToDeploy $CertLocation

but I have no idea how to add it to an azure website.

Thanks

edit: I've found a way using the following command, but i'm not wanting to install additional libraries on my production deployment machine.

azure site cert add -k Cert123! $CertLocation $Program
like image 427
CarComp Avatar asked Apr 14 '14 17:04

CarComp


People also ask

How do I import an SSL certificate to Azure?

Import certificate into App ServiceIn the Azure portal, from the left menu, select App Services > <app-name>. From your app's navigation menu, select TLS/SSL settings > Private Key Certificates (. pfx) > Import App Service Certificate. Select the certificate that you just purchased, and then select OK.

How do I add an SSL certificate to Azure application gateway?

Azure portal To renew a listener certificate from the portal, navigate to your application gateway listeners. Select the listener that has a certificate that needs to be renewed, and then select Renew or edit selected certificate. Upload your new PFX certificate, give it a name, type the password, and then select Save.

How do I bind SSL certificate in Azure App Service?

In the Azure portal, from the left menu, select App Services > <app-name>. From the left navigation of your app, start the TLS/SSL Binding dialog by: Selecting Custom domains > Add binding. Selecting TLS/SSL settings > Add TLS/SSL binding.

Where are SSL certificates stored in Azure?

These TLS/SSL certificates can be stored in Azure Key Vault, and allow secure deployments of certificates to Linux virtual machines (VMs) in Azure.


1 Answers

Using the newly released Azure PowerShell v. 1.1.0, you can use the following command to upload a certificate to your website

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

More information is in the following article https://azure.microsoft.com/en-us/documentation/articles/app-service-web-app-powerhell-ssl-binding/

like image 146
Ahmed Elnably Avatar answered Sep 27 '22 18:09

Ahmed Elnably