Logo

dev-resources.site

for different kinds of informations.

IAC - Azure WebApp creation

Published at
6/30/2024
Categories
azure
iac
terraform
Author
srinivasuluparanduru
Categories
3 categories in total
azure
open
iac
open
terraform
open
Author
20 person written this
srinivasuluparanduru
open
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

iac Article's
30 articles in total
Favicon
Customize VPCs with CloudFormation Conditions
Favicon
Provision EKS Cluster with Terraform, Terragrunt & GitHub Actions
Favicon
Terraform - Mastering Idempotency Violations - Handling Resource Conflicts and Failures in Azure
Favicon
OpenTofu - Infrastructure configuration management
Favicon
Goliat Shield: Your first line of defense
Favicon
Using CloudFormation to deploy a web app with HA
Favicon
KCL + Crossplane: A Declarative Language for Deploying Complex Infrastructure on AWS with Kubernetes.
Favicon
Terraform Remote Backend: How to Manage Terraform State File for Easier Collaboration across Teams
Favicon
Let's Talk Infrastructure as Code (IaC) šŸš€
Favicon
Conditional deployment in Azure Bicep
Favicon
Learning Ansible, Proxmox and LXC, Part 1
Favicon
Create your K3S lab on Google Cloud
Favicon
Mastering Multi-Cloud Infrastructure with Terraform: A Game-Changer for Modern IT
Favicon
The KISS Principle: Why Simplicity is Key in Dev and DevOps (and How to Implement It)
Favicon
user-defined type in Azure Bicep, an introduction
Favicon
You Are Not Saved By IaC
Favicon
Terraform Tactics: A Guide to Mastering Terraform Commands for DevOps
Favicon
Infrastructure as Code with Terraform
Favicon
What is Infrastructure as Code (IaC) and Why It's Transforming DevOps
Favicon
Managing Infrastructure as Code at Amazon: Tools, Strategies, and Practices
Favicon
Automating AWS Cost and Usage Report with CloudFormation
Favicon
Crossplane + AWS Overview for Managing Infrastructure as Code (IaC) with Kubernetes
Favicon
How IaC can streamline the Infrastructure & Configuration
Favicon
Secure Terraform Solution for Government Agencies
Favicon
IAC - Azure WebApp creation
Favicon
Terraform pipeline (IaC for AWS)
Favicon
Terraform
Favicon
ARM Template: Azure SQL Server
Favicon
9 Ways to Spin Up an EKS Cluster - Way 3 - eksctl
Favicon
What is Infrastructure as Code (IaC)?

Featured ones: