Gets the environment block of a specified process.
GET /env?pid={pid}&uid={uid}&name={name} HTTP/1.1
Note
Process information (IDs, names, environment, etc) may change between invocations of these APIs. Processes may start or stop between API invocations, causing this information to change.
The default host address for these routes is https://localhost:52323
. This route is only available on the addresses configured via the --urls
command line parameter and the DOTNETMONITOR_URLS
environment variable.
Name | In | Required | Type | Description |
---|---|---|---|---|
pid |
query | false | int | The ID of the process. |
uid |
query | false | guid | A value that uniquely identifies a runtime instance within a process. |
name |
query | false | string | The name of the process. |
See ProcessIdentifier for more details about the pid
, uid
, and name
parameters.
If none of pid
, uid
, or name
are specified, the environment block of the default process will be provided. Attempting to get the environment block of the default process when the default process cannot be resolved will fail.
Authentication is enforced for this route. See Authentication for further information.
Allowed schemes:
Bearer
Negotiate
(Windows only, running as unelevated)
Name | Type | Description | Content Type |
---|---|---|---|
200 OK | map (of string) | The environment block of the specified process. | application/json |
400 Bad Request | ValidationProblemDetails | An error occurred due to invalid input. The response body describes the specific problem(s). | application/problem+json |
401 Unauthorized | Authentication is required to complete the request. See Authentication for further information. |
GET /env?pid=21632 HTTP/1.1
Host: localhost:52323
Authorization: Bearer fffffffffffffffffffffffffffffffffffffffffff=
or
GET /env?uid=cd4da319-fa9e-4987-ac4e-e57b2aac248b HTTP/1.1
Host: localhost:52323
Authorization: Bearer fffffffffffffffffffffffffffffffffffffffffff=
HTTP/1.1 200 OK
Content-Type: application/json
{
"ALLUSERSPROFILE": "C:\\ProgramData",
"APPDATA": "C:\\Users\\user\\AppData\\Roaming",
"CommonProgramFiles": "C:\\Program Files\\Common Files",
"CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
"CommonProgramW6432": "C:\\Program Files\\Common Files",
"ComSpec": "C:\\WINDOWS\\system32\\cmd.exe",
"DriverData": "C:\\Windows\\System32\\Drivers\\DriverData",
"HOMEDRIVE": "C:",
"HOMEPATH": "\\Users\\user",
"LOCALAPPDATA": "C:\\Users\\user\\AppData\\Local",
"NUMBER_OF_PROCESSORS": "8",
"OS": "Windows_NT",
"Path": "...",
"PROCESSOR_ARCHITECTURE": "AMD64",
"ProgramData": "C:\\ProgramData",
"ProgramFiles": "C:\\Program Files",
"ProgramFiles(x86)": "C:\\Program Files (x86)",
"ProgramW6432": "C:\\Program Files",
"PUBLIC": "C:\\Users\\Public",
"SESSIONNAME": "Console",
"SystemDrive": "C:",
"SystemRoot": "C:\\WINDOWS",
"TEMP": "C:\\Users\\user\\AppData\\Local\\Temp",
"TMP": "C:\\Users\\user\\AppData\\Local\\Temp",
"USERNAME": "user",
"USERPROFILE": "C:\\Users\\user",
"windir": "C:\\WINDOWS"
}
Operating System | Runtime Version |
---|---|
Windows | .NET 5+ |
Linux | .NET 5+ |
MacOS | .NET 5+ |
See Process ID pid
vs Unique ID uid
for clarification on when it is best to use either parameter.