Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servers > ANCM update #5538

Merged
merged 6 commits into from
Feb 28, 2018
Merged

Servers > ANCM update #5538

merged 6 commits into from
Feb 28, 2018

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Feb 23, 2018

Fixes #5490

Internal Review Topic

Here's what I think we should be doing here:

  • I don't see any point in halfheartedly (or quarterheartedly really 😄) explaining how to configure an app with IIS and the module here. I think we have content elsewhere that we should be linking for that coverage. This seems like it should just be a basic intro to the module (fundamentals!!!!). I'd let our host-and-deploy topics take care of the details.
  • There were two 💎 gems 💎 in here dealing with configuration: I moved one to the Hosting on IIS topic and one to the module reference topic.
  • The sample was only providing a couple of lines. I think it's fairly useless these days with baked-in bits provided by CreateDefaultBuilder. The app config details are in the Hosting on IIS topic, so the sample is no longer needed here. 🎉
  • Getting rid of the fairly useless acronym "ANCM." It wasn't really in use all that much in other topics anyway. If IIS insiders want to use that among themselves, that's great. However, another tedious, cryptic acronym doesn't help the LOB dev imo. The topic works just fine using "ASP.NET Core Module" and "the module." For more reasoning on this, see my remarks at Servers > ANCM UE pass #5490 (comment).
  • Performed the usual grammar+style treatment, and I found myself revising quite a few phrases. I preserve most of the authors' intent and structure, and I hope you'll find that the passages I modified read a bit smoother.

@scottaddie There aren't any technical changes here, but I'll leave it up to you if you want to call for an engineering review.


## What ASP.NET Core Module does
The ASP.NET Core Module only works with the Kestrel server. The module isn't compatible with [HTTP.sys](xref:fundamentals/servers/httpsys) (formerly called [WebListener](xref:fundamentals/servers/weblistener)).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Kestrel server
Kestrel

isn't compatible
is incompatible


Because ASP.NET Core applications run in a process separate from the IIS worker process, ANCM also does process management. ANCM starts the process for the ASP.NET Core application when the first request comes in and restarts it when it crashes. This is essentially the same behavior as classic ASP.NET applications that run in-process in IIS and are managed by WAS (Windows Activation Service).
The ASP.NET Core Module is a native IIS module that plugs into the IIS pipeline to redirect web requests to backend ASP.NET Core apps. Many native modules, such as Windows Authentication remain active. The ASP.NET Core Module only takes control when a handler is selected for the request, and handler mapping is defined in the app's *web.config* file. To learn more about IIS modules active with the module, see [Using IIS modules](xref:host-and-deploy/iis/modules).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add a comma after "Windows Authentication"
  • I'm not entirely sure what this last sentence is trying to say. It's the part before the comma that I'd suggest rewording to add clarity.


Here's a diagram that illustrates the relationship between IIS, ANCM, and ASP.NET Core applications.
Because ASP.NET Core apps run in a process separate from the IIS worker process, the module also handles process management. The module starts the process for the ASP.NET Core app when the first request arrives and restarts the app if it crashes. This is essentially the same behavior as seen with .NET 4.x apps that run in-process in IIS that are managed by the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.NET 4.x apps --> ASP.NET 4.x apps


Configuration for the ASP.NET Core Module is stored in the *web.config* file that's located in the application's root folder. Settings in this file point to the startup command and arguments that start your ASP.NET Core app. For sample *web.config* code and guidance on configuration options, see [ASP.NET Core Module Configuration Reference](xref:host-and-deploy/aspnet-core-module).
Requests arrive from the web to the kernel mode HTTP.sys driver, which routes the requests into IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS). The module forwards the requests to Kestrel on a dynamically-configured port for the app, which isn't port 80/443.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Break this first sentence into 2, if possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, technet and MSDN hyphenate "kernel-mode," so I'll do that here. I'll fix the HTTP.sys doc later.

@@ -53,6 +55,10 @@ var host = new WebHostBuilder()

Both [UseKestrel](/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderkestrelextensions.usekestrel) and [UseIISIntegration](/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderiisextensions.useiisintegration) are required. Code calling `UseIISIntegration` doesn't affect code portability. If the app isn't run behind IIS (for example, the app is run directly on Kestrel), `UseIISIntegration` doesn't operate.

The ASP.NET Core Module generates a dynamic port to assign to the back-end process. The `UseIISIntegration` method picks up the dynamic port and configures Kestrel to listen on `http://locahost:{dynamicPort}/`. This overrides other URL configurations, such as calls to `UseUrls`. Therefore, a call to `UseUrls` isn't required when using the module. If `UseUrls` is called, Kestrel listens on the port specified when running the app without IIS.

If `UseUrls` is called in an ASP.NET Core 1.0 app, call it **before** calling `UseIISIntegration` so that the module-configured port isn't overwritten. This calling order isn't required with ASP.NET Core 1.1 because the module setting overrides `UseUrls`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the calling order in 2.x apps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is inside the 1.x tab. Since the calling order isn't relevant to 2.x, I think it's ok.


The ASP.NET Core Module is an IIS 7.5+ module which is responsible for process management of ASP.NET Core HTTP listeners and to proxy requests to processes that it manages. At the moment, the process to install the ASP.NET Core Module for IIS is manual. You will need to install the [.NET Core Windows Server Hosting bundle](https://download.microsoft.com/download/B/1/D/B1D7D5BF-3920-47AA-94BD-7A6E48822F18/DotNetCore.2.0.0-WindowsHosting.exe) on a regular (not Nano) machine. After installing the bundle on a regular machine, you will need to copy the following files to the file share that we created earlier.
The ASP.NET Core Module is an IIS 7.5+ module which is responsible for process management of ASP.NET Core HTTP listeners and to proxy requests to processes that it manages. At the moment, the process to install the ASP.NET Core Module for IIS is manual. You will need to install the [.NET Core Windows Server Hosting bundle](https://aka.ms/dotnetcore-2-windowshosting) on a regular (not Nano) machine. After installing the bundle on a regular machine, you will need to copy the following files to the file share that we created earlier.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to install
Install

you will need to copy
copy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a lot of "you" in this topic. I should make a pass on it later.

@scottaddie scottaddie requested a review from Tratcher February 23, 2018 15:51
@scottaddie
Copy link
Member

Let's have @Tratcher take a look while you're working on this.

@Tratcher Tratcher requested a review from jkotalik February 26, 2018 18:16
author: tdykstra
description: Introduces ASP.NET Core Module (ANCM), an IIS module that lets the Kestrel web server use IIS or IIS Express as a reverse proxy server.
description: Learn how the ASP.NET Core Module is an IIS module that allows the Kestrel web server use IIS or IIS Express as a reverse proxy server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Latest guidance I have is that these descriptions aren't supposed to merely describe topic's content. They're to be written in active tone advertising to the reader what will happen if they read the topic. Therefore, I've been starting with phrases such as "Learn how to ...", "Discover how to ...", and "Find out how to ...".
  2. Given that, the subject goes from the topic to you, and then the noun phrase becomes the object.
  3. Kind'a (mostly) dropping "ANCM." See my remarks in Servers > ANCM UE pass #5490 (comment).
  4. Per the guidance I've been given, this doc set is to lean more formal (and less conversational) than the style manual dictates. Therefore, the word "lets" becomes "allows."

I'd be happy to revert this (or anything you like here). Just give the word.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence doesn't parse

Learn how the ASP.NET Core Module is an IIS module that allows the Kestrel web server use IIS or IIS Express as a reverse proxy server.

"Learn about the ASP.NET Core Module, an IIS module that allows the Kestrel web server to use IIS or IIS Express as a reverse proxy server."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ... yes ... "TO" missing a "to" in there ...

Learn how the ASP.NET Core Module is an IIS module that allows the Kestrel web server to use IIS or IIS Express as a reverse proxy server.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my version is slightly more definitive and active.

Learn about something, where something is something that does something.

vs.

Learn how something is something that does something.

Shall we turn to @scottaddie to break the tie??!! 😄 lol

Learn about the ASP.NET Core Module, an IIS module that allows the Kestrel web server to use IIS or IIS Express as a reverse proxy server.

or

Learn how the ASP.NET Core Module is an IIS module that allows the Kestrel web server to use IIS or IIS Express as a reverse proxy server.

ms.prod: asp.net-core
ms.technology: aspnet
ms.topic: article
uid: fundamentals/servers/aspnet-core-module
---
# Introduction to ASP.NET Core Module
# ASP.NET Core Module for ASP.NET Core
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant?


By [Tom Dykstra](https://github.com/tdykstra), [Rick Strahl](https://github.com/RickStrahl), and [Chris Ross](https://github.com/Tratcher)

ASP.NET Core Module (ANCM) lets you run ASP.NET Core applications behind IIS, using IIS for what it's good at (security, manageability, and lots more) and using [Kestrel](kestrel.md) for what it's good at (being really fast), and getting the benefits from both technologies at once. **ANCM works only with Kestrel; it isn't compatible with WebListener (in ASP.NET Core 1.x) or HTTP.sys (in 2.x).**
The ASP.NET Core Module allows ASP.NET Core apps to run behind IIS in a reverse proxy configuration. IIS provides advanced web app security and manageability features. [Kestrel](xref:fundamentals/servers/kestrel) provides fast request processing. Creating a reverse proxy between Kestrel and IIS provides the benefits of both technologies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The performance is actually much worse than directly using Kestrel. Really what you get is a consistent application model across platforms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a consistent application model across platforms.

... you mean Kestrel does? I thought Tom (or whoever wrote this) was saying that Kestrel is faster than the ASP.NET 4.x runtime at processing requests. I thought he was saying IIS+ANCM+Kestrel is faster than IIS+ASP.NET 4.x.

We could dump the foul (and confusing 😵) contrast by dropping the end of the paragraph. The para becomes ...

The ASP.NET Core Module allows ASP.NET Core apps to run behind IIS in a reverse proxy configuration. IIS provides advanced web app security and manageability features.

@guardrex
Copy link
Collaborator Author

@scottaddie Nevermind ... @Eilon fixed it. 😄

Labels and assignments ... thank the 🙏 server gods 🙏 that I have my issue labels and assignment capabilities back.

@@ -1,126 +1,59 @@
---
title: ASP.NET Core Module
author: tdykstra
description: Introduces ASP.NET Core Module (ANCM), an IIS module that lets the Kestrel web server use IIS or IIS Express as a reverse proxy server.
description: Learn how the ASP.NET Core Module is an IIS module that allows the Kestrel web server to use IIS or IIS Express as a reverse proxy server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar seems odd here. I think "Learn how the ASP.NET Core Module allows the Kestrel web server to use IIS or IIS Express as a reverse proxy server."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing wrong with the grammar, but if the extra piece of info about the module being an IIS module isn't particularly helpful, then let's kill that bit off. I'll remove it on the next commit.


## What ASP.NET Core Module does
The ASP.NET Core Module only works with Kestrel. The module is incompatible with [HTTP.sys](xref:fundamentals/servers/httpsys) (formerly called [WebListener](xref:fundamentals/servers/weblistener)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to update this document based on our new inprocess feature. cc/ @shirhatti .

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Configuration for the ASP.NET Core Module is stored in the *web.config* file that's located in the application's root folder. Settings in this file point to the startup command and arguments that start your ASP.NET Core app. For sample *web.config* code and guidance on configuration options, see [ASP.NET Core Module Configuration Reference](xref:host-and-deploy/aspnet-core-module).
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 dynamically-configured port for the app, which isn't port 80/443.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dynamically configured should be replaced by random, as there is nothing to configure for what port is selected.

@guardrex
Copy link
Collaborator Author

@jkotalik Thanks ... changes made.

Copy link
Contributor

@jkotalik jkotalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guardrex
Copy link
Collaborator Author

ty @jkotalik

@scottaddie Another look? 👀

@@ -97,9 +97,9 @@ Install-NanoServerPackage -Name Microsoft-NanoServer-IIS-Package

To quickly verify if IIS is setup correctly, you can visit the URL `http://192.168.1.10/` and should see a welcome page. When IIS is installed, a website called `Default Web Site` listening on port 80 is created by default.

## Installing the ASP.NET Core Module (ANCM)
## Installing the ASP.NET Core Module
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing --> Install

@@ -51,7 +51,7 @@ Alternatively, these two properties can be configured in the *launchSettings.jso

## Enable Windows authentication with IIS

IIS uses the [ASP.NET Core Module](xref:fundamentals/servers/aspnet-core-module) (ANCM) to host ASP.NET Core apps. The ANCM flows Windows authentication to IIS by default. Configuration of Windows authentication is done within IIS, not the application project. The following sections show how to use IIS Manager to configure an ASP.NET Core app to use Windows authentication.
IIS uses the [ASP.NET Core Module](xref:fundamentals/servers/aspnet-core-module) to host ASP.NET Core apps. The module flows Windows authentication to IIS by default. Configuration of Windows authentication is done within IIS, not the application project. The following sections show how to use IIS Manager to configure an ASP.NET Core app to use Windows authentication.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application --> app

@guardrex
Copy link
Collaborator Author

ty @scottaddie Updates made.

@scottaddie scottaddie merged commit 9ecc699 into master Feb 28, 2018
@scottaddie scottaddie deleted the guardrex/servers-ancm-update branch February 28, 2018 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants