/
main.tf
52 lines (47 loc) · 1.55 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "= 3.45.0"
}
}
required_version = ">= 1.4.6"
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = "rg-func-python-deployment-test"
location = "westeurope"
}
resource "azurerm_storage_account" "st_func" {
name = "stfuncpythondeployment"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_service_plan" "func_plan" {
name = "plan-func-python-deployment-test"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
os_type = "Linux"
sku_name = "Y1"
}
resource "azurerm_linux_function_app" "func" {
name = "func-python-deployment-test"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
service_plan_id = azurerm_service_plan.func_plan.id
storage_account_name = azurerm_storage_account.st_func.name
storage_account_access_key = azurerm_storage_account.st_func.primary_access_key
app_settings = {
AzureWebJobsFeatureFlags = "EnableWorkerIndexing"
FUNCTIONS_WORKER_RUNTIME = "python"
}
site_config {
application_stack {
python_version = "3.10"
}
}
}