@@ -40,7 +40,9 @@ resource "azapi_resource" "function" {
4040 scmSiteAlsoStopped = false
4141 serverFarmId = azurerm_service_plan.service_plan.id
4242 storageAccountRequired = false
43+ vnetContentShareEnabled = true
4344 virtualNetworkSubnetId = azapi_resource.subnet_function.id
45+ vnetRouteAllEnabled = true
4446 siteConfig = {
4547 autoHealEnabled = false
4648 acrUseManagedIdentityCreds = false
@@ -66,6 +68,10 @@ resource "azapi_resource" "function" {
6668 name = " WEBSITE_CONTENTOVERVNET"
6769 value = " 1"
6870 },
71+ {
72+ name = " WEBSITE_RUN_FROM_PACKAGE"
73+ value = " 1"
74+ },
6975 {
7076 name = " AzureWebJobsStorage__accountName"
7177 value = azurerm_storage_account.storage.name
@@ -75,10 +81,10 @@ resource "azapi_resource" "function" {
7581 detailedErrorLoggingEnabled = true
7682 functionAppScaleLimit = 0
7783 functionsRuntimeScaleMonitoringEnabled = false
78- ftpsState = " FtpsOnly "
84+ ftpsState = " Disabled "
7985 http20Enabled = false
8086 ipSecurityRestrictionsDefaultAction = " Deny"
81- linuxFxVersion = " Python|3.10 "
87+ linuxFxVersion = " Python|${ var . python_version } "
8288 localMySqlEnabled = false
8389 loadBalancing = " LeastRequests"
8490 minTlsVersion = " 1.2"
@@ -89,7 +95,6 @@ resource "azapi_resource" "function" {
8995 scmIpSecurityRestrictionsUseMain = false
9096 scmIpSecurityRestrictionsDefaultAction = " Deny"
9197 use32BitWorkerProcess = true
92- vnetRouteAllEnabled = true
9398 vnetPrivatePortsCount = 0
9499 webSocketsEnabled = false
95100 }
@@ -131,3 +136,25 @@ resource "azurerm_monitor_diagnostic_setting" "diagnostic_setting_function" {
131136 }
132137 }
133138}
139+
140+ resource "azurerm_private_endpoint" "function_private_endpoint" {
141+ name = " ${ azapi_resource . function . name } -pe"
142+ location = var. location
143+ resource_group_name = azurerm_resource_group. app_rg . name
144+ tags = var. tags
145+
146+ custom_network_interface_name = " ${ azapi_resource . function . name } -nic"
147+ private_service_connection {
148+ name = " ${ azapi_resource . function . name } -pe"
149+ is_manual_connection = false
150+ private_connection_resource_id = azapi_resource. function . id
151+ subresource_names = [" sites" ]
152+ }
153+ subnet_id = azapi_resource. subnet_services . id
154+ private_dns_zone_group {
155+ name = " ${ azapi_resource . function . name } -arecord"
156+ private_dns_zone_ids = [
157+ var . private_dns_zone_id_sites
158+ ]
159+ }
160+ }
0 commit comments