Skip to content

Instantly share code, notes, and snippets.

@sayedihashimi
Last active September 13, 2024 15:47
Show Gist options
  • Save sayedihashimi/831d8883cdf1d23823f3 to your computer and use it in GitHub Desktop.
Save sayedihashimi/831d8883cdf1d23823f3 to your computer and use it in GitHub Desktop.
Environment variables when your app is running as a Microsoft Azure Web Job
ALLUSERSPROFILE C:\DWASFiles\Sites\WebjobsEnvvars\ProgramData
APP_POOL_CONFIG C:\DWASFiles\Sites\WebjobsEnvvars\Config\applicationhost.config
APP_POOL_ID WebjobsEnvvars
APPDATA C:\DWASFiles\Sites\WebjobsEnvvars\AppData
APPSETTING_REMOTEDEBUGGINGVERSION 11.0.611103.400
APPSETTING_ScmType None
APPSETTING_WEBSITE_NODE_DEFAULT_VERSION 0.10.29
APPSETTING_WEBSITE_SITE_NAME WebjobsEnvvars
aspnet:DisableFcnDaclRead true
aspnet:PortableCompilationOutput true
aspnet:PortableCompilationOutputSnapshotType Microsoft.Web.Compilation.Snapshots.SnapshotHelper, Microsoft.Web.Compilation.Snapshots, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AZURE_JETTY9_CMDLINE -Djava.net.preferIPv4Stack=true -Djetty.port=%HTTP_PLATFORM_PORT% -Djetty.base="D:\Program Files (x86)\jetty-distribution-9.1.0.v20131115" -Djetty.webapps="d:\home\site\wwwroot\webapps" -jar "D:\Program Files (x86)\jetty-distribution-9.1.0.v20131115\start.jar" etc\jetty-logging.xml
AZURE_JETTY9_HOME D:\Program Files (x86)\jetty-distribution-9.1.0.v20131115
AZURE_TOMCAT7_CMDLINE -Dport.http=%HTTP_PLATFORM_PORT% -Djava.util.logging.config.file="D:\Program Files (x86)\apache-tomcat-7.0.50\conf\logging.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dsite.logdir="d:/home/LogFiles/" -Dsite.tempdir="d:\home\site\workdir" -classpath "D:\Program Files (x86)\apache-tomcat-7.0.50\bin\bootstrap.jar;D:\Program Files (x86)\apache-tomcat-7.0.50\bin\tomcat-juli.jar" -Dcatalina.base="D:\Program Files (x86)\apache-tomcat-7.0.50" -Djava.io.tmpdir="d:\home\site\workdir" org.apache.catalina.startup.Bootstrap
AZURE_TOMCAT7_HOME D:\Program Files (x86)\apache-tomcat-7.0.50
CommonProgramFiles D:\Program Files (x86)\Common Files
CommonProgramFiles(x86) D:\Program Files (x86)\Common Files
CommonProgramW6432 D:\Program Files\Common Files
COMPUTERNAME REMOVED
ComSpec D:\Windows\system32\cmd.exe
deployment_branch master
FP_NO_HOST_CHECK NO
HOME D:\home
HOME_EXPANDED C:\DWASFiles\Sites\WebjobsEnvvars\VirtualDirectory0
HOMEDRIVE D:
HOMEPATH \home
JAVA_HOME D:\Program Files (x86)\Java\jdk1.7.0_51
KUDU_SYNC_CMD kudusync
LOCALAPPDATA C:\DWASFiles\Sites\WebjobsEnvvars\LocalAppData
MSBUILD_PATH D:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
NPM_JS_PATH D:\Program Files (x86)\npm\1.4.10\node_modules\npm\bin\npm-cli.js
NUGET_EXE D:\Program Files (x86)\SiteExtensions\Kudu\28.30701.986\bin\scripts\nuget.exe
NUMBER_OF_PROCESSORS 8
OS Windows_NT
Path D:\Windows\Microsoft.NET\Framework\v4.0.30319;D:\Program Files (x86)\Git\bin;D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;D:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;D:\Program Files (x86)\SiteExtensions\Kudu\28.30701.986\bin\scripts;D:\Program Files (x86)\npm\1.4.10;C:\DWASFiles\Sites\WebjobsEnvvars\AppData\npm;D:\Program Files (x86)\nodejs\0.10.29;D:\Windows\system32;D:\Windows;D:\Windows\System32\Wbem;D:\Windows\System32\WindowsPowerShell\v1.0\;D:\Users\Administrator\AppData\Roaming\npm;D:\Program Files (x86)\nodejs\;d:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;D:\Program Files (x86)\Mercurial\;D:\Program Files\MySQL\MySQL Server 5.1\bin;D:\Program Files (x86)\PHP\v5.4;D:\Python27;
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY
PROCESSOR_ARCHITECTURE x86
PROCESSOR_ARCHITEW6432 AMD64
PROCESSOR_IDENTIFIER AMD64 Family 16 Model 8 Stepping 1, AuthenticAMD
PROCESSOR_LEVEL 16
PROCESSOR_REVISION 0801
ProgramData C:\DWASFiles\Sites\WebjobsEnvvars\ProgramData
ProgramFiles D:\Program Files (x86)
ProgramFiles(x86) D:\Program Files (x86)
ProgramW6432 D:\Program Files
PROMPT $P$G
PSModulePath D:\Windows\system32\WindowsPowerShell\v1.0\Modules\;d:\Program Files\Microsoft Security Client\MpProvider\
PUBLIC D:\Users\Public
REMOTEDEBUGGINGBITVERSION vx86
REMOTEDEBUGGINGPORT
REMOTEDEBUGGINGVERSION 11.0.611103.400
REWRITETABLE
SCM_BUILD_ARGS
SCM_COMMAND_IDLE_TIMEOUT 60
SCM_GIT_EMAIL windowsazure
SCM_GIT_USERNAME windowsazure
SCM_LOGSTREAM_TIMEOUT 1800
SCM_TRACE_LEVEL 1
ScmType None
SystemDrive D:
SystemRoot D:\Windows
TEMP C:\DWASFiles\Sites\WebjobsEnvvars\Temp
TMP C:\DWASFiles\Sites\WebjobsEnvvars\Temp
USERDOMAIN WORKGROUP
USERNAME RD00155D48653C$
USERPROFILE C:\DWASFiles\Sites\WebjobsEnvvars\UserProfile
WEBJOBS_COMMAND_ARGUMENTS
WEBJOBS_DATA_PATH D:\home\data\jobs\continuous\ConsoleApplication1
WEBJOBS_NAME ConsoleApplication1
WEBJOBS_PATH C:\DWASFiles\Sites\WebjobsEnvvars\Temp\jobs\continuous\ConsoleApplication1\wtlhp2d2.kwa
WEBJOBS_RUN_ID
WEBJOBS_SHUTDOWN_FILE C:\DWASFiles\Sites\WebjobsEnvvars\Temp\JobsShutdown\continuous\ConsoleApplication1\louxsstx.ppi
WEBJOBS_TYPE continuous
webpages:Enabled true
webpages:Version 3.0.0.0
WEBROOT_PATH D:\home\site\wwwroot
WEBSITE_ALWAYS_ON_JOB_RUNNING_ConsoleApplication1 true
WEBSITE_COMPUTE_MODE Shared
WEBSITE_INSTANCE_ID REMOVED
WEBSITE_NODE_DEFAULT_VERSION 0.10.29
WEBSITE_SITE_MODE Limited
WEBSITE_SITE_NAME WebjobsEnvvars
WEBSITE_SKU Free
WEBSOCKET_CONCURRENT_REQUEST_LIMIT 5
windir D:\Windows
windows_tracing_flags
windows_tracing_logfile
namespace ConsoleApplication1 {
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// This is the program.cs for a webjob which will write all the
// environment variables to the file specified.
class Program {
static void Main(string[] args) {
string filePath = @"D:\home\site\wwwroot\app_data\envvars.txt";
//string filePath = @"C:\temp\envvars.txt";
// write env vars to a file
FileInfo fiFilePath = new FileInfo(filePath);
if (!fiFilePath.Directory.Exists) {
fiFilePath.Directory.Create();
}
var sb = new StringBuilder();
List<string> strList = new List<string>();
var envVars = Environment.GetEnvironmentVariables();
foreach (string envVar in envVars.Keys) {
strList.Add(string.Format(
"{0} {1}",
envVar,
Environment.GetEnvironmentVariable(envVar)));
}
strList.Sort();
File.WriteAllLines(filePath, strList);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment