Skip to content

Commit d2fcc69

Browse files
authored
Merge branch 'main' into PPHA-713-Participants-eligible-for-incentive
2 parents 0eea078 + c05c1d1 commit d2fcc69

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

docs/infrastructure/create-environment.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,16 @@ Add the infrastructure secrets to the _inf_ key vault `kv-lungcs-[environment]-i
133133

134134
- 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.
135135
- 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.
136+
137+
## Connect to Postgres Database
138+
139+
- Add your user as a member to the respective Entra ID group:
140+
- `postgres_lungcs_[environment]_uks_admin`
141+
- Log into the correct ADV for your environment type (either nonlive or live)
142+
- Run the following commands on the CLI to log into the database: -
143+
- `export PGPASSWORD="$(az account get-access-token --resource https://ossrdbms-aad.database.windows.net --query accessToken --output tsv)"`
144+
- `psql "host=postgres-lungcs-[environment]-uks.postgres.database.azure.com \
145+
port=5432 \
146+
dbname=[database] \
147+
user=postgres_lungcs_[environment]_uks_admin \
148+
sslmode=require"`
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
resource "azurerm_monitor_scheduled_query_rules_alert_v2" "five_hundred_error_alert" {
2+
count = var.enable_alerting ? 1 : 0
3+
4+
auto_mitigation_enabled = false
5+
description = "An alert triggered by 500 errors logged in code"
6+
enabled = var.enable_alerting
7+
evaluation_frequency = "PT5M"
8+
location = var.region
9+
name = "${var.app_short_name}-500-error-alert"
10+
resource_group_name = azurerm_resource_group.main.name
11+
scopes = [var.action_group_id]
12+
severity = 2
13+
skip_query_validation = false
14+
window_duration = "PT5M"
15+
workspace_alerts_storage_enabled = false
16+
17+
action {
18+
action_groups = [var.action_group_id]
19+
}
20+
21+
criteria {
22+
operator = "GreaterThan"
23+
query = <<-QUERY
24+
ContainerAppConsoleLogs_CL
25+
| where Log contains "[ERROR]"
26+
QUERY
27+
threshold = 0
28+
time_aggregation_method = "Count"
29+
30+
failing_periods {
31+
minimum_failing_periods_to_trigger_alert = 1
32+
number_of_evaluation_periods = 1
33+
}
34+
}
35+
}

scripts/config/vale/styles/config/vocabularies/words/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ yaml
3030
jq
3131
choco
3232
CLI
33+
nonlive

0 commit comments

Comments
 (0)