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

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay