Create a web app bot with azurerm_bot_web_app

when using azure portal to create a web app bot, it creates 3 resources (typically) :

  • Web App Bot
  • App Service Plan
  • App Service

but when i use azurerm_bot_web_app it creates only the Web App Bot, anyone has an idea on how to replicate azure portal’s behavior? , especially configuring the app service

What i used, I also want to activate a directline channel:

resource "azurerm_application_insights_api_key" "full_permissions" {
  name                    = "${azurerm_application_insights.test.name}-full-permissions-api-key"
  application_insights_id = azurerm_application_insights.test.id
  read_permissions        = ["agentconfig", "aggregate", "api", "draft", "extendqueries", "search"]
  write_permissions       = ["annotations"]
}

resource "azurerm_bot_web_app" "test" {
  name                = module.naming.bot_web_app.name
  resource_group_name = azurerm_resource_group.test.name
  location            = "global"
  sku                 = "F0"
  microsoft_app_id    = module.service_principal["bot"].application_id
  endpoint            = "https://${module.naming.bot_web_app.name}.azurewebsites.net/api/messages"

  developer_app_insights_key            = azurerm_application_insights.test.instrumentation_key
  developer_app_insights_api_key        = azurerm_application_insights_api_key.full_permissions.api_key
  developer_app_insights_application_id = azurerm_application_insights.test.app_id
}

resource "azurerm_bot_channel_directline" "test" {
  bot_name            = azurerm_bot_web_app.test.name
  location            = azurerm_bot_web_app.test.location
  resource_group_name = azurerm_resource_group.test.name

  site {
    name    = "default"
    enabled = true
  }
}