I am trying to create new azure function app that has azure functions(HTTPtrigger) as part of it. I am able to create function app with terraform but i am not able find a way to create azure functions as part of it. Have checked Hashicorp azurem docs and i couldnt find it there.
Here is how i am creating azure function app
resource "azurerm_function_app" "example" {
name = "functionapptest"
location = var.location
resource_group_name = var.resource_group_name
app_service_plan_id = var.functionappplan.id
storage_connection_string = azurerm_storage_account.functionapptestsa.primary_blob_connection_string
#storage_account_access_key = ""
app_settings = {
APPINSIGHTS_INSTRUMENTATIONKEY = azurerm_application_insights.app_insight.instrumentation_key
}
Is there a way to create HTTPtriggers with terraform?
CodePudding user response:
using Terraform you'll create the infrastructure (where your code should run on). In your case, it's the azure function app.
The triggering part, is code responsibility and the reason why you can't find / create it using Terraform.
All you need to do, is deploy the Azure Function project, which contains functions triggered by Http (or whatever the trigger mechanism you're using).