@@ -13,12 +13,59 @@ resource "azurerm_storage_account" "storeacc" {
13
13
location = azurerm_resource_group. site . location
14
14
account_tier = " Standard"
15
15
account_replication_type = " ZRS"
16
+ allow_blob_public_access = true
16
17
17
18
static_website {
18
19
index_document = " index.html"
19
20
}
20
21
}
21
22
22
- output "container" {
23
- value = azurerm_storage_account. storeacc . primary_web_host
23
+ locals {
24
+ frontend_endpoint = " pandas-prs"
25
+ backend_pool = " container"
26
+ load_balancing = " pandas-prs"
27
+ health_probe = " pandas-prs"
28
+ }
29
+
30
+ resource "azurerm_frontdoor" "prs" {
31
+ name = " pandas-prs"
32
+ resource_group_name = azurerm_resource_group. site . name
33
+ enforce_backend_pools_certificate_name_check = false
34
+
35
+ routing_rule {
36
+ name = " exampleRoutingRule1"
37
+ accepted_protocols = [" Http" , " Https" ]
38
+ patterns_to_match = [" /*" ]
39
+ frontend_endpoints = [local . frontend_endpoint ]
40
+ forwarding_configuration {
41
+ forwarding_protocol = " MatchRequest"
42
+ backend_pool_name = local. backend_pool
43
+ }
44
+ }
45
+
46
+ backend_pool_load_balancing {
47
+ name = local. load_balancing
48
+ }
49
+
50
+ backend_pool_health_probe {
51
+ name = local. health_probe
52
+ }
53
+
54
+ backend_pool {
55
+ name = local. backend_pool
56
+ backend {
57
+ host_header = azurerm_storage_account. storeacc . primary_web_host
58
+ address = azurerm_storage_account. storeacc . primary_web_host
59
+ http_port = 80
60
+ https_port = 443
61
+ }
62
+
63
+ load_balancing_name = local. load_balancing
64
+ health_probe_name = local. health_probe
65
+ }
66
+
67
+ frontend_endpoint {
68
+ name = local. frontend_endpoint
69
+ host_name = " pandas-prs.azurefd.net"
70
+ }
24
71
}
0 commit comments