The following requirements are needed:
- An Azure subscription
-
Azure CLI
- Please refer to the install guide for detailed install instructions.
-
Terraform
- Download
- Please refer to the install cli for detailed install instruction.
-
Visual Studio Code Extension "Terraform"
-
Terraform specific
-
Clone this repository
-
Create the following Azure resources with Terraform:
- Azure SQL with the following settings
- Authentication: SQL and Microsoft Entra authentication enabled
- Networking: Allow Azure services and resources to access this server enabled
- Azure Blob Storage account
- Azure SQL with the following settings
-
Generate a SAS URL for the blob storage container. Set the expiry date according to the planned lifecycle of your application.
-
Run the cells in the
create-database.ipynb
notebook to create the Azure SQL Database.
Terraform expects to be invoked from a working directory that contains configuration files written in the Terraform language. Terraform uses configuration content from this directory, and also uses the directory to store settings, cached plugins and modules, and sometimes state data.
A working directory must be initialized before Terraform can perform any operations in it (like provisioning infrastructure or modifying state).
A Terraform working directory typically contains:
- A Terraform configuration describing resources Terraform should manage. This configuration is expected to change over time.
- A hidden .terraform directory, which Terraform uses to manage cached provider plugins and modules, record which workspace is currently active, and record the last known backend configuration in case it needs to migrate state on the next run. This directory is automatically managed by Terraform, and is created during initialization.
- State data, if the configuration uses the default local backend. This is managed by Terraform in a terraform.tfstate file (if the directory only uses the default workspace) or a terraform.tfstate.d directory (if the directory uses multiple workspaces).
All modules have the same structure: The modules are designed so that they can be executed separately and are independent of each other.
All required variables are already specified. However, these can be customized accordingly.
Description: Must be specified, e.g. East US
.
Defines the Azure region in which region bound resources are to be deployed.
Run terraform init to initialize a working directory that contains a Terraform configuration. This command downloads the Azure provider required to manage the Azure resources. The -upgrade parameter upgrades the necassary provider plugins to the newest version that complies with the configurations version constraints.
terraform init -upgrade
Run terraform plan to create an execution plan.
terraform plan
Run terraform apply to apply the execution plan.
terraform apply