05 Oct 2025
11:45 PM
- last edited on
06 Oct 2025
07:45 AM
by
MaciejNeumann
Hello, I have an Azure App Service that is monitored by the DynaTrace OneAgent, installed as an extension in the Azure portal. This service is .Net Framework 4.8. It is a fairly simple service that acts as a proxy for requests; it reads incoming requests, forwards them to backend services, and send them back to the original caller. This service has a single middleware class that performs the proxying in an async method InvokeAsync, which returns a Task object. As part of the proxy process, we need to know what the request's HttpMethod is, so that we can call the backend endpoint with the same method. I am however finding that intermittently, but pretty frequently, the HttpContext.Request.Method property has an empty string value. This means we don't know what Http verb the original request came in, and we can't make a valid outbound Http request. The other properties of the request seem properly populated, based on the debug messages I have added. I have tried many things, including:
- Created a local variable in the Middleware's InvokeAsync method to store a copy of the HTTP method used, right at the start of the InvokeAsync method.
- Uninstalled OneAgent; when I do this, the service works perfectly. When reinstalled, the service returns to failing intermittently.
- Recreated in multiple copies of the same service, within different Azure resource groups and subscriptions.
- Disabled async hotspot for the process group.
- Disabled async hotspot globally.
- Disabled deep monitoring for the process group.
- Disabled all DynaTrace .Net features that had "HTTP" in the name for the process group.
- Disabled URL Sampling for anything matching the proxy service's base path.
I'm looking for the following:
- Help figuring out why having DynaTrace OneAgent installed into the app service is causing issues.
- How to get the service to "play nice" with OneAgent, meaning allow me to inspect the HttpRequest.Method with 100% reliability.
- Any workarounds that might let our proxy service function even with this oddity of the missing HttpRequest.Method...maybe there's somewhere else I could get the originating Http Method used?
Thanks all.