Host SXA Site in Azure with AWS Subdomain

This article shows how to set up an SXA Site hosted in Azure PaaS to use a domain purchased and hosted through AWS. Assuming that you have access to both Azure and AWS Dashboard, follow the instructions below:

Prepare AWS Subdomain via Route 53

  • Click on the Hosted Zones link
  • You will see a list of Hosted Zones. Click on any Hosted Zone that you would like to add your subdomain into.
  • In the selected Hosted Zone page, click on Create Record
  • In the Quick Create Record, populate the following fields:
  • For the Record name, input your desired subdomain name. For the Record type, select CNAME and for Value, follow the instructions below to get the value.

Connect AWS Subdomain to Azure Custom Domain

  • Login to Azure PaaS portal (https://portal.azure.com)
  • Navigate to your target App Service > then click Settings from the side blade > Custom Domains
  • Under the Assigned Custom Domains section, copy the bottommost value. You could find this value from other places in the App Service but this would be a good place where the complete domain is shown.
  • Going back to the AWS Quick Create Record dialog, paste this value to the Value field. Then Create Records.
  • Now that you have the AWS Subdomain ready to point traffic to your Azure App Service, proceed with adding a custom domain from the Custom Domains page by clicking on the + Add custom domain button.
  • A side bar will appear from the right side of the page. Enter the subdomain then click Validate.
  • Another options would slide down. Make sure that the Hostname record type should be CNAME. And when you see the green checks confirming Hostname availability and Domain ownership, click the Add custom domain.
  • You should now see your custom domain listed in the Assigned Custom Domains section
  • Note that your newly added custom domain is not secure. Secure it with SSL by clicking the Add binding link to show a side bar that will appear from the right side of the page.
  • Choose your Private Certificate Thumbprint with the subdomain specified or a wildcard (e.g. *.domain.com) which is prepared separately.
  • And select the TLS/SSL Type. In our case we used Server Name Identification (SNI-SSL). Click Add Binding. You should see no error on your custom domain now.
  • NOTE: However, you might encounter weird Azure bug that does not show the binding fields as shown above, but instead, Certificate provision is required.
  • If you already have your certificate set up correctly, you should not see this. But if you have and see this the first time right after creating a custom domain, just close the side bar then click the Add binding again. The binding fields should appear.

Connect Sitecore SXA Site to the Azure Custom Domain

  • Login to your target Sitecore CM
  • Navigate to /sitecore/content/<Tenant>/<Site>/Settings/Site Grouping/<Site Name>
  • Point the Host Name to the one you created in AWS. You could also append a pipe-delimited authoring (cm) subdomain here together with the cd subdomain.
  • You’re set! Visit the Sitecore CM or CD instance now using the new subdomain.

Leave a Reply