Some environment vars in Cloud Shell

Environment Variables in Azure Cloud Shell

Edwin Young

1 minute read

Cloud Shell sets several environment variables which can be useful. Here’s a brain dump on some of the more useful ones- the list is not exhaustive. You can see them by running env. Please note this is not official documentation and these could change!

Name Example Value Purpose
ACC_CLOUD PROD If you need to check if a script is in Cloud Shell, look for the existence of this variable. PROD is the normal value - if you are in the Azure Government cloud the value will be different
ACC_TID 72f98888-8681-488f-91ab-2d7cd011db47 This is your Tenant ID in Azure AD.
ACC_PUID 10033FFF8006C82E Your unique user ID in Azure AD.
MSI_ENDPOINT http://localhost:50342/oauth2/token The URL which can be used to retrieve access tokens. See this doc for some more detail.
ACC_LOCATION WESTUS The region your Cloud Shell container is running in.
ACC_VERSION master_20211008.2 The build of the Cloud Shell image which is running.