Azure Environment Variables

Adding an Azure subscription to your track also sets a list of environment variables that you can use in commands and scripts:

Environment variable

Description

INSTRUQT_AZURE_SUBSCRIPTIONS

A comma-separated list of project names that can be used to fill ${NAME} in the variables below

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_SUBSCRIPTION_NAME

The subscription display name

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_SUBSCRIPTION_ID

The subscription ID

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_USERNAME

The username that can be used to sign into the Azure portal

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_PASSWORD

The password that can be used to sign into the Azure portal

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_SPN_ID

The application ID for the service principal

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_SPN_PASSWORD

The password for the service principal

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_TENANT_ID

The tenant ID for this subscription

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_ADMIN_USERNAME

The username that can be used to sign into the Azure portal as the admin user

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_ADMIN_PASSWORD

The password that can be used to sign into the Azure portal as the admin user

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_ADMIN_SPN_ID

The application ID for the admin service principal

INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_ADMIN_SPN_PASSWORD

The password for the admin service principal

Example

This example shows the id of the Azure subscription from a terminal by using two environment variables. The value of the INSTRUQT_AZURE_SUBSCRIPTIONS environment variable is inserted in the INSTRUQT_AZURE_SUBSCRIPTION_${NAME}_SUBSCRIPTION_ID environment variable.

To follow along:

  1. Start your Azure subscription track and start the first challenge.

  2. Move over to the Cloud CLI terminal and enter the following command:

    eval echo "\${INSTRUQT_AZURE_SUBSCRIPTION_${INSTRUQT_AZURE_SUBSCRIPTIONS}_SUBSCRIPTION_ID}"

    ↳ The terminal shows the id of your Azure subscription.

Last updated

Was this helpful?