Friday, March 11, 2016

Installing SSL on Microsoft Azure VM IIS


Install the cert on IIS
https://www.digicert.com/ssl-certificate-installation-microsoft-iis-8.htm

If you go through these steps successfully but the certificate you just created disappears, you will need to import the private key. This happens if you created the certificate request on a different computer.

Export the private key from the originating computer, then import it to the target server
https://www.digicert.com/ssl-support/pfx-import-export-iis-7.htm

Add a new endpoint for HTTPS on Azure. If you do not do this, you will get a "webpage not available" error when trying to load the website via https.
http://stackoverflow.com/questions/31965713/how-i-add-new-endpoints-to-my-vm-on-new-azure-portal-preview

If you want to redirect all traffic to https, you will need to add an entry in your Web.config. Under the <system.webserver><rewrite><rules>, create a new <rule>:

<rule name="https-redirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect"  url="https://www.99restaurants.com/{R:1}" redirectType="Permanent" />
</rule>