1

I am creating azure web app for web2py project, my application uses jwt package. Now I want to install pyjwt package to azure app service. After installing it through kudu it installed on some other location which is not in azure app service environment variable.

enter image description here

Now either I need to install this package at default location or I need to include D:\home\python364x64\Script to environment variable PATH.

I don't know how to do any of this approach? It would be really great if someone help me to solve this issue

Prasad Telkikar
  • 15,207
  • 5
  • 21
  • 44

1 Answers1

3

About how to add environment variable to azure you could refer to this wiki: Adding environment variables. You need the applicationHost.xdt, put it under d:\home\site folder.

The below is a sample.

<?xml version="1.0"?> 
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
 <system.webServer> 
  <runtime xdt:Transform="InsertIfMissing">
   <environmentVariables xdt:Transform="InsertIfMissing">
    <add name="PATH" value="D:\home\python364x64\Scripts;%PATH%" xdt:Locator="Match(name)" 
    xdt:Transform="InsertIfMissing" />    
   </environmentVariables>
  </runtime> 
 </system.webServer> 
</configuration>

enter image description here

George Chen
  • 13,703
  • 2
  • 11
  • 26
  • Great I tested and it is working as expected. I was struggling to migrate my project from PythonAnyWhere to Azure, but stackoverflow really helped to solve difficult problems which were not easy to debug. By the way apologies for late response – Prasad Telkikar Jan 18 '20 at 16:29