This demonstration presents a simple product catalog service that's deployable to an Azure Container App resource. The build artifact is hosted in GitHub Packages.
This demo uses the following technologies:
- Docker & Docker Compose
- SQL Server on Linux
- .NET Core 6.0
- Azure Functions (Isolated worker)
- Azure Functions HTTP triggers
- Entity Framewok Core (with Migrations and Compiled Models)
- Terraform
After installing the prerequirements, follow these instructions:
- Checkout the source
- Open the folder in VS Code
- Install the recommended extensions
- Copy the connection string from docker-compose.yml, replacing server name with
localhost
- Open a shell prompt, and
- Set the SQL_CONNECTION_STRING environment variable's value to the connection string from step #4
- Issue
docker compose --project-directory "src" up -d
- You can now reach the API at
http://localhost:32741/api/products
endpoint.- Copy the function key from
host_secrets.json
and supply the value either viacode
query parameter or viax-functions-key
header
- Copy the function key from
- Issue
docker compose --project-directory "src" stop
to stop the containers
After installing the prerequirements, follow these instructions:
- Get yourself an Azure Subscription to which you want to deploy resources
- Go to Azure Portal, and copy the subscription ID to clipboard
- Install the necessary Terraform CLI and Az CLI tools to your computer
- Go to the
deploy/azure
folder, and runterraform init
- Run
terraform apply
and paste the subscription ID when prompted - Type in
yes
to begin deploying the resources - Remember to use
terraform destroy
afterwards to remove the resources