DEV Community

Srinivasulu Paranduru for cloudteachable

Posted on

IAC - Azure WebApp creation

Step1: Terraform provider section

    terraform {
        required_providers {
            azurerm ={
                source = "hashicorp/azurerm"
                version="3.17.0"
            }
        }  
    }

Enter fullscreen mode Exit fullscreen mode

Step2: Provider section of azurerm

Refer to article to get mentioned details required to be provided in azurerm provider - https://dev.to/srinivasuluparanduru/azure-service-principal-creation-step-by-step-approach-2a46

provider "azurerm" {
        subscription_id = ""
        tenant_id = ""
        client_id = ""
        client_secret = ""    

        features {

        }
    }

Enter fullscreen mode Exit fullscreen mode

Step3: Azure resource group creation

resource "azurerm_resource_group" "example" {
        name     = "template-grp"
        location = "North Europe"
    }
Enter fullscreen mode Exit fullscreen mode

Step4: Azure service plan

resource "azurerm_service_plan" "plan202407" {
        name                = "plan202407"
        resource_group_name = azurerm_resource_group.example.name
        location            = "North Europe"
        os_type             = "Windows"
        sku_name            = "F1"
    }
Enter fullscreen mode Exit fullscreen mode

Step5: Creation of Azure web app

resource "azurerm_windows_web_app" "example" {
        name                = "examplewebapp"
        resource_group_name = azurerm_resource_group.example.name
        location            = azurerm_service_plan.example.location
        service_plan_id     = azurerm_service_plan.example.id

        site_config {
            always_on = false
            application_stack {
                current_stack = "dotnet"
                dotnet_Version = "v6.0"
            }
        }
        depends_on= [
                azurerm_service_plan.plan202407
        ]
    }

Enter fullscreen mode Exit fullscreen mode

References:
1.Service Plan

2.Azure webapp

Conclusion : Creation of Azure webapp using IAC - Terraform
💬 If you enjoyed reading this blog post and found it informative, please take a moment to share your thoughts by leaving a review and liking it 😀 and follow me in dev.to , linkedin

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay