Skip to content

Infrastructure as Code (Terraform) Starter Project for a Microsoft Azure Web App

License

Notifications You must be signed in to change notification settings

CaravelLabs/terraform-azure-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

terraform-azure-starter

Infrastructure as Code (Terraform) Starter Project for a Azure Web App with Azure Functions and Azure Cosmos DB backend.

This Terraform project creates the following Azure resources:

  1. Log Analytics Workspace
  2. Application Insights
  3. Linux App Service Plans for Web App and Functions
  4. Web App
  5. Functions App
  6. Storage Account
  7. Azure Cosmos DB
  8. Azure Front Door for Web App

Note: This sample assumes use of local Terraform state, for production scenarios we recommend storing the Terraform state in Azure Storage.

Prerequisites

1. Terraform

Install Terraform CLI

Example for Chocolatey in Windows

choco install terraform

2. Microsoft Azure

a. Resource Group

This starter assumes that the resource group for the solution already exists.

You may follow these instructions to create a resource group.

Once created, please note the name of the resource group as you will need it as part of setting up the Terraform variables.

b. Azure Credentials for Terraform

Terraform also requires credentials with enough permissions to perform the desired actions (in this case, Contributor access to the resource group created above)

Follow these instructions to create a new Service Principal.

Once created, please note the client Id and the client secret as you will need it as part of setting up the Terraform variables.

How to run

Configure your variables

  1. Copy file "terraform.tfvars.sample" and rename to "terraform.tfvars".
  2. Replace the values in this file with the ones obtained during the prerequisite steps.

After configuring your variables, navigate to the src folder from a terminal console and execute the following commands:

Initialize Terraform:

terraform init

Display execution plan:

terraform plan

Deploy infrastructure:

terraform apply

About

Infrastructure as Code (Terraform) Starter Project for a Microsoft Azure Web App

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages