Asset Volume using Environment Variable on File System Path as literal string on upload I have a volume called "Website" with a File System Path that uses an environment variable, $ASSET_ADHOC_PATH. The variable has been setup in my .env file as follows:

ASSET_ADHOC_PATH="/home/theadhoc/craftcms/web/assets/theadhocracy"


The Volume has the following in the File System Path input:

$ASSET_ADHOC_PATH/website


That should resolve to my actual folder location, but when I upload a file it just creates a folder at:

/home/theadhoc/craftcms/web/$ASSET_ADHOC_PATH/website


If I get rid of the environment variable and use the literal value then it works fine (which is what I'm doing for now) but I'd like to get to the bottom of why this isn't working as I would expect.

EDIT: Just in case this helps, I've discovered I have the same issue when using (different) environment variables in the Base URL field too. Am I missing a step in setting up env vars? Do I need to add them to general.php or something as well? They seem to resolve without issue in the dropdown list, which accurately displays the variable contents.
If you use environment variables, you have to be aware that you can't add anything to it in your fields. What this means is that $ASSET_ADHOC_PATH/website in your CP will not be parsed. If you use environment variables, the only thing you should have in the field is the variable, nothing else.

To do what you are trying to do, you might want to consider Aliases. These are great for the Control Panel because you can add to them so @aliasName/website will be parsed 
and work the way you expect.

So in your case (and to get you going) with this ASSET_ADHOC_PATH variable set in your .env file, add the below in your config/general.php:

'aliases' =&gt; [
    '@assetAdHocPath' =&gt; getenv('ASSET_ADHOC_PATH')
],


Then in your volume settings use @assetAdHocPath/website and this should now work for you.

For the second part of the question, I'm guessing you may be trying to access an ENV in your template in which case you would use {{ getenv('ASSET_ADHOC_PATH') }} OR if you go the aliases way, {{ alias('@assetAdHocPath') }}.