If you are not using Microsoft Azure Tools 2.4 or later, you will need to finish configuring your web role:
<WebRole role="{your project name}">
element.WebRole
element.(If you have Microsoft Azure Tools 2.4 or later, this code has already been added.)
While the code above and 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 web 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
web, add the necessary Search Paths to your project.
To specify your main handler script, make it the startup file in your project. Alternatively, you can set the full importable name of your WSGI app in Project Properties\Web\WSGI Handler.
If your web role does not behave correctly after deployment, check the following:
Your Python project includes a bin\ folder with (at least):
ConfigureCloudService.ps1
ps.cmd
Your Cloud project includes the above XML and the command lines match.
Earlier versions of PTVS would create similar XML with a different command line. If this exists, it should be removed when you add the above XML.
Your Python project includes either:
requirements.txt
file listing all dependencies, OREnable Remote Desktop on your Cloud Service and investigate the log files.
Logs for ConfigureCloudService.ps1 are stored in the following path on the machine instance:
C:\Resources\Directory\%RoleId%.DiagnosticStore\LogFiles
This readme file may be deleted when you no longer need it.