main
md 73 lines 2.1 KB
Rendered Raw
1 # Azure Deployment
2
3 ## Azure Context
4
5 Expected Azure environment:
6
7 - Subscription name: Azure subscription 1
8 - Subscription ID: `2dccba84-7038-4126-b0b2-32f8f29bcbd4`
9 - Tenant ID: `ee868f5c-6f21-48fa-b329-3e114d8d229d`
10 - Region: `westeurope`
11
12 The canonical checked-in PRD Azure account configuration is `config/prd/azure.json`. `platform.ps1` reads this file and passes those values into Terraform. `prd.auto.tfvars.example` is a human-readable Terraform template for direct Terraform use; if values differ, treat `config/prd/azure.json` as authoritative for platform commands.
13
14 Development authentication uses the currently authenticated Azure CLI context. Credentials must not be stored in this repository.
15
16 ## Subscription Guardrail
17
18 Before PRD deployment, validate:
19
20 ```powershell
21 az account show
22 ```
23
24 If the active subscription is wrong, set it manually:
25
26 ```powershell
27 az account set --subscription "2dccba84-7038-4126-b0b2-32f8f29bcbd4"
28 ```
29
30 `platform.ps1` fails safely when the active Azure subscription does not match the expected subscription ID.
31
32 ## PRD Terraform
33
34 The first Terraform environment is located at:
35
36 ```text
37 infrastructure/terraform/environments/prd
38 ```
39
40 It defines Terraform-owned PRD resources:
41
42 - Resource group
43 - Azure Container Registry
44 - VNet
45 - AKS subnet
46 - Azure Key Vault
47 - AKS cluster
48
49 For this foundation iteration:
50
51 ```powershell
52 .\platform.ps1 up PRD
53 ```
54
55 validates Azure and creates a Terraform plan, but intentionally stops before `terraform apply`.
56
57 ## Disposable PRD
58
59 When real PRD resources have been created from this Terraform state, destruction must be limited to Terraform-owned resources:
60
61 ```powershell
62 .\platform.ps1 down PRD
63 ```
64
65 The script validates the active Azure subscription and requires typing `DESTROY ai-investment-platform PRD` before it invokes `terraform destroy`. After destruction, audit remaining tagged resources:
66
67 ```powershell
68 az resource list --tag project=ai-investment-platform --output table
69 ```
70
71 Do not manually delete unrelated Azure resources.
72
73 Foundation validation must not run `terraform plan`, `terraform apply`, or `terraform destroy`, and must not create Azure resources.