2
votes

I have an angular application that is hosted in an Azure storage account with static website enabled. I'd like to use one of Azure's CDN options. I see that I can force HTTPS using the Verizon Premium offering's rules engine. The problem is that I cannot figure out how to manage the rules other than through the portal.

Any idea if this can be accomplished through an API or Powershell?

I suppose I could even take a step back and ask if there is a better way to force this redirect?

1

1 Answers

1
votes

I am not sure if there is a method to manage the rules other than through the portal, also the rules engine is offered by 3rd party CDN provider.

Take a step back, you could select to use Azure Application Gateway with HTTP to HTTPS redirection. A routing rule is used to redirect HTTP traffic to the HTTPS port in your application gateway. Some things will look like these followings:

  1. Create a CNAME record to map your custom DNS address to your Application Gateway If you want to access it via a custom domain.
  2. Target the primary endpoint value of the static website in the storage account page as the backend of App Gw. (e.g. webstoragetest.z19.web.core.windows.net)
  3. You could create a self-signed certificate for test purpose or get a free cert from https://letsencrypt.org/. Under Listener configuration, select HTTPS, then select Select a file and upload your .pfx file.
  4. Host header overrides in HTTP settings. From HTTP-settings configuration, go to Host name property and provide storage account primary endpoint value.
  5. Suggest not enabling Azure Storage Virtual Network and Firewall Rules at the first time to avoid some network access restriction.

You could get more details from this blog: Static Website hosting in Azure Storage with Custom Domain and SSL support using Azure Application Gateway