Skip to content

Commit 6124e6c

Browse files
CSAT for host/deploy to IIS (#18165)
* CSAT for host/deploy to IIS * CSAT for host/deploy to IIS * CSAT for host/deploy to IIS * CSAT for host/deploy to IIS * revert YML
1 parent d382e26 commit 6124e6c

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

aspnetcore/host-and-deploy/iis/index.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to host ASP.NET Core apps on Windows Server Internet Info
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 05/07/2020
8+
ms.date: 5/7/2020
99
no-loc: [Blazor, "Identity", "Let's Encrypt", Razor, SignalR]
1010
uid: host-and-deploy/iis/index
1111
---
@@ -66,22 +66,26 @@ The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module):
6666
* Calls `Program.Main`.
6767
* Handles the lifetime of the IIS native request.
6868

69-
The in-process hosting model isn't supported for ASP.NET Core apps that target the .NET Framework.
70-
7169
The following diagram illustrates the relationship between IIS, the ASP.NET Core Module, and an app hosted in-process:
7270

7371
![ASP.NET Core Module in the in-process hosting scenario](index/_static/ancm-inprocess.png)
7472

75-
A request arrives from the web to the kernel-mode HTTP.sys driver. The driver routes the native request to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS). The ASP.NET Core Module receives the native request and passes it to IIS HTTP Server (`IISHttpServer`). IIS HTTP Server is an in-process server implementation for IIS that converts the request from native to managed.
73+
1. A request arrives from the web to the kernel-mode HTTP.sys driver.
74+
1. The driver routes the native request to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS).
75+
1. The ASP.NET Core Module receives the native request and passes it to IIS HTTP Server (`IISHttpServer`). IIS HTTP Server is an in-process server implementation for IIS that converts the request from native to managed.
7676

77-
After the IIS HTTP Server processes the request, the request is pushed into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. The app's response is passed back to IIS through IIS HTTP Server. IIS sends the response to the client that initiated the request.
77+
After the IIS HTTP Server processes the request:
7878

79-
In-process hosting is opt-in for existing apps, but [dotnet new](/dotnet/core/tools/dotnet-new) templates default to the in-process hosting model for all IIS and IIS Express scenarios.
79+
1. The request is sent to the ASP.NET Core middleware pipeline.
80+
1. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic.
81+
1. The app's response is passed back to IIS through IIS HTTP Server.
82+
1. IIS sends the response to the client that initiated the request.
8083

81-
`CreateDefaultBuilder` adds an <xref:Microsoft.AspNetCore.Hosting.Server.IServer> instance by calling the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIIS*> method to boot the [CoreCLR](/dotnet/standard/glossary#coreclr) and host the app inside of the IIS worker process (*w3wp.exe* or *iisexpress.exe*). Performance tests indicate that hosting a .NET Core app in-process delivers significantly higher request throughput compared to hosting the app out-of-process and proxying requests to [Kestrel](xref:fundamentals/servers/kestrel) server.
84+
In-process hosting is opt-in for existing apps. The ASP.NET Core web templates use the in-process hosting model.
8285

83-
> [!NOTE]
84-
> Apps published as a single file executable can't be loaded by the in-process hosting model.
86+
`CreateDefaultBuilder` adds an <xref:Microsoft.AspNetCore.Hosting.Server.IServer> instance by calling the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIIS*> method to boot the [CoreCLR](/dotnet/standard/glossary#coreclr) and host the app inside of the IIS worker process (*w3wp.exe* or *iisexpress.exe*). Performance tests indicate that hosting a .NET Core app in-process delivers significantly higher request throughput compared to hosting the app out-of-process and proxying requests to [Kestrel](xref:fundamentals/servers/kestrel).
87+
88+
Apps published as a single file executable can't be loaded by the in-process hosting model.
8589

8690
### Out-of-process hosting model
8791

@@ -91,11 +95,14 @@ The following diagram illustrates the relationship between IIS, the ASP.NET Core
9195

9296
![ASP.NET Core Module in the out-of-process hosting scenario](index/_static/ancm-outofprocess.png)
9397

94-
Requests arrive from the web to the kernel-mode HTTP.sys driver. The driver routes the requests to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS). The module forwards the requests to Kestrel on a random port for the app, which isn't port 80 or 443.
98+
1. Requests arrive from the web to the kernel-mode HTTP.sys driver.
99+
1. The driver routes the requests to IIS on the website's configured port. The configured port is usually 80 (HTTP) or 443 (HTTPS).
100+
1. The module forwards the requests to Kestrel on a random port for the app. The random port isn't 80 or 443.
95101

96-
The module specifies the port via an environment variable at startup, and the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIISIntegration*> extension configures the server to listen on `http://localhost:{PORT}`. Additional checks are performed, and requests that don't originate from the module are rejected. The module doesn't support HTTPS forwarding, so requests are forwarded over HTTP even if received by IIS over HTTPS.
102+
<!-- make this a bullet list -->
103+
The ASP.NET Core Module specifies the port via an environment variable at startup. The <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIISIntegration*> extension configures the server to listen on `http://localhost:{PORT}`. Additional checks are performed, and requests that don't originate from the module are rejected. The module doesn't support HTTPS forwarding. Requests are forwarded over HTTP even if received by IIS over HTTPS.
97104

98-
After Kestrel picks up the request from the module, the request is pushed into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. Middleware added by IIS Integration updates the scheme, remote IP, and pathbase to account for forwarding the request to Kestrel. The app's response is passed back to IIS, which pushes it back out to the HTTP client that initiated the request.
105+
After Kestrel picks up the request from the module, the request is forwarded into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. Middleware added by IIS Integration updates the scheme, remote IP, and pathbase to account for forwarding the request to Kestrel. The app's response is passed back to IIS, which forwards it back to the HTTP client that initiated the request.
99106

100107
For ASP.NET Core Module configuration guidance, see <xref:host-and-deploy/aspnet-core-module>.
101108

@@ -154,7 +161,14 @@ services.Configure<IISOptions>(options =>
154161

155162
### Proxy server and load balancer scenarios
156163

157-
The [IIS Integration Middleware](#enable-the-iisintegration-components), which configures Forwarded Headers Middleware, and the ASP.NET Core Module are configured to forward the scheme (HTTP/HTTPS) and the remote IP address where the request originated. Additional configuration might be required for apps hosted behind additional proxy servers and load balancers. For more information, see [Configure ASP.NET Core to work with proxy servers and load balancers](xref:host-and-deploy/proxy-load-balancer).
164+
The [IIS Integration Middleware](#enable-the-iisintegration-components) and the ASP.NET Core Module are configured to forward the:
165+
166+
* Scheme (HTTP/HTTPS).
167+
* Remote IP address where the request originated.
168+
169+
The [IIS Integration Middleware](#enable-the-iisintegration-components) configures Forwarded Headers Middleware.
170+
171+
Additional configuration might be required for apps hosted behind additional proxy servers and load balancers. For more information, see [Configure ASP.NET Core to work with proxy servers and load balancers](xref:host-and-deploy/proxy-load-balancer).
158172

159173
### web.config file
160174

@@ -190,7 +204,7 @@ Sensitive files exist on the app's physical path, such as *\<assembly>.runtimeco
190204

191205
### Transform web.config
192206

193-
If you need to transform *web.config* on publish (for example, set environment variables based on the configuration, profile, or environment), see <xref:host-and-deploy/iis/transform-webconfig>.
207+
If you need to transform *web.config* on publish, see <xref:host-and-deploy/iis/transform-webconfig>. You might need to transform *web.config* on publish to set environment variables based on the configuration, profile, or environment.
194208

195209
## IIS configuration
196210

@@ -671,7 +685,11 @@ Use a 64-bit (x64) .NET Core SDK to publish a 64-bit app. A 64-bit runtime must
671685

672686
### In-process hosting model
673687

674-
Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. In-process hosting provides improved performance over out-of-process hosting because requests aren't proxied over the loopback adapter, a network interface that returns outgoing network traffic back to the same machine. IIS handles process management with the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
688+
Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. In-process hosting provides improved performance over out-of-process hosting because:
689+
690+
* Requests aren't proxied over the loopback adapter. A loopback adapter is a network interface that returns outgoing network traffic back to the same machine.
691+
692+
IIS handles process management with the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
675693

676694
The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module):
677695

aspnetcore/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,4 +1286,4 @@
12861286
- name: API reference
12871287
href: /dotnet/api/?view=aspnetcore-2.2
12881288
- name: Contribute
1289-
href: https://github.com/dotnet/AspNetCore.Docs/blob/master/CONTRIBUTING.md
1289+
href: https://github.com/dotnet/AspNetCore.Docs/blob/master/CONTRIBUTING.md

0 commit comments

Comments
 (0)