Hello @Customer Service
Welcome to Microsoft QnA!
The same resource as Azure We Apps is used for API Web App!
You can go agead and do it as the dcumentation provides
EXAMPLE :
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_service_plan" "example" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
os_type = "Linux"
sku_name = "P1v2"
}
resource "azurerm_linux_web_app" "example" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_service_plan.example.location
service_plan_id = azurerm_service_plan.example.id
site_config {}
}
- Although the resource is called
azurerm_app_service
, it supports all types of App Services, including Web Apps, API Apps, and Mobile Apps. - You can further customize the
site_config
block based on your API's requirements, such as enabling WebSockets, configuring the default document, etc.
--
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards