You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: infrastructure/modules/container-app-job/README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,3 +47,26 @@ module "container-app-job" {
47
47
}
48
48
```
49
49
50
+
## Key vault secrets
51
+
The container app job can be mapped to Azure Key Vaults for secret management:
52
+
53
+
-**App Key Vault:**
54
+
- All secrets from the app key vault are fetched and mapped to secret environment variables if `fetch_secrets_from_app_key_vault = true` and `app_key_vault_id` is provided.
55
+
- Secret names in Key Vault must use hyphens (e.g., `SECRET-KEY`). These are mapped to environment variables with underscores (e.g., `SECRET_KEY`).
56
+
- Secrets are updated when Terraform runs, or automatically within 30 minutes.
57
+
58
+
**Warning:** The module cannot read from a key vault if it doesn't exist yet. Recommended workflow:
59
+
1. Create the key vault(s) using the [key-vault module](../key-vault/).
60
+
2. Deploy the container app with `fetch_secrets_from_app_key_vault = false` (default) and/or `enable_auth = false`.
61
+
3. Manually add the required secrets to the key vault(s).
62
+
4. Set `fetch_secrets_from_app_key_vault = true` and/or `enable_auth = true`, then re-run Terraform to populate the app with secret environment variables and enable authentication.
Description: ID of the key vault to store app secrets. Each secret is mapped to an environment variable. Required when fetch\_secrets\_from\_app\_key\_vault is true.
Copy file name to clipboardExpand all lines: infrastructure/modules/container-app-job/variables.tf
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,22 @@ variable "resource_group_name" {
8
8
type=string
9
9
}
10
10
11
+
variable"app_key_vault_id" {
12
+
description="ID of the key vault to store app secrets. Each secret is mapped to an environment variable. Required when fetch_secrets_from_app_key_vault is true."
13
+
type=string
14
+
default=null
15
+
}
16
+
variable"fetch_secrets_from_app_key_vault" {
17
+
description=<<EOT
18
+
Fetch secrets from the app key vault and map them to secret environment variables. Requires app_key_vault_id.
19
+
20
+
WARNING: The key vault must be created by terraform and populated manually before setting this to true.
21
+
EOT
22
+
type=bool
23
+
default=false
24
+
nullable=false
25
+
}
26
+
11
27
variable"location" {
12
28
type=string
13
29
description="The location/region where the container app environment is created."
0 commit comments