Azure Static Website: The account being accessed does not support http
Asked Answered
Z

2

5

I use Static website feature of Azure storage account to host React.js application. There is also a CDN endpoint enable for the site (Microsoft Standard CDN pricing tier), so the site URL looks like https://xxx.azureedge.net/. The problem: when I try to access the site via HTTP protocol, it says:

The account being accessed does not support http.
HttpStatusCode: 400
ErrorCode: AccountRequiresHttps
RequestId : 46959fc9-a01e-006d-2bc5-6b781e000000
TimeStamp : 2020-08-06T07:48:01.6590412Z

I would like the user to be redirected to HTTPS version.

Zalucki answered 6/8, 2020 at 8:3 Comment(1)
Possible duplicate of #63188760Centripetal
C
13

You can allow HTTP without CDN: Under "Settings"->"Configuration" set "Secure tranfer required" to "Disabled".

Screenshot Azure Storage Portal - Secure transfer required

However, for redirecting to HTTPS you need for example CDN.

Centripetal answered 3/12, 2021 at 14:14 Comment(2)
For new Azure user, this page is located in the Blob Storage Account. In additional, to configure it via Terraform, it is set by enable_https_traffic_only in azurerm_storage_account. :)Ioab
worked perfectly , thank youEscharotic
Z
8

The solution was found in Microsoft documentation https://learn.microsoft.com/en-us/azure/cdn/cdn-standard-rules-engine#redirect-users-to-https It says that the redirection from HTTP to HTTPS can be configured in the Rules engine of CDN endpoint. It makes sense to keep in mind that:

  • the rules will not be applied immediately, in my case it started to work in 10 minutes.
  • the Rules engine is available for Standard Microsoft and Premium Verizon.
Zalucki answered 6/8, 2020 at 8:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.