Skip to content

Commit 8d0a544

Browse files
committed
Image pull from public registry
1 parent 24d3ba4 commit 8d0a544

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

code/infra/function.tf

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ resource "azapi_resource" "function" {
6868
serverFarmId = azurerm_service_plan.service_plan.id
6969
storageAccountRequired = false
7070
vnetContentShareEnabled = true
71-
vnetImagePullEnabled = true
71+
vnetImagePullEnabled = false # Set to 'true' when pulling image from private Azure Container Registry
7272
virtualNetworkSubnetId = azapi_resource.subnet_function.id
7373
vnetRouteAllEnabled = true
7474
siteConfig = {
@@ -105,30 +105,6 @@ resource "azapi_resource" "function" {
105105
name = "FUNCTIONS_EXTENSION_VERSION"
106106
value = "~4"
107107
},
108-
{
109-
name = "FUNCTIONS_WORKER_RUNTIME"
110-
value = "python"
111-
},
112-
{
113-
name = "FUNCTIONS_WORKER_SHARED_MEMORY_DATA_TRANSFER_ENABLED"
114-
value = "1"
115-
},
116-
{
117-
name = "DOCKER_SHM_SIZE"
118-
value = "268435456"
119-
},
120-
{
121-
name = "DOCKER_REGISTRY_SERVER_URL"
122-
value = var.function_container_registry_url
123-
},
124-
{
125-
name = "PYTHON_THREADPOOL_THREAD_COUNT"
126-
value = "None"
127-
},
128-
{
129-
name = "PYTHON_ENABLE_DEBUG_LOGGING"
130-
value = "0"
131-
},
132108
{
133109
name = "WEBSITE_CONTENTOVERVNET"
134110
value = "1"
@@ -137,22 +113,6 @@ resource "azapi_resource" "function" {
137113
name = "WEBSITE_RUN_FROM_PACKAGE"
138114
value = "0"
139115
},
140-
{
141-
name = "WEBSITES_ENABLE_APP_SERVICE_STORAGE"
142-
value = "false"
143-
},
144-
{
145-
name = "PYTHON_ENABLE_WORKER_EXTENSIONS"
146-
value = "1"
147-
},
148-
{
149-
name = "ENABLE_ORYX_BUILD"
150-
value = "1"
151-
},
152-
{
153-
name = "SCM_DO_BUILD_DURING_DEPLOYMENT"
154-
value = "1"
155-
},
156116
{
157117
name = "AzureWebJobsStorage__accountName"
158118
value = azurerm_storage_account.storage.name
@@ -165,6 +125,46 @@ resource "azapi_resource" "function" {
165125
name = "AzureWebJobsSecretStorageKeyVaultUri"
166126
value = azurerm_key_vault.key_vault.vault_uri
167127
},
128+
{
129+
name = "WEBSITES_ENABLE_APP_SERVICE_STORAGE" # Disable when not running a container
130+
value = "false"
131+
},
132+
{
133+
name = "DOCKER_REGISTRY_SERVER_URL" # Disable when not running a container
134+
value = var.function_container_registry_url
135+
},
136+
# {
137+
# name = "FUNCTIONS_WORKER_RUNTIME" # Enable when running Python directly on the Function host
138+
# value = "python"
139+
# },
140+
# {
141+
# name = "FUNCTIONS_WORKER_SHARED_MEMORY_DATA_TRANSFER_ENABLED" # Enable when running Python directly on the Function host
142+
# value = "1"
143+
# },
144+
# {
145+
# name = "DOCKER_SHM_SIZE" # Enable when running Python directly on the Function host
146+
# value = "268435456"
147+
# },
148+
# {
149+
# name = "PYTHON_THREADPOOL_THREAD_COUNT" # Enable when running Python directly on the Function host
150+
# value = "None"
151+
# },
152+
# {
153+
# name = "PYTHON_ENABLE_DEBUG_LOGGING" # Enable when running Python directly on the Function host
154+
# value = "0"
155+
# },
156+
# {
157+
# name = "PYTHON_ENABLE_WORKER_EXTENSIONS" # Enable when running Python directly on the Function host
158+
# value = "1"
159+
# },
160+
# {
161+
# name = "ENABLE_ORYX_BUILD" # Enable when running Python directly on the Function host
162+
# value = "1"
163+
# },
164+
# {
165+
# name = "SCM_DO_BUILD_DURING_DEPLOYMENT" # Enable when running Python directly on the Function host
166+
# value = "1"
167+
# },
168168
{
169169
name = "MY_SECRET_CONFIG"
170170
value = "@Microsoft.KeyVault(SecretUri=${azurerm_key_vault_secret.key_vault_secret_sample.id})"

0 commit comments

Comments
 (0)