azure-functions-dotnet-worker/samples/Net7Worker
Glenn Gailey c12ea97800
[Docs] Adding code snippet tags (#1132)
* Adding code snippet tags
2022-10-19 15:02:23 -07:00
..
.vscode Add .NET 7 project (#1069) 2022-09-30 15:40:24 -07:00
Properties Add .NET 7 project (#1069) 2022-09-30 15:40:24 -07:00
EventHubCancellationToken.cs [Docs] Adding code snippet tags (#1132) 2022-10-19 15:02:23 -07:00
HttpFunction.cs Update cancellation sample to show valid use case (#1115) 2022-10-17 13:02:43 -07:00
Net7Worker.csproj Update cancellation sample to show valid use case (#1115) 2022-10-17 13:02:43 -07:00
Program.cs Add .NET 7 project (#1069) 2022-09-30 15:40:24 -07:00
README.md Update cancellation sample to show valid use case (#1115) 2022-10-17 13:02:43 -07:00
host.json Add .NET 7 project (#1069) 2022-09-30 15:40:24 -07:00
local.settings.json Update cancellation sample to show valid use case (#1115) 2022-10-17 13:02:43 -07:00

README.md

.NET Framework Worker

This sample demonstrates how to create a .NET 7 project using the Isolated model.

Function Samples

HTTPFunction.cs

Demonstrates basic HTTP trigger function.

EventHubCancellationToken.cs

Demonstrates how to use the Cancellation Token parameter binding in the context of an EventHub trigger sample where we are processing multiple messages.

  • ThrowOnCancellation
    • shows how to throw when a cancellation token is received
    • the status of the function will be "Cancelled"
  • HandleCancellationCleanup
    • shows how to take precautionary/clean up actions if a cancellation token is received
    • the status of the function will be "Successful"

Cancellation tokens are signalled by the platform, the use cases supported today are:

  1. Sudden host shutdown or host restart
  2. Function timeout (where function execution has exceeded the timeout limit)
    1. You can try this out by setting function timeout to 5 seconds in the host.json file: "functionTimeout": "00:00:05"