Search code examples
azureazure-devopsazure-web-app-serviceweb2pypyjwt

How to add new file path to environment variable Path in azure app service


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


Solution

  • 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