This directory contains Terraform modules and a deployment script for provisioning Azure services in LocalStack for Azure. Refer to the ACI Blob Storage guide for details about the sample application.
- LocalStack for Azure: Local Azure cloud emulator for development and testing
- Terraform: Infrastructure as Code tool
- Docker: Container runtime required for LocalStack
- Azure CLI: Azure command-line interface
- azlocal CLI: LocalStack Azure CLI wrapper
pip install azlocalThe deploy.sh script first builds and pushes the Docker image to a pre-created ACR, then the main.tf Terraform module creates the following Azure resources:
- Azure Storage Account: Provides blob storage for vacation activity data.
- Azure Container Instances: Runs the containerized Flask application with public IP and DNS label.
Note: Key Vault is not included in the Terraform deployment as the Azure Terraform provider does not yet support LocalStack's Key Vault URI format. The storage connection string is passed directly to ACI as a secure environment variable.
For more information on the sample application, see ACI Blob Storage.
When using LocalStack for Azure, configure the metadata_host and subscription_id settings in the Azure Provider for Terraform:
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
metadata_host="localhost.localstack.cloud:4566"
subscription_id = "00000000-0000-0000-0000-000000000000"
}cd samples/aci-blob-storage/python
bash terraform/deploy.shbash scripts/cleanup.shTo also clean up Terraform state:
cd terraform
rm -rf .terraform terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl tfplan