Skip to content

Commit 8a39428

Browse files
committed
Merge branch 'main' into release-aio-2603
2 parents d1e6456 + c9cc211 commit 8a39428

27 files changed

Lines changed: 681 additions & 322 deletions

articles/azure-functions/durable/durable-functions-dotnet-entities.md

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,65 @@ public class Counter : TaskEntity<int>
151151
152152
### Deleting entities in the isolated model
153153

154-
Deleting an entity in the isolated model is accomplished by setting the entity state to `null`, and this process depends on the entity implementation path used:
154+
Deleting an entity in the isolated model is accomplished by setting the entity state to `null`, and this process depends on the entity implementation path used.
155+
156+
#### Delete with ITaskEntity or function-based syntax
157+
158+
When deriving from `ITaskEntity` or using [function based syntax](#function-based-syntax), delete is accomplished by calling `TaskEntityOperation.State.SetState(null)`:
159+
160+
```csharp
161+
// Inside a function-based entity dispatch
162+
switch (operation.Name.ToLowerInvariant())
163+
{
164+
case "delete":
165+
operation.State.SetState(null);
166+
break;
167+
}
168+
```
169+
170+
#### Delete with TaskEntity\<TState\>
171+
172+
When deriving from `TaskEntity<TState>`, a delete operation is implicitly defined. However, it can be overridden by defining a method `Delete` on the entity. State can also be deleted from any operation via `this.State = null`.
173+
174+
- To delete by setting state to `null` requires `TState` to be nullable.
175+
- The implicitly defined delete operation deletes non-nullable `TState`.
176+
177+
The following example shows a `TaskEntity<int?>` with nullable state that overrides the default delete:
178+
179+
```csharp
180+
public class Counter : TaskEntity<int?>
181+
{
182+
public void Delete()
183+
{
184+
// Custom logic before deleting, such as logging
185+
this.State = null;
186+
}
187+
188+
[Function(nameof(Counter))]
189+
public static Task Run([EntityTrigger] TaskEntityDispatcher dispatcher)
190+
=> dispatcher.DispatchAsync<Counter>();
191+
}
192+
```
193+
194+
#### Delete with a POCO entity
195+
196+
When using a POCO as your state (not deriving from `TaskEntity<TState>`), a delete operation is implicitly defined. It's possible to override the delete operation by defining a method `Delete` on the POCO. However, there isn't a way to set state to `null` in the POCO route, so the implicitly defined delete operation is the only true delete.
197+
198+
```csharp
199+
public class Counter
200+
{
201+
public int Value { get; set; }
202+
203+
// The implicit delete operation handles state removal.
204+
// Defining a Delete method here overrides the implicit behavior,
205+
// but you cannot set state to null from within a POCO entity.
206+
207+
[Function(nameof(Counter))]
208+
public static Task Run([EntityTrigger] TaskEntityDispatcher dispatcher)
209+
=> dispatcher.DispatchAsync<Counter>();
210+
}
211+
```
155212

156-
- When deriving from `ITaskEntity` or using [function based syntax](#function-based-syntax), delete is accomplished by calling `TaskEntityOperation.State.SetState(null)`.
157-
- When deriving from `TaskEntity<TState>`, delete is implicitly defined. However, it can be overridden by defining a method `Delete` on the entity. State can also be deleted from any operation via `this.State = null`.
158-
- To delete by setting state to null requires `TState` to be nullable.
159-
- The implicitly defined delete operation deletes non-nullable `TState`.
160-
- When using a POCO as your state (not deriving from `TaskEntity<TState>`), delete is implicitly defined. It's possible to override the delete operation by defining a method `Delete` on the POCO. However, there isn't a way to set state to `null` in the POCO route, so the implicitly defined delete operation is the only true delete.
161213
::: zone-end
162214

163215
::: zone pivot="in-proc"

articles/azure-functions/durable/durable-functions-dotnet-isolated-overview.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,66 @@ public static class MyFunctions
5353
}
5454
```
5555

56-
#### Class-based example
56+
#### Class-based example (with input/output)
5757

5858
```csharp
59-
[Function(nameof(MyOrchestration))]
60-
public static async Task<string> MyOrchestration(
61-
[OrchestrationTrigger] TaskOrchestrationContext context)
59+
using Microsoft.DurableTask;
60+
61+
[DurableTask]
62+
public class MyOrchestration : TaskOrchestrator<string, string>
63+
{
64+
public override async Task<string> RunAsync(TaskOrchestrationContext context, string input)
65+
{
66+
return await context.CallActivityAsync<string>(nameof(MyActivity), input);
67+
}
68+
}
69+
70+
[DurableTask]
71+
public class MyActivity : TaskActivity<string, string>
72+
{
73+
public override Task<string> RunAsync(TaskActivityContext context, string input)
74+
{
75+
return Task.FromResult($"Processed: {input}");
76+
}
77+
}
78+
```
79+
80+
#### Class-based example (no input/output, `ILogger` in activity)
81+
82+
```csharp
83+
using Microsoft.DurableTask;
84+
using Microsoft.Extensions.Logging;
85+
86+
[DurableTask]
87+
public class MaintenanceOrchestration : TaskOrchestrator<object?, object?>
6288
{
63-
string input = context.GetInput<string>()!;
64-
return await context.CallActivityAsync<string>(nameof(MyActivity), input);
89+
public override async Task<object?> RunAsync(TaskOrchestrationContext context, object? input)
90+
{
91+
await context.CallActivityAsync(nameof(WriteHeartbeatLogActivity), (object?)null);
92+
return null;
93+
}
6594
}
6695

67-
[Function(nameof(MyActivity))]
68-
public static string MyActivity([ActivityTrigger] string input)
96+
[DurableTask]
97+
public class WriteHeartbeatLogActivity : TaskActivity<object?, object?>
6998
{
70-
return $"Processed: {input}";
99+
private readonly ILogger<WriteHeartbeatLogActivity> _logger;
100+
101+
public WriteHeartbeatLogActivity(ILogger<WriteHeartbeatLogActivity> logger)
102+
{
103+
_logger = logger;
104+
}
105+
106+
public override Task<object?> RunAsync(TaskActivityContext context, object? input)
107+
{
108+
_logger.LogInformation("Heartbeat logged at {Timestamp}.", DateTimeOffset.UtcNow);
109+
return Task.FromResult<object?>(null);
110+
}
71111
}
72112
```
73113

114+
Use `object?` as the generic type argument for class-based orchestrations and activities that don't need functional input or output. This pattern lets you use dependency injection (for example, `ILogger<T>`) in activities while still using the class-based model.
115+
74116
## Durable entities
75117

76118
Durable entities are supported in the .NET isolated worker. For more information, see the [developer's guide](./durable-functions-dotnet-entities.md).

articles/azure-functions/durable/durable-functions-instance-management.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static async Task Run(
6767
```
6868

6969
> [!NOTE]
70-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, use the `OrchestrationClient` attribute instead of the `DurableClient` attribute, and use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see [Durable Functions versions](durable-functions-versions.md).
70+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
7171
7272
# [JavaScript](#tab/javascript)
7373

@@ -381,7 +381,7 @@ public static async Task Run(
381381
```
382382

383383
> [!NOTE]
384-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, use the `OrchestrationClient` attribute instead of the `DurableClient` attribute, and use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
384+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
385385
386386
# [JavaScript](#tab/javascript)
387387

@@ -547,7 +547,7 @@ public static async Task Run(
547547
```
548548

549549
> [!NOTE]
550-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, you must use `OrchestrationClient` attribute instead of the `DurableClient` attribute, and you must use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
550+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
551551
552552
# [JavaScript](#tab/javascript)
553553

@@ -713,7 +713,7 @@ public static async Task Run(
713713
```
714714

715715
> [!NOTE]
716-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, you must use `OrchestrationClient` attribute instead of the `DurableClient` attribute, and you must use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
716+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
717717
718718
# [JavaScript](#tab/javascript)
719719

@@ -907,7 +907,7 @@ public static Task Run(
907907
```
908908

909909
> [!NOTE]
910-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, you must use `OrchestrationClient` attribute instead of the `DurableClient` attribute, and you must use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
910+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
911911
912912
# [JavaScript](#tab/javascript)
913913

@@ -1233,7 +1233,7 @@ public static Task Run(
12331233
```
12341234

12351235
> [!NOTE]
1236-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, you must use `OrchestrationClient` attribute instead of the `DurableClient` attribute, and you must use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
1236+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
12371237
12381238
# [JavaScript](#tab/javascript)
12391239

@@ -1612,7 +1612,7 @@ public static void SendInstanceInfo(
16121612
```
16131613

16141614
> [!NOTE]
1615-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, use `DurableActivityContext` instead of `IDurableActivityContext`, use the `OrchestrationClient` attribute instead of the `DurableClient` attribute, and use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
1615+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient` and `IDurableActivityContext`, which are marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
16161616
16171617
# [JavaScript](#tab/javascript)
16181618

@@ -1704,7 +1704,7 @@ public static Task Run(
17041704
```
17051705

17061706
> [!NOTE]
1707-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, you must use `OrchestrationClient` attribute instead of the `DurableClient` attribute, and you must use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
1707+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
17081708
17091709
# [JavaScript](#tab/javascript)
17101710

@@ -1823,7 +1823,7 @@ public static Task Run(
18231823
```
18241824

18251825
> [!NOTE]
1826-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, you must use `OrchestrationClient` attribute instead of the `DurableClient` attribute, and you must use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
1826+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
18271827
18281828
# [JavaScript](#tab/javascript)
18291829

@@ -2046,7 +2046,7 @@ public static Task Run(
20462046
```
20472047

20482048
> [!NOTE]
2049-
> The previous C# code is for Durable Functions 2.x. For Durable Functions 1.x, you must use `OrchestrationClient` attribute instead of the `DurableClient` attribute, and you must use the `DurableOrchestrationClient` parameter type instead of `IDurableOrchestrationClient`. For more information about the differences between versions, see the [Durable Functions versions](durable-functions-versions.md) article.
2049+
> The previous C# code uses the in-process model with `IDurableOrchestrationClient`, which is marked as obsolete in newer versions of the Durable Functions extension. For new .NET projects, consider using the [.NET isolated worker model](durable-functions-dotnet-isolated-overview.md) with `DurableTaskClient`. For more information, see the [Durable Functions versions](durable-functions-versions.md) article.
20502050
20512051
# [JavaScript](#tab/javascript)
20522052

articles/azure-functions/flex-consumption-plan.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Keep these other considerations in mind when using Flex Consumption plan:
199199
+ **Certificates**: Loading certificates with the WEBSITE_LOAD_CERTIFICATES app setting, managed certificates, app service certificates, and other platform certificate-based features like endToEndEncryptionEnabled are currently not supported.
200200
+ **Timezones**: `WEBSITE_TIME_ZONE` and `TZ` app settings aren't currently supported when running on Flex Consumption plan.
201201
+ **Azure Functions Runtime Version and Proxies**: Flex Consumption only supports version 4.x and later of the Azure Functions runtime. Azure Functions proxies was a feature of versions 1.x through 3.x of the Azure Functions runtime and is not available in Flex Consumption.
202+
+ **Plan migration**: In-place migration of an existing function app from another hosting plan to the Flex Consumption plan isn't supported, and neither is migrating from Flex Consumption to another plan. To move to Flex Consumption, you must create a new function app in a Flex Consumption plan and redeploy your code.
202203

203204
## Related articles
204205

articles/azure-functions/functions-how-to-use-azure-function-app-settings.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ In the previous example, replace `<RESOURCE_GROUP>` and `<FUNCTION_APP_NAME>` wi
193193
You can migrate a function app between a Consumption plan and a Premium plan on Windows.
194194

195195
>[!TIP]
196-
>We recommend you migrate your Consumption plan app to run in a Flex Consumption plan instead of a Premium plan. Migration to the Flex Consumption plan is the only migration option for a Linux Consumption plan app. For more information, see [Migrate Consumption plan apps to the Flex Consumption plan](migration/migrate-plan-consumption-to-flex.md).
196+
>We recommend you run your Consumption plan app in a Flex Consumption plan instead of a Premium plan. For a Linux Consumption plan app, moving to the Flex Consumption plan is the only option. Because in-place plan migration to and from Flex Consumption isn't supported, you must create a new function app in the Flex Consumption plan. For more information, see [Migrate Consumption plan apps to the Flex Consumption plan](migration/migrate-plan-consumption-to-flex.md), which walks you through creating a new Flex Consumption app with the same settings as your existing app.
197197
198198
When migrating between plans, keep in mind the following considerations:
199199

@@ -203,6 +203,7 @@ When migrating between plans, keep in mind the following considerations:
203203
+ The specific CLI commands depend on the direction of the migration.
204204
+ Downtime in your function executions occurs as the function app is migrated between plans.
205205
+ State and other app-specific content is maintained, because the same Azure Files share is used by the app both before and after migration.
206+
+ In-place plan migration to or from the Flex Consumption plan isn't supported. You must create a new function app in the Flex Consumption plan.
206207

207208
You can migrate your plan using these tools:
208209

articles/azure-maps/migrate-route-v1-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ This article explains how to migrate the [Azure Maps Route v1.0] APIs to [Azure
3535
| Batch operations | Sync and async requests | Sync requests |
3636
| Coordinate format | Latitude/longitude | Longitude/latitude, as defined by [GeoJSON]. |
3737
| Electric consumption model | Supported | Not supported |
38-
| Localization | Use the "language" parameter to localize the language of the route instructions. | Use the Accept-Language request header to input a localization code to localize the language of the route instructions. |
38+
| Localization | Use the "language" parameter to localize the language of the route instructions. | Use the "Accept-Language" request header to input a localization code to localize the language of the route instructions. |
3939
| Request type | GET, POST | POST |
4040
| Response format | XML, JSON | GeoJSON |
4141
| Travel mode | Car, truck, pedestrian.<BR>Beta profiles: Bus, bicycle, motorcycle, taxi, van. | Car, truck, pedestrian. |
42-
| Waypoint Optimization | Supported | Currently only supported for truck routing. |
42+
| Waypoint Optimization | Supported | supported |
4343
| Waypoints | Supported | Supported. Also supports `viaWaypoints` for driving and walking modes. |
4444

4545
### Route Matrix notable differences

0 commit comments

Comments
 (0)