Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/infrastructure/create-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,16 @@ Add the infrastructure secrets to the _inf_ key vault `kv-lungcs-[environment]-i

- assign yourself "Key Vault Secrets User" to application key vault to run the terraform code from the CLI inside the AVD when first trying to deploy the application.
- assign yourself "Data Blob Reader" to State file storage account to run the terraform code from the CLI inside the AVD when first trying to deploy the application.

## Connect to Postgres Database

- Add your user as a member to the respective Entra ID group:
- `postgres_lungcs_[environment]_uks_admin`
Comment thread
mrlockstar marked this conversation as resolved.
- Log into the correct ADV for your environment type (either nonlive or live)
- Run the following commands on the CLI to log into the database: -
- `export PGPASSWORD="$(az account get-access-token --resource https://ossrdbms-aad.database.windows.net --query accessToken --output tsv)"`
- `psql "host=postgres-lungcs-[environment]-uks.postgres.database.azure.com \
port=5432 \
dbname=[database] \
user=postgres_lungcs_[environment]_uks_admin \
sslmode=require"`
35 changes: 35 additions & 0 deletions infrastructure/modules/container-apps/alerts.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
resource "azurerm_monitor_scheduled_query_rules_alert_v2" "five_hundred_error_alert" {
count = var.enable_alerting ? 1 : 0

auto_mitigation_enabled = false
description = "An alert triggered by 500 errors logged in code"
enabled = var.enable_alerting
evaluation_frequency = "PT5M"
location = var.region
name = "${var.app_short_name}-500-error-alert"
resource_group_name = azurerm_resource_group.main.name
scopes = [var.action_group_id]
severity = 2
skip_query_validation = false
window_duration = "PT5M"
workspace_alerts_storage_enabled = false

action {
action_groups = [var.action_group_id]
}

criteria {
operator = "GreaterThan"
query = <<-QUERY
ContainerAppConsoleLogs_CL
| where Log contains "[ERROR]"
QUERY
threshold = 0
time_aggregation_method = "Count"

failing_periods {
minimum_failing_periods_to_trigger_alert = 1
number_of_evaluation_periods = 1
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ yaml
jq
choco
CLI
nonlive
Loading