This repo contains the code examples and slides for the "Host Azure OpenAI securely with Terraform" talk which was held at the DWX 2024 conference by Kenny Pflug in Nuremberg, Germany.
Please make sure that you have the following prerequisites installed and configured:
- a bash with Azure CLI and Terraform
- please make sure that you are logged in to Azure and that the correct subscription is selected
# Log in to Azure via the CLI
az login
# Show the credentials that are currently active (account + selected subscriptions)
az account show
# Show all available subscriptions
az account list --output table
# Set the currently active subscription - replace subscription-id with the desired value from the table
az account set --subscription subscription-id
You can then deploy the whole whole solution by executing:
./deploy.sh
This will perform the following three tasks:
- Deploy the "global" terraform project (creates a resource group and container registry)
- Uploads the source code in the "code" foldter to the container registry which then builds the docker image
- Deploy the "workload" terraform project
This will take roughly 10 minutes. The deploy script will return the URL of the Azure Container App.