applicationInitialization on Azure Webapp does not work with OutOfProcess - 502.3 The request is not supported.
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
I have a .net 6 application exposing a url at `"/health"` with a web.config like this:
```
```
When I hit the '/health' url I get two traces; the first by the applicationInitialization and the second because of my request.
The first fails:
MODULE_SET_RESPONSE_ERROR_STATUS:
```
ModuleName="AspNetCoreModuleV2", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="502", HttpReason="Bad Gateway", HttpSubStatus="3", ErrorCode="The request is not supported.
(0x80070032)", ConfigExceptionInfo=""
```
SET_RESPONSE_ERROR_DESCRIPTION
`ErrorDescription="There was a connection error while trying to route the request."`
The second succeeds without issues.
When I change the hostingModel from `OutOfProcess` to `InProcess` the applicationInitialization works fine.
According to the [documentation](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/advanced?view=aspnetcore-7.0#application-initialization-module), you'd expect that OutOfProcess is supported: "Applies to apps hosted in-process and out-of-process."
Is there anything I can do to resolve this? Changing to InProcess is not an option for me as I have multiple netcore subapplications.
I've attached the traces for both InProcess and OutOfProcess.
### Expected Behavior
applicationInitialization to be able to request urls served by an out OutOfProcess netcore process
### Steps To Reproduce
_No response_
### Exceptions (if any)
MODULE_SET_RESPONSE_ERROR_STATUS:
```
ModuleName="AspNetCoreModuleV2", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="502", HttpReason="Bad Gateway", HttpSubStatus="3", ErrorCode="The request is not supported.
(0x80070032)", ConfigExceptionInfo=""
```
SET_RESPONSE_ERROR_DESCRIPTION
`ErrorDescription="There was a connection error while trying to route the request."`
### .NET Version
6
### Anything else?
[inprocess_applicationInitialization_succeeding.xml.txt](https://github.com/dotnet/aspnetcore/files/13237738/inprocess_applicationInitialization_succeeding.xml.txt)
[inprocess_requested_succeeding.xml.txt](https://github.com/dotnet/aspnetcore/files/13237739/inprocess_requested_succeeding.xml.txt)
[outofprocess_applicationInitialization_failing.xml.txt](https://github.com/dotnet/aspnetcore/files/13237740/outofprocess_applicationInitialization_failing.xml.txt)
[outofprocess_requested_succeeding.xml.txt](https://github.com/dotnet/aspnetcore/files/13237741/outofprocess_requested_succeeding.xml.txt)
Contributor guide
Assessment
This issue has not been assessed yet.