Hi Craig,
For the YARN session, you have to pass the the number of taskManagers using the -n argument.
if you need to use a n environment variable, you can create a custom script calling the yarn-session.sh script and passing the value of the env variable to the script.
Regards,
Robert