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
Copy file name to clipboardExpand all lines: aspnetcore/data/scaffold_RP.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ dotnet ef database update
75
75
```
76
76
77
77
In The preceding commands:
78
+
78
79
*`dotnet tool uninstall --global dotnet-ef` uninstalls the `dotnet-ef` tool. Uninstalling ensures the latest tool is successfully installed. If `dotnet-ef` isn't installed, an error messages **A tool with the package Id 'dotnet-ef' could not be found.** You can ignore this message.
79
80
*`dotnet tool install --global dotnet-ef` installs globally the `dotnet-ef` tool.
80
81
*`dotnet ef migrations add initialMigration` adds the initial migration. For more information, see [Create the initial database schema using EF's migration feature](/aspnet/core/tutorials/razor-pages/model&tabs=visual-studio-code)
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/openapi/include-metadata.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -516,6 +516,7 @@ public record Todo(
516
516
In a class, struct, or record, properties with the [`[Required]`](xref:System.ComponentModel.DataAnnotations.RequiredAttribute) attribute or [required](/dotnet/csharp/language-reference/proposals/csharp-11.0/required-members#required-modifier) modifier are always `required` in the corresponding schema.
517
517
518
518
Other properties may also be required based on the constructors (implicit and explicit) for the class, struct, or record.
519
+
519
520
* For a class or record class with a single public constructor, any property with the same type and name (case-insensitive match) as a parameter to the constructor is required in the corresponding schema.
520
521
* For a class or record class with multiple public constructors, no other properties are required.
521
522
* For a struct or record struct, no other properties are required since C# always defines an implicit parameterless constructor for a struct.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/portable-object-localization.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ This article walks through the steps for using Portable Object (PO) files in an
21
21
## What is a PO file?
22
22
23
23
PO files are distributed as text files containing the translated strings for a given language. Some advantages of using PO files instead of *.resx* files include:
24
+
24
25
* PO files support pluralization; *.resx* files don't support pluralization.
25
26
* PO files aren't compiled like *.resx* files. As such, specialized tooling and build steps aren't required.
26
27
* PO files work well with collaborative online editing tools.
@@ -236,6 +237,7 @@ This article walks through the steps for using Portable Object (PO) files in an
236
237
## What is a PO file?
237
238
238
239
PO files are distributed as text files containing the translated strings for a given language. Some advantages of using PO files instead of *.resx* files include:
240
+
239
241
* PO files support pluralization; *.resx* files don't support pluralization.
240
242
* PO files aren't compiled like *.resx* files. As such, specialized tooling and build steps aren't required.
241
243
* PO files work well with collaborative online editing tools.
@@ -447,6 +449,7 @@ This article walks through the steps for using Portable Object (PO) files in an
447
449
## What is a PO file?
448
450
449
451
PO files are distributed as text files containing the translated strings for a given language. Some advantages of using PO files instead of *.resx* files include:
452
+
450
453
* PO files support pluralization; *.resx* files don't support pluralization.
451
454
* PO files aren't compiled like *.resx* files. As such, specialized tooling and build steps aren't required.
452
455
* PO files work well with collaborative online editing tools.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/config-files.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,9 +90,11 @@ Example:
90
90
### Routes
91
91
92
92
The routes section is an unordered collection of route matches and their associated configuration. A route requires at least the following fields:
93
+
93
94
* RouteId - a unique name
94
95
* ClusterId - refers to the name of an entry in the clusters section.
95
96
* Match - contains either a Hosts array or a Path pattern string. Path is an ASP.NET Core route template that can be defined as [explained here](/aspnet/core/fundamentals/routing#route-templates).
97
+
96
98
Route matching is based on the most specific routes having highest precedence as described [here](/aspnet/core/fundamentals/routing#url-matching). Explicit ordering can be achieved using the `order` field, with lower values taking higher priority.
97
99
98
100
[Headers](xref:fundamentals/servers/yarp/header-routing), [Authorization](xref:fundamentals/servers/yarp/authn-authz), [CORS](xref:fundamentals/servers/yarp/cors), and other route based policies can be configured on each route entry. For additional fields see [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig).
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/config-filters.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ ai-usage: ai-assisted
16
16
YARP configuration for routes, clusters, and destinations can be loaded from [configuration files](xref:fundamentals/servers/yarp/config-files) or from [configuration providers](xref:fundamentals/servers/yarp/config-providers). Configuration filters can be used to modify that raw input before it's validated and applied.
17
17
18
18
Filters can be used for a variety of purposes such as:
19
+
19
20
* Supplementing config fields with data from other sources like the deployment environment
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/config-providers.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ Configuration can be modified during the load sequence using [Configuration Filt
24
24
25
25
### Routes
26
26
The routes section is an unordered collection of named routes. A route contains matches and their associated configuration. A route requires at least the following fields:
27
+
27
28
* RouteId - a unique name
28
29
* ClusterId - refers to the name of an entry in the clusters section.
29
30
* Match - contains either a Hosts array or a Path pattern string. Path is an ASP.NET Core route template that can be defined as [explained here](/aspnet/core/fundamentals/routing#route-templates).
The `IProxyConfigProvider` should be registered in the DI container as a singleton. At startup, the proxy will resolve this instance and call `GetConfig()`. On this first call the provider may choose to:
59
+
58
60
* Throw an exception if the provider cannot produce a valid proxy configuration for any reason. This will prevent the application from starting.
59
61
* Synchronously block while it loads the configuration. This will block the application from starting until valid route data is available.
60
62
* Or, it may choose to return an empty `IProxyConfig` instance while it loads the configuration in the background. The provider will need to trigger the `IChangeToken` when the configuration is available.
@@ -68,12 +70,14 @@ The configuration objects and collections supplied to the proxy should be read-o
68
70
If the `IChangeToken` supports `ActiveChangeCallbacks`, once the proxy has processed the initial set of configurations it will register a callback with this token. If the provider does not support callbacks then `HasChanged` will be polled every 5 minutes.
69
71
70
72
When the provider wants to provide a new configuration to the proxy it should:
73
+
71
74
* Load that configuration in the background.
72
-
- Route and cluster objects are immutable, so new instances have to be created for any new data.
73
-
- Objects for unchanged routes and clusters can be re-used, or new instances can be created - changes will be detected by diffing them.
75
+
* Route and cluster objects are immutable, so new instances have to be created for any new data.
76
+
* Objects for unchanged routes and clusters can be re-used, or new instances can be created - changes will be detected by diffing them.
74
77
* Optionally validate the configuration using the [IConfigValidator](xref:Yarp.ReverseProxy.Configuration.IConfigValidator), and only then signal the `IChangeToken` from the prior `IProxyConfig` instance that new data is available. The proxy will call `GetConfig()` again to retrieve the new data.
75
78
76
79
There are important differences when reloading configuration vs the first configuration load.
80
+
77
81
* The new configuration will be diffed against the current one and only modified routes or clusters will be updated. The update will be applied atomically and will only affect new requests, not requests currently in progress.
78
82
* Any errors in the reload process will be logged and suppressed. The application will continue using the last known good configuration.
79
83
* If `GetConfig()` throws the proxy will be unable to listen for future changes because `IChangeToken`s are single-use.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/destination-resolvers.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ YARP uses a destination resolver to expand the set of configured destination add
26
26
27
27
### Startup
28
28
The `IDestinationResolver` should be registered in the DI container as a singleton. At startup, the proxy will resolve this instance and call `ResolveDestinationsAsync(...)` with the configured destinations retrieved from the resolved `IProxyConfigProviders`. On this first call the provider may choose to:
29
+
29
30
* Throw an exception if the provider cannot produce a valid proxy configuration for any reason. This will prevent the application from starting.
30
31
* Asynchronously resolve the destinations. This will stop the application from starting until resolved destinations are available.
31
32
* Or, it may choose to return an empty `ResolvedDestinationCollection` instance while it resolves destinations in the background. The provider will need to trigger the `IChangeToken` when the configuration is available.
@@ -37,9 +38,10 @@ The destinations objects and collections supplied to the proxy should be read-on
37
38
If the `IChangeToken` supports `ActiveChangeCallbacks`, once the proxy has processed the initial set of destinations it will register a callback with this token. If the provider does not support callbacks then `HasChanged` will be polled alongside `IProxyConfig` change tokens, every 5 minutes.
38
39
39
40
When the provider wants to provide a new set of destinations to the proxy it should:
41
+
40
42
* Resolve those destinations in the background.
41
-
-`ResolvedDestinationCollection` is immutable, so new instances have to be created for any new data.
42
-
- Objects for unchanged destinations can be re-used, or new instances can be created.
43
+
*`ResolvedDestinationCollection` is immutable, so new instances have to be created for any new data.
44
+
* Objects for unchanged destinations can be re-used, or new instances can be created.
43
45
* Invalidate the `IChangeToken` returned from the previous `ResolveDestinationsAsync` invocation.
44
46
45
47
Once the new destinations have been applied, the proxy will register a callback with the new `IChangeToken`. Note if there are multiple reloads signaled in close succession, the proxy may skip some and resolve destinations as soon as it's ready.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/dests-health-checks.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,9 +93,10 @@ Active health check settings can also be defined in code via the corresponding t
93
93
94
94
`Destination` section and [DestinationConfig](xref:Yarp.ReverseProxy.Configuration.DestinationConfig).
95
95
96
-
*`Health` - A dedicated health probing endpoint such as `http://destination:12345/`. Defaults `null` and falls back to `Destination/Address`.
96
+
`Health`: A dedicated health probing endpoint such as `http://destination:12345/`. Defaults `null` and falls back to `Destination/Address`.
97
97
98
98
### Built-in policies
99
+
99
100
There is currently one built-in active health check policy - `ConsecutiveFailuresHealthPolicy`. It counts consecutive health probe failures and marks a destination as unhealthy once the given threshold is reached. On the first successful response, a destination is marked as healthy and the counter is reset.
100
101
The policy parameters are set in the cluster's metadata as follows:
101
102
@@ -347,8 +348,8 @@ public class FirstUnsuccessfulResponseHealthPolicy : IPassiveHealthCheckPolicy
347
348
Destinations health state is used to determine which of them are eligible for receiving proxied requests. Each cluster maintains its own list of available destinations on `AvailableDestinations` property of the [ClusterDestinationState](xref:Yarp.ReverseProxy.Model.ClusterDestinationsState) type. That list gets rebuilt when any destination's health state changes. The [IClusterDestinationsUpdater](xref:Yarp.ReverseProxy.Health.IClusterDestinationsUpdater) controls that process and calls an [IAvailableDestinationsPolicy](xref:Yarp.ReverseProxy.Health.IAvailableDestinationsPolicy) configured on the cluster to actually choose the available destinations from the all cluster's destinations. There are the following built-in policies provided and custom ones can be implemented if necessary.
348
349
349
350
*`HealthyAndUnknown` - Inspects each `DestinationState` and adds it on the available destination list if all of the following statements are TRUE. If no destinations are available then requests will get a 503 error.
350
-
- Active health checks are disabled on the cluster OR `DestinationHealthState.Active != DestinationHealth.Unhealthy`
351
-
- Passive health checks are disabled on the cluster OR `DestinationHealthState.Passive != DestinationHealth.Unhealthy`
351
+
* Active health checks are disabled on the cluster OR `DestinationHealthState.Active != DestinationHealth.Unhealthy`
352
+
* Passive health checks are disabled on the cluster OR `DestinationHealthState.Passive != DestinationHealth.Unhealthy`
352
353
*`HealthyOrPanic` - Calls `HealthyAndUnknown` policy at first to get the available destinations. If none of them are returned from this call, it marks all cluster's destinations as available. This is the default policy.
353
354
354
355
**NOTE**: An available destination policy configured on a cluster will be always called regardless of if any health check is enabled on the given cluster. The health state of a disabled health check is set to `Unknown`.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/direct-forwarding.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,15 @@ Some applications only need the ability to take a specific request and forward i
19
19
[IHttpForwarder](xref:Yarp.ReverseProxy.Forwarder.IHttpForwarder) serves as the core proxy adapter between incoming AspNetCore and outgoing System.Net.Http requests. It handles the mechanics of creating a HttpRequestMessage from a HttpContext, sending it, and relaying the response.
20
20
21
21
IHttpForwarder supports:
22
+
22
23
* Dynamic destination selection, you specify the destination for each request
23
24
* Http client customization, you provide the HttpMessageInvoker
24
25
* Request and response customization (except bodies)
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/header-routing.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -290,6 +290,7 @@ A list of possible values to search for. The header must match at least one of t
290
290
### Mode
291
291
292
292
[HeaderMatchMode](xref:Yarp.ReverseProxy.Configuration.HeaderMatchMode) specifies how to match the value(s) against the request header. The default is `ExactHeader`.
293
+
293
294
* ExactHeader - Any of the headers with the given name must match in its entirety, subject to the value of `IsCaseSensitive`. If a header contains multiple values (separated by `,` or `;`), they are split before matching. A single pair of quotes will also be stripped from the value before matching.
294
295
* HeaderPrefix - Any of the headers with the given name must match by prefix, subject to the value of `IsCaseSensitive`. If a header contains multiple values (separated by `,` or `;`), they are split before matching. A single pair of quotes will also be stripped from the value before matching.
295
296
* Exists - The header must exist and contain any non-empty value. If there are multiple headers with the same name, the rule will also match.
0 commit comments