Skip to content

Commit ecf6a63

Browse files
Merge pull request #42835 from dotnet/main
Merge main into live
2 parents a5b706b + a3b91a6 commit ecf6a63

File tree

4 files changed

+54
-13
lines changed

4 files changed

+54
-13
lines changed

docs/core/compatibility/core-libraries/8.0/processstartinfo-windowstyle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: ".NET 8 breaking change: ProcessStartInfo.WindowStyle honored when UseShe
33
description: Learn about the .NET 8 breaking change in core .NET libraries where ProcessStartInfo.WindowStyle is now honored even when UseShellExecute is false.
44
ms.date: 11/08/2023
55
---
6-
# ProcessStartInfo.WindowsStyle honored when UseShellExecute is false
6+
# ProcessStartInfo.WindowStyle honored when UseShellExecute is false
77

88
Previously, <xref:System.Diagnostics.ProcessStartInfo.WindowStyle?displayName=nameWithType> was only honored when <xref:System.Diagnostics.ProcessStartInfo.UseShellExecute?displayName=nameWithType> was `true`. This change honors <xref:System.Diagnostics.ProcessStartInfo.WindowStyle> even when <xref:System.Diagnostics.ProcessStartInfo.UseShellExecute> is `false`.
99

docs/csharp/language-reference/keywords/partial-member.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ helpviewer_keywords:
99
---
1010
# Partial member (C# Reference)
1111

12-
A partial member has one *declaring declaration* and often one *implementing declaration*. The *declaring declaration* doesn't include a body. The *implementing declaration* provides the body of the member. Partial members enable class designers to provide member hooks, similar to event handlers, that developers can decide to implement or not. Partial types and members provide a way for human developers to write part of a type while tools write other parts of the type. If the developer doesn't supply an optional implementing declaration, the compiler can remove the declaring declaration at compile time. The following conditions apply to partial members:
12+
A partial member has one *declaring declaration* and often one *implementing declaration*. The *declaring declaration* doesn't include a body. The *implementing declaration* provides the body of the member. Partial members enable class designers to provide member hooks that can be implemented by tooling such as source generators. Partial types and members provide a way for human developers to write part of a type while tools write other parts of the type. If the developer doesn't supply an optional implementing declaration, the compiler can remove the declaring declaration at compile time. The following conditions apply to partial members:
1313

1414
- Declarations must begin with the contextual keyword [partial](../../language-reference/keywords/partial-type.md).
1515
- Signatures in both parts of the partial type must match.

docs/fundamentals/code-analysis/quality-rules/ca2262.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ HttpClientHandler handler = new()
4040
// Violation
4141
MaxResponseHeadersLength = 512
4242

43-
// Fix
44-
MaxResponseHeadersLength = 0.512
43+
// Fix (it is not possible to specify a limit lower than 1 KB)
44+
MaxResponseHeadersLength = 1
4545
};
4646
```
4747

@@ -51,8 +51,8 @@ Dim handler As New HttpClientHandler With {
5151
' Violation
5252
.MaxResponseHeadersLength = 512
5353

54-
' Fix
55-
.MaxResponseHeadersLength = 0.512
54+
' Fix (it is not possible to specify a limit lower than 1 KB)
55+
.MaxResponseHeadersLength = 1
5656
}
5757
```
5858

docs/orleans/deployment/deploy-to-azure-app-service.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Deploy Orleans to Azure App Service
33
description: Learn how to deploy an Orleans shopping cart app to Azure App Service.
4-
ms.date: 07/03/2024
4+
ms.date: 10/01/2024
55
ms.topic: tutorial
66
ms.custom: devx-track-bicep
77
---
@@ -30,7 +30,7 @@ In this tutorial, you learn how to:
3030

3131
- A [GitHub account](https://github.com/join)
3232
- [Read an introduction to Orleans](../overview.md)
33-
- The [.NET 7 SDK](https://dotnet.microsoft.com/download/dotnet)
33+
- The [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet)
3434
- The [Azure CLI](/cli/azure/install-azure-cli)
3535
- A .NET integrated development environment (IDE)
3636
- Feel free to use [Visual Studio](https://visualstudio.microsoft.com) or [Visual Studio Code](https://code.visualstudio.com)
@@ -112,6 +112,47 @@ When items are in your cart, you can view them and change their quantity, and ev
112112
> [!IMPORTANT]
113113
> When this app runs locally, in a development environment, the app will use localhost clustering, in-memory storage, and a local silo. It also seeds the inventory with fake data that is automatically generated using the [Bogus NuGet](https://www.nuget.org/packages/bogus) package. This is all intentional to demonstrate the functionality.
114114
115+
## Deployment overview
116+
117+
Orleans applications are designed to scale up and scale out efficiently. To accomplish this, instances of your application communicate directly with each other via TCP sockets and therefore Orleans requires network connectivity between silos. Azure App Service supports this requirement via [virtual network integration](https://learn.microsoft.com/azure/app-service/overview-vnet-integration) and additional configuration instructing App Service to allocate private network ports for your app instances.
118+
119+
When deploying Orleans to Azure App Service, we need to take the following actions to ensure that hosts can communicate with eachother:
120+
121+
- Enable virtual network integration by following the [Enable integration with an Azure virtual network](https://learn.microsoft.com/azure/app-service/configure-vnet-integration-enable) guide.
122+
- Configure your app with private ports using the Azure CLI as described in the [Configure private port count using Azure CLI](#configure-private-port-count-using-azure-cli) section. The Bicep template in the [Explore the Bicep templates](#explore-the-bicep-templates) section below shows how to configure the setting via Bicep.
123+
- If deploying to Linux, ensure that your hosts are listening on all IP addresses as described in the [Configure host networking](#configure-host-networking) section.
124+
125+
### Configure private port count using Azure CLI
126+
127+
```azurecli
128+
az webapp config set -g '<resource-group-name>' --subscription '<subscription-id>' -n '<app-service-app-name>' --generic-configurations '{\"vnetPrivatePortsCount\": "2"}'
129+
```
130+
131+
### Configure host networking
132+
133+
Once Azure App Service has been configured with virtual network (VNet) integration and configured to provide application instances with at least 2 private ports each, two additional environment variables will be provided to your app processes: `WEBSITE_PRIVATE_IP` and `WEBSITE_PRIVATE_PORTS`. These variables provide two important pieces of information:
134+
135+
- Which IP address other hosts in your virtual network can use to contact a given app instance; and
136+
- Which ports on that IP address will be routed to that app instance
137+
138+
The `WEBSITE_PRIVATE_IP` variable specifies an IP which is routable from the VNet, but not necessarily an IP address which your app instance can directly bind to. For this reason, you should instruct your host to bind to all internal addresses by passing `listenOnAnyHostAddress: true` to the `ConfigureEndpoints` method call, as in the following example which configures an `ISiloBuilder` instance to consume the injected environment variables and to listen on the correct interfaces:
139+
140+
```csharp
141+
var endpointAddress = IPAddress.Parse(builder.Configuration["WEBSITE_PRIVATE_IP"]!);
142+
var strPorts = builder.Configuration["WEBSITE_PRIVATE_PORTS"]!.Split(',');
143+
if (strPorts.Length < 2)
144+
{
145+
throw new Exception("Insufficient private ports configured.");
146+
}
147+
148+
var (siloPort, gatewayPort) = (int.Parse(strPorts[0]), int.Parse(strPorts[1]));
149+
150+
siloBuilder
151+
.ConfigureEndpoints(endpointAddress, siloPort, gatewayPort, listenOnAnyHostAddress: true)
152+
```
153+
154+
The above code is present in the [Azure Samples: Orleans Cluster on Azure App Service](https://github.com/Azure-Samples/Orleans-Cluster-on-Azure-App-Service) repository, too, so you can see it in the context of the rest of the host configuration.
155+
115156
## Deploy to Azure App Service
116157

117158
A typical Orleans application consists of a cluster of server processes (silos) where grains live, and a set of client processes, usually web servers, that receive external requests, turn them into grain method calls and return results. Hence, the first thing one needs to do to run an Orleans application is to start a cluster of silos. For testing purposes, a cluster can consist of a single silo.
@@ -157,10 +198,10 @@ jobs:
157198
steps:
158199
- uses: actions/checkout@v3
159200

160-
- name: Setup .NET 7.0
201+
- name: Setup .NET 8.0
161202
uses: actions/setup-dotnet@v3
162203
with:
163-
dotnet-version: 7.0.x
204+
dotnet-version: 8.0.x
164205

165206
- name: .NET publish shopping cart app
166207
run: dotnet publish ./Silo/Orleans.ShoppingCart.Silo.csproj --configuration Release
@@ -417,7 +458,7 @@ resource appService 'Microsoft.Web/sites@2021-03-01' = {
417458
siteConfig: {
418459
vnetPrivatePortsCount: 2
419460
webSocketsEnabled: true
420-
netFrameworkVersion: 'v6.0'
461+
netFrameworkVersion: 'v8.0'
421462
appSettings: [
422463
{
423464
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
@@ -451,7 +492,7 @@ resource stagingSlot 'Microsoft.Web/sites/slots@2022-03-01' = {
451492
http20Enabled: true
452493
vnetPrivatePortsCount: 2
453494
webSocketsEnabled: true
454-
netFrameworkVersion: 'v7.0'
495+
netFrameworkVersion: 'v8.0'
455496
appSettings: [
456497
{
457498
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
@@ -494,7 +535,7 @@ resource appServiceConfig 'Microsoft.Web/sites/config@2021-03-01' = {
494535
}
495536
```
496537

497-
This bicep file configures the Azure App Service as a .NET 7 application. Both the `appServicePlan` resource and the `appService` resource are provisioned in the resource group's location. The `appService` resource is configured to use the `S1` SKU, with a capacity of `1`. Additionally, the resource is configured to use the `vnetSubnetId` subnet and to use HTTPS. It also configures the `appInsightsInstrumentationKey` instrumentation key, the `appInsightsConnectionString` connection string, and the `storageConnectionString` connection string. These are used by the shopping cart app.
538+
This bicep file configures the Azure App Service as a .NET 8 application. Both the `appServicePlan` resource and the `appService` resource are provisioned in the resource group's location. The `appService` resource is configured to use the `S1` SKU, with a capacity of `1`. Additionally, the resource is configured to use the `vnetSubnetId` subnet and to use HTTPS. It also configures the `appInsightsInstrumentationKey` instrumentation key, the `appInsightsConnectionString` connection string, and the `storageConnectionString` connection string. These are used by the shopping cart app.
498539

499540
The aforementioned Visual Studio Code extension for Bicep includes a visualizer. All of these bicep files are visualized as follows:
500541

0 commit comments

Comments
 (0)