Skip to content

Instantly share code, notes, and snippets.

@lAnubisl
Created August 30, 2022 15:29
Show Gist options
  • Save lAnubisl/24d551d348736d1b1852f4c486b65dc8 to your computer and use it in GitHub Desktop.
Save lAnubisl/24d551d348736d1b1852f4c486b65dc8 to your computer and use it in GitHub Desktop.
Microsoft.Azure.WebJobs.Script: WorkerConfig for runtime: dotnet-isolated not found.
variable "project_name" {
type = string
}
variable "tags" {
type = map(any)
default = {
Environment = "Production"
}
}
# Configure the Azure provider
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0.2"
}
}
required_version = ">= 1.1.0"
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = "rg-${var.project_name}"
location = "westeurope"
tags = var.tags
}
resource "azurerm_storage_account" "st" {
name = "st${var.project_name}"
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" "plan" {
name = "plan-${var.project_name}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
os_type = "Linux"
sku_name = "Y1"
tags = var.tags
}
resource "azurerm_linux_function_app" "func" {
name = "func-${var.project_name}"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
storage_account_name = azurerm_storage_account.st.name
storage_account_access_key = azurerm_storage_account.st.primary_access_key
service_plan_id = azurerm_service_plan.plan.id
enabled = true
functions_extension_version = "~4"
https_only = true
identity {
type = "SystemAssigned"
}
site_config {
application_stack {
dotnet_version = "6.0"
use_dotnet_isolated_runtime = true
}
app_scale_limit = 1
}
tags = var.tags
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment