This is a follow up to an existing issue that was closed here: Unexpected Plumber API issues with Reticulate and RStudio Connect
I was successful in using the method that @edavidaja recommended - Include Python in the manifest.json and a requirements.txt file. However, when I called the API, I noticed that the non-standard RunAs user from Plumber was not included in the Python environment. It tried to run the Python code as rstudio-connect and it very silently failed.
Here is what I see in the application logs for RStudio Connect:
01/05 20:25:19.842 (GMT)
Environment will be built with Python "3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48) [GCC 9.3.0]" at /opt/Python/3.9.6/bin/python3.9
01/05 20:25:19.843 (GMT)
Running as user: rstudio-connect
Is there a way to force Python to use the RunAs user that Plumber is using? Otherwise I'm stuck using the virtualenv approach that causes problems.