Login to Azure by in a terminal.
az loginInside the Prepare folder update the subscription_id in setup.tf.
You can get the current subscription with this az command.
az account subscription listThen plan and execute the Terraform plan.
terraform plan -out out.plan
terraform apply out.planTo see the hidden password show the output as JSON.
terraform output --jsonCopy hte displayed values for client_id, tenant_id, subscription_id into the Training/main.tf file and also update it for all students.
The password will be needed later on all student devices as well.
- install Terraform https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
- optionally, bookmark the documentatation website for the task
- check out the code repo and update the variables in
Training/main.tf
Open Powershell and set the provided client secret.
$env:TF_VAR_client_secret=You can check the environment variables with this command.
dir env:For Bash, set it like this.
export TF_VAR_client_secret=You can check the environment variables with this command.
env | sort- check out the code repo
- install the dependencies for the presentation using
npm i - run the presentation like
npm start -- --port=8001
Open the presentation at http://localhost:8001
Use S to open the speaker notes and F for full screen.
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_app#env
resource "azurerm_container_app" "hello-world-app" {
name = "hello-world-app-${random_integer.ri.result}"
container_app_environment_id = data.azurerm_container_app_environment.app_env.id
resource_group_name = data.azurerm_resource_group.rg.name
revision_mode = "Single"
template {
container {
name = "hello-world"
image = "docker.io/dannyt74/hello-express:v2"
cpu = 0.25
memory = "0.5Gi"
env {
name = "SECRET_CODE"
value = "secret"
}
}
}
ingress {
target_port = 3000
external_enabled = true
traffic_weight {
latest_revision = true
percentage = 100
}
}
}