Using SSL on an Azure AppService website

Certificate request

Generate a certification request using IIS: http://technet.microsoft.com/library/cc732906(WS.10).aspx

Request a certificate from a certificate signing authority

I used GoDaddy – their certificates were pretty cheap for the first year. I will see who to renew through after a year.

Confirm certificate request

http://technet.microsoft.com/library/cc771816(WS.10).aspx

Export certificate

http://technet.microsoft.com/library/cc731386(WS.10).aspx

Configure custom domain on Azure

 

Add the certificate to Azure and create a certificate binding

 

Finally, add a transform to the release configuration of the web.config file (this forces the entire site to use SSL):

<system.webServer>
    <rewrite xdt:Transform="Insert">
      <rules>
        <rule name="RedirectToHTTPS">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
            <add input="{URL}" pattern="/$" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>

 

References

https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-configure-ssl-certificate#bkmk_configuressl

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: