如何在 Azure 应用程序服务中将新文件路径添加到环境变量 Path

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

我正在为 web2py 项目创建 azure web 应用程序,我的应用程序使用 jwt 包。现在我想安装 pyjwt package 到 azure 应用程序服务。通过 kudu 安装后,它安装在其他不在 azure app 服务环境变量中的位置。

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

我不知道该怎么做?如果有人帮我解决这个问题就太好了

关于如何给azure添加环境变量可以参考这个wiki:Adding environment variables。您需要 applicationHost.xdt,将其放在 d:\home\site 文件夹下。

下面是示例。

<?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>