Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am facing the below error with azure function app blob trigger deployed with terraform

D:a1ssrcRequestProcessor.cs:line 196 2021-01-08T14:24:46.222 [Error] Executed 'Functions.BlobTrigger1' (Failed, Id=973f1e27-3dc2-43d3-9463-7cac64bf56b7, Duration=6625ms)Result: FailureException: Failed to install function app dependencies. Error: 'No 'requirements.psd1' is found at the function app root folder: C:homesitewwwroot.

I have used this https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/function_app for creating terraform code, by using the above document and other reference in google, i have written the below code in main.tf

app_settings = {
        FUNCTIONS_WORKER_RUNTIME = var.FUNCTIONS_WORKER_RUNTIME
        FUNCTIONS_WORKER_RUNTIME_VERSION = var.FUNCTIONS_WORKER_RUNTIME_VERSION

Assigned the variable in variable.tf as below

variable "FUNCTIONS_WORKER_RUNTIME"{
    default = "PowerShell" 
}

variable "FUNCTIONS_WORKER_RUNTIME_VERSION" {
    default = "~7"
}

But still could not able to see PowerShell Core Version in the app.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
761 views
Welcome To Ask or Share your Answers For Others

1 Answer

After my validation, you could set the value of FUNCTIONS_WORKER_RUNTIME to "powershell" instead of "PowerShell" and add the version = "~3". It will automatically install the function app dependencies requirements.psd1.

resource "azurerm_function_app" "example" {
  name                       = "urewwwwfunctiona"
  location                   = azurerm_resource_group.example.location
  resource_group_name        = azurerm_resource_group.example.name
  app_service_plan_id        = azurerm_app_service_plan.example.id
  storage_account_name       = azurerm_storage_account.example.name
  storage_account_access_key = azurerm_storage_account.example.primary_access_key

  app_settings = {
        FUNCTIONS_WORKER_RUNTIME = "powershell"
        FUNCTIONS_WORKER_RUNTIME_VERSION = "~7"
       
  }

  version = "~3"

}

enter image description here

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...