Setting the webapp% PATH% environment variable to azure

I am working on an azure webapp project. For my application to work, I had to install third-party open source software on the server. The only way I found to do on the azure webapp is to manually copy all the software folders to my project, and then add all the necessary environment variables, and also add several paths to the system path variable. I found how I can add system variables, but could not find a way to set the path variable on azure webapp.

+3
source share
1 answer

You can achieve this with the XDT Transform ( X ML D ocument T ). p>

Check out https://github.com/projectkudu/kudu/wiki/Xdt-transform-samples

Adding environment variables

Next, an environment variable named FOO with the value BAR will be entered and a folder will be added to PATH:

 <?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="FOO" value="BAR" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> <add name="PATH" value="%PATH%;%HOME%\BAR" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" /> </environmentVariables> </runtime> </system.webServer> </configuration> 

Drop it as d:\home\site\applicationHost.xdt , restart the web application and check the fresh fixed %PATH% in Kudu ( https: //sitename.scm. Azurewebsites.net/DebugConsole ).

 d:\home>set PATH Path=D:\home\site\deployments\tools;[...];D:\home\BAR 
+4
source

All Articles