There is any way to create APP service (API app) using terraform.

Customer service 0 Reputation points
2024-08-02T06:08:48.4566667+00:00

Hi Team, I'm Jai From India there is any way to create APP service (API8293-842719 app) using terraform. Because I'm getting to create App service only for web app in IAC. Kindly let me know if there is other option also.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,986 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Konstantinos Passadis 19,596 Reputation points MVP
    2024-08-04T15:18:55.5266667+00:00

    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 {}

    }

    1. Although the resource is called azurerm_app_service, it supports all types of App Services, including Web Apps, API Apps, and Mobile Apps.
    2. 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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.