@@ -15,28 +15,39 @@ resource "azurerm_linux_web_app" "tgit" {
1515 service_plan_id = azurerm_service_plan. tgit . id
1616
1717 site_config {
18+ app_command_line = " node server/entry.mjs"
19+
1820 application_stack {
1921 node_version = " 20-lts"
2022 }
2123 }
24+
25+ app_settings = {
26+ " HOST" = " 0.0.0.0"
27+ " COSMOS_ENDPOINT" = azurerm_cosmosdb_account.tgit.endpoint
28+ " COSMOS_KEY" = azurerm_cosmosdb_account.tgit.primary_key
29+ " COSMOS_DATABASE" = " tgit-dashboard"
30+ " WEBAUTHN_RP_NAME" = var.webauthn_rp_name
31+ " WEBAUTHN_RP_ID" = var.webauthn_rp_id
32+ " WEBAUTHN_ORIGIN" = var.webauthn_origin
33+ }
2234}
2335
24- # TODO: Uncomment after App Services are created
25- # # Custom domain
26- # resource "azurerm_app_service_custom_hostname_binding" "tgit_dashboard" {
27- # hostname = "tgit.app"
28- # app_service_name = azurerm_linux_web_app.tgit.name
29- # resource_group_name = azurerm_resource_group.tgit.name
30- # }
31- #
32- # # Managed SSL certificate
33- # resource "azurerm_app_service_managed_certificate" "tgit_dashboard" {
34- # custom_hostname_binding_id = azurerm_app_service_custom_hostname_binding.tgit_dashboard.id
35- # }
36- #
37- # # Bind the certificate to the custom domain
38- # resource "azurerm_app_service_certificate_binding" "tgit_dashboard" {
39- # hostname_binding_id = azurerm_app_service_custom_hostname_binding.tgit_dashboard.id
40- # certificate_id = azurerm_app_service_managed_certificate.tgit_dashboard.id
41- # ssl_state = "SniEnabled"
42- # }
36+ # Custom domain
37+ resource "azurerm_app_service_custom_hostname_binding" "tgit_dashboard" {
38+ hostname = " tgit.app"
39+ app_service_name = azurerm_linux_web_app. tgit . name
40+ resource_group_name = azurerm_resource_group. tgit . name
41+ }
42+
43+ # Managed SSL certificate
44+ resource "azurerm_app_service_managed_certificate" "tgit_dashboard" {
45+ custom_hostname_binding_id = azurerm_app_service_custom_hostname_binding. tgit_dashboard . id
46+ }
47+
48+ # Bind the certificate to the custom domain
49+ resource "azurerm_app_service_certificate_binding" "tgit_dashboard" {
50+ hostname_binding_id = azurerm_app_service_custom_hostname_binding. tgit_dashboard . id
51+ certificate_id = azurerm_app_service_managed_certificate. tgit_dashboard . id
52+ ssl_state = " SniEnabled"
53+ }
0 commit comments