FoundryEnvironment Class

Definition

Provides strongly-typed access to Foundry platform environment variables injected by the Azure AI Foundry hosting infrastructure. All values are read once in the static constructor and cached for the lifetime of the process.

public static class FoundryEnvironment
type FoundryEnvironment = class
Public Class FoundryEnvironment
Inheritance
FoundryEnvironment

Properties

Name Description
AgentName

The agent name. Sourced from the FOUNDRY_AGENT_NAME environment variable.

AgentVersion

The agent version. Sourced from the FOUNDRY_AGENT_VERSION environment variable.

AppInsightsConnectionString

The Application Insights connection string. Sourced from the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable.

IsHosted

Indicates whether the process is running in a Foundry hosted environment. Returns true when the FOUNDRY_HOSTING_ENVIRONMENT environment variable is set to a non-empty value.

OtlpEndpoint

The OTLP exporter endpoint. Sourced from the OTEL_EXPORTER_OTLP_ENDPOINT environment variable.

Port

The HTTP listen port. Sourced from the PORT environment variable. Default: 8088.

ProjectArmId

The full ARM ID of the Foundry project. Sourced from the FOUNDRY_PROJECT_ARM_ID environment variable.

ProjectEndpoint

The Foundry project endpoint. Sourced from the FOUNDRY_PROJECT_ENDPOINT environment variable.

SessionId

The session ID. Sourced from the FOUNDRY_AGENT_SESSION_ID environment variable.

SseKeepAliveInterval

The SSE keep-alive comment frame interval. Sourced from the SSE_KEEPALIVE_INTERVAL environment variable (value in integer seconds). When absent, zero, or unparseable, returns InfiniteTimeSpan (disabled).

Applies to