Skip to content

[[ 🔷 Mirrored from Azure DevOps 🔷]] Deploy Azure Web Apps for Python and Nodejs, configured to Azure Active Directory.

Notifications You must be signed in to change notification settings

kwame-mintah/terraform-azure-aad-web-apps

Repository files navigation

UoW Infrastructure Terraform

This repository will deploy Azure Web Apps and configure Azure Active Directory (AAD) for the UoW Frontend App1 and UoW Backend App2.

Note

This repository was created within Azure DevOps and is now being mirrored to this GitHub repository. Source of truth will always be the Azure DevOps repository. Furthermore, this repository is a proof of concept to demonstrate deploying a Frontend and Backend service via Azure Web Apps so YMMV.

Development

Dependencies

Prerequisites

  1. Have a Azure Portal account.
  2. You will need to create a Service Principal with a Client Secret follow instructions.

Usage

  1. Navigate to the environment you would like to deploy,
  2. Plan your changes with terragrunt plan to see what changes will be made,
  3. If you're happy with the changes terragrunt apply.

Please note that .tfstate files are stored locally on your machine as no backend has been specified. If you would like to properly version control your state files, it is possible to use an S3 bucket to store these files. This will ensure anyone else other than you running a plan/apply will always be using the same state file.

Pre-Commit hooks

Git hook scripts are very helpful for identifying simple issues before pushing any changes. Hooks will run on every commit automatically pointing out issues in the code e.g. trailing whitespace.

To help with the maintenance of these hooks, pre-commit is used, along with pre-commit-hooks.

Please following these instructions to install pre-commit locally and ensure that you have run pre-commit install to install the hooks for this project.

Additionally, once installed, the hooks can be updated to the latest available version with pre-commit autoupdate.

Documentation Generation

Code formatting and documentation for variables and outputs is generated using pre-commit-terraform hooks that in turn uses terraform-docs that will insert/update documentation. The following markers have been added to the README.md:

<!-- {BEGINNING|END} OF PRE-COMMIT-TERRAFORM DOCS HOOK --->

Requirements

Name Version
terraform = 1.4.5
azurerm 3.58.0

Providers

Name Version
azurerm 3.58.0

Modules

Name Source Version
aad_applications ./modules/aad_application_registration n/a
linux_web_apps ./modules/linux_web_apps n/a

Resources

Name Type
azurerm_resource_group.resource_group resource
azurerm_client_config.current data source

Inputs

Name Description Type Default Required
add_app_owners Add additional owners to the application registration,
by defualt the caller is added.
string "" no
add_web_redirect_uris Add additional redirect uris the application registration,
comma seperated and a valid uri.
string "" no
arm_client_id The Client ID which should be used. This can also be sourced
from the ARM_CLIENT_ID Environment Variable.
string n/a yes
arm_client_secret The Client Secret which should be used. This can also be sourced
from the ARM_CLIENT_SECRET Environment Variable.
string n/a yes
arm_subscription_id The Subscription ID which should be used. This can also be sourced
from the ARM_SUBSCRIPTION_ID Environment Variable.
string n/a yes
arm_tenant_id The Tenant ID which should be used. This can also be sourced
from the ARM_TENANT_ID Environment Variable.
string n/a yes
cloud_enviornment The Cloud Environment which should be used. Possible values are public,
usgovernment, german, and china. Defaults to public. This can also be
sourced from the ARM_ENVIRONMENT Environment Variable.
string "public" no
common_tags Tags to be added to resources created. map(string) {} no
environment The name of the environment to help identify resources. string n/a yes
location The Azure Region where the resource should exist. string "West Europe" no
project The name of the Azure DevOps project the resource belongs to. string n/a yes
web_app_service_plan The app service pricing plan. string "F1" no

Outputs

Name Description
aad_application_client_secret_value The secret value for this application, which is generated by Azure AD.
aad_applications_id Azure AD application id.
linux_web_app_nodejs_site The url to the nodejs web app
linux_web_app_python_site The url to the python web app.
tenant_id The tenant ID used for this subscription.

Footnotes

  1. My Azure DevOps organisation / project is private, FastAPI repository is mirrored here in GitHub. ↩

  2. My Azure DevOps organisation / project is private, NextJS repository is mirrored here in GitHub. ↩

About

[[ 🔷 Mirrored from Azure DevOps 🔷]] Deploy Azure Web Apps for Python and Nodejs, configured to Azure Active Directory.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages