AVL Environment Variables - Appsembler

AVL Environment Variables

AVL Environment Variables

We expose several environment variables in the lab, which may help you to communicate between containers or provide access to a unique identifier within a container.

List of Variables











You'll note that the unique identifier XXXXYYYY follows the container; we use it in several places. In addition to the env vars listed above, you'll find this unique identifier in the AVL dashboard, so you can use it to search for a given container.

Note: yourdomain.appsembler.com in the example above is the full TLD of your site, whether you use a custom domain or an .appsembler subdomain.


The AVL_PRIMARY_CONTAINER_INTERNAL_DOMAIN and AVL_PAIRED_CONTAINER_INTERNAL_DOMAIN allows you to communicate with this container within our internal network. So, if you for example you have a database running in the paired container and wish to connect to it from the primary container, you could pass the AVL_PAIRED_CONTAINER_INTERNAL_DOMAIN:8888 to your database configuration (where 8888 is your database's internal port that you opened in the paired container).

Tying the Unique ID to External Services

You can use the unique ID to generate, e.g., a unique S3 bucket for each user by simply using the AVL_PRIMARY_CONTAINER_NAME as the bucket name.

Detecting Student Containers

If you want to detect the difference between student containers and admin containers, for example, if you have a setup script that you don't want to run while you are configuring an image as an admin container, but to run when the image is launched as a project, you can detect the presence of the AVL_STUDENT_ID environment variable as this is not set when running as an admin contaner.  

As an example, you can add the following to the top of a bash script:


if [ ! -v 'AVL_STUDENT_ID' ]


echo "Not in a student container, exiting"

exit 0