I want to deploy an Azure Front Door with a backend linked to the Static Website of a Storage Account. If I use Azure Portal there's no problem, but I can't get how to retrieve the Primary Static Website's Endpoint ?
Moreover, the Primary Endpoint goes out like https://saprodgamingfiles.z6.web.core.windows.net/
but for the backend host name we want saprodgamingfiles.z6.web.core.windows.net
.
How to automate the creation of the Front Door backend related to the Storage Account's Static Website Primary Endpoint ?
Synthesis
I want to automate the following host_header
and address
from the Azure Front Door Terraform config...
backend {
host_header = "saprodgamingfiles.z6.web.core.windows.net"
address = "saprodgamingfiles.z6.web.core.windows.net"
http_port = 80
https_port = 443
priority = 1
weight = 50
}
... related to the static website created as such with the Storage Account :
resource "azurerm_storage_account" "saprodgamingfiles" {
name = var.sa_name1
resource_group_name = azurerm_resource_group.rg-prod-gaming.name
# etc...
# THIS : Pre-requisite for Azure Front Door
static_website {}
}
I'm new to Terraform & Azure, but I searched a lot and I couldn't find a satisfying solution to my problem. I'm surprised it's not raised as much, maybe I'm just missing something ?
Best
You could use primary_web_host in the backend,
Output the value of
You will see
So the backend will like this: