While the included PowerShell scripts may be edited freely, it is possible to set most configuration options through your Python project.
To specify the version of Python your worker should run with, make it
the active environment for your project. (Ensure that you have a WebPI
reference or startup task to install this version on the instance - see
the documentation in ConfigureCloudService.ps1
for more
details.)
If your version of Python cannot be detected using the CPython registry
keys after it has been installed, you can add the
DeployedPythonInterpreterPath
property to your Python
project by editing the .pyproj file. This path will take precedence over
the active environment.
To install packages using pip, update the requirements.txt
file in the root directory of your project.
To set PYTHONPATH
(or equivalent) before running the
worker, add the necessary Search Paths to your project.
To specify the script to run, make it the startup file in your project.
To specify command-line arguments, add them to the Command Line Arguments property under Project Properties\Debug.
If your worker role does not behave correctly after deployment, check the following:
Your Python project includes a bin\ folder with (at least):
ConfigureCloudService.ps1
LaunchWorker.ps1
ps.cmd
requirements.txt
file listing all dependencies, OREnable Remote Desktop on your Cloud Service and investigate the log files.
Logs for ConfigureCloudService.ps1
and
LaunchWorker.ps1
are stored in the following path
on the machine instance:
C:\Resources\Directory\%RoleId%.DiagnosticStore\LogFiles
Currently, the LaunchWorker.ps1
log is the only way
to view output or errors displayed by your Python program.
This readme file may be deleted when you no longer need it.