You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add documentation for detecting host vs worker process in Azure Functions
Add comprehensive documentation to AzureFunctions.md explaining how to detect
whether code is running in the host or worker process for isolated Azure Functions.
Includes:
- EnvironmentHelpers.IsRunningInAzureFunctionsHost() method documentation
- EnvironmentHelpers.IsAzureFunctionsIsolated() method documentation
- Usage examples for detecting host-only, worker-only, and both processes
- Implementation details about command-line flag detection
- Common use cases for process detection
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/development/AzureFunctions.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,56 @@ Isolated functions are the only supported model for Azure Functions going forwar
49
49
50
50
For detailed information about the isolated worker architecture, gRPC protocol, and middleware model, see [Azure Functions Architecture Deep Dive](AzureFunctions-Architecture.md).
51
51
52
+
### Detecting Host vs Worker Process
53
+
54
+
The tracer provides utility methods in `EnvironmentHelpers` (`tracer/src/Datadog.Trace/Util/EnvironmentHelpers.cs`) to detect whether code is running in the host or worker process:
- Apply process-specific behavior (e.g., filtering spans by process)
99
+
- Tag spans with `aas.function.process: host` or `aas.function.process: worker`
100
+
- Enable/disable integrations based on the process type
101
+
52
102
`func.exe` sets up an in-process Azure Function for every function in the customer's app. Each of the functions in `func.exe` are simple calls that proxy the request to the customer app, and then return the response.
53
103
54
104
When an HTTP request is received by `func.exe`, it runs the in-process function as normal. As part of the in-process function execution, it creates a GRPC message (by serializing the incoming HTTP requests to a GRPC message), and forwards the request over GRPC to the customer app. The customer's app runs the _real_ Azure function, and returns the response back over GRPC, where it is deserialized and turned into an HTTP response.
0 commit comments