This repository demonstrates the integration of Azure Functions with HTTP Triggers, Cosmos DB, and a Vue.js Single Page Application (SPA) secured by Azure EntraID (Azure AD). It illustrates the construction of a secure, scalable, and serverless application using modern front-end frameworks and cloud services.
- A POSIX-compliant system, such as:
- GitHub Codespaces
- Azure Linux VM (Standard_B1s VM recommended)
- Windows 11 with Windows Subsystem for Linux
- .NET 8 SDK
- Azure CLI
- Git
- Taskfile
- Terraform
Note: GitHub Codespaces comes pre-configured with all necessary tools. Use this link to open the project in GitHub Codespaces. Note: The script ./.devcontainer/post-create.sh can be used to install the tools on a Linux VM.
Deployment is automated using Taskfile, simplifying the deployment process without a CI/CD pipeline. The Taskfile provides a consistent way to execute commands and scripts.
task up
: Builds the complete environmenttask down
: Destroys all Azure resources and cleans up Terraformtask deploy-api
: Builds and deploys the API to Azure Functionstask deploy-maintenance
: Deploys the maintenance functiontask deploy-ui
: Builds and deploys the UI to Azure Static Web Appstask host-key
: Retrieves the host key for the Azure Functiontask init
: Initializes Terraformtask plan
: Creates a Terraform plan
The TaskFile is located in the root of the repository and includes default values that can be customized:
Name | Usage | Default Value |
---|---|---|
TAG | Value used in Azure Tags | password-vault |
DEFAULT_REGION | Default region to deploy to | canadacentral |
COSMOSDB_FREE_TIER | Use the Cosmos DB free tier | false |
DEPLOY_MAINTENANCE | Deploy Azure Functions for Keep Alives | false |
ADD_CUSTOM_DOMAIN | Add a custom domain to Azure Static Web Apps | false |
APP_REQUIRES_AUTHENTICATION | Require authentication for the UI | true |
- An Azure subscription (MSDN subscription is sufficient)
- An account with owner permissions on the Azure subscription and Global Admin on the Azure AD tenant
- Warning: Follow this guide to configure Terraform with a Service Principal.