Skip to content

Commit 08aed6b

Browse files
Merge pull request #287229 from anthonychu/20240924-add-built-in-vars
[Container Apps] Add built-in variables reference
2 parents ea93de5 + 8d63863 commit 08aed6b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

articles/container-apps/environment-variables.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,32 @@ Update-AzContainerApp -TemplateContainer $containerTemplate
151151

152152
---
153153

154+
## Built-in environment variables
155+
156+
Azure Container Apps automatically adds environment variables that your apps and jobs can use to obtain platform metadata at run-time.
157+
158+
### Apps
159+
160+
The following variables are available to container apps:
161+
162+
| Variable name | Description | Example value |
163+
|---------------|-------------| ------------- |
164+
| `CONTAINER_APP_NAME` | The name of the container app. | `my-containerapp` |
165+
| `CONTAINER_APP_REVISION` | The name of the container app revision. | `my-containerapp--20mh1s9` |
166+
| `CONTAINER_APP_HOSTNAME` | The revision-specific hostname of the container app. | `my-containerapp--20mh1s9.<DEFAULT_HOSTNAME>.<REGION>.azurecontainerapps.io` |
167+
| `CONTAINER_APP_ENV_DNS_SUFFIX` | The DNS suffix for the Container Apps environment. To obtain the fully qualified domain name (FQDN) of the app, append the app name to the DNS suffix in the format `$CONTAINER_APP_NAME.$CONTAINER_APP_ENV_DNS_SUFFIX`. | `<DEFAULT_HOSTNAME>.<REGION>.azurecontainerapps.io` |
168+
| `CONTAINER_APP_PORT` | The target port of the container app. | `8080` |
169+
| `CONTAINER_APP_REPLICA_NAME` | The name of the container app replica. | `my-containerapp--20mh1s9-86c8c4b497-zx9bq` |
170+
171+
### Jobs
172+
173+
The following variables are available to Container Apps jobs:
174+
175+
| Variable name | Description | Example value |
176+
|---------------|-------------| ------------- |
177+
| `CONTAINER_APP_JOB_NAME` | The name of the job. | `my-job` |
178+
| `CONTAINER_APP_JOB_EXECUTION_NAME` | The name of the job execution. | `my-job-iwpi4il` |
179+
154180
## Next steps
155181

156182
- [Revision management](revisions-manage.md)

0 commit comments

Comments
 (0)