Skip to content

Commit 330481e

Browse files
authored
[Durable Functions] Basic "Function Chaining" implementation (#358)
Basic "Function Chaining" implementation
1 parent 91cfab4 commit 330481e

40 files changed

+1006
-31
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,15 @@ StyleCop.Cache
6464

6565
examples/PSCoreApp/Modules
6666
src/Modules
67-
!src/Modules/Microsoft.AzureFunctions.PowerShellWorker
67+
!src/Modules/Microsoft.Azure.Functions.PowerShellWorker
6868

6969
# protobuf
7070
protobuf/*
7171
src/Messaging/protobuf
7272

7373
# pulled in for tests
7474
Azure.Functions.Cli
75+
76+
# Azure Functions artifacts
77+
appsettings.json
78+
local.settings.json
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git*
2+
.vscode
3+
local.settings.json
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"bindings": [
3+
{
4+
"authLevel": "function",
5+
"type": "httpTrigger",
6+
"direction": "in",
7+
"name": "Request",
8+
"methods": [
9+
"get",
10+
"post"
11+
]
12+
},
13+
{
14+
"type": "http",
15+
"direction": "out",
16+
"name": "Response"
17+
},
18+
{
19+
"name": "starter",
20+
"type": "orchestrationClient",
21+
"direction": "out"
22+
},
23+
{
24+
"name": "orchestrationClientIn",
25+
"type": "orchestrationClient",
26+
"direction": "in"
27+
}
28+
]
29+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using namespace System.Net
2+
3+
param($Request, $TriggerMetadata, $orchestrationClientIn)
4+
5+
Write-Host "HttpTrigger started"
6+
7+
$InstanceId = Start-NewOrchestration -FunctionName 'MyOrchestrator' -InputObject 'Hello'
8+
Write-Host "Started orchestration with ID = '$InstanceId'"
9+
10+
$Response = New-OrchestrationCheckStatusResponse `
11+
-Request $Request `
12+
-OrchestrationClientData $orchestrationClientIn `
13+
-InstanceId $InstanceId
14+
15+
Push-OutputBinding -Name Response -Value $Response
16+
17+
Write-Host "HttpTrigger completed"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bindings": [
3+
{
4+
"name": "Context",
5+
"type": "orchestrationTrigger",
6+
"direction": "in"
7+
}
8+
]
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using namespace System.Net
2+
3+
param($Context)
4+
5+
Write-Host "MyOrchestrator: started. Input: $($Context.Input)"
6+
7+
$output = @()
8+
9+
$output += Invoke-ActivityFunctionAsync -FunctionName "SayHello" -Input "Tokyo"
10+
$output += Invoke-ActivityFunctionAsync -FunctionName "SayHello" -Input "Seattle" -Verbose
11+
$output += Invoke-ActivityFunctionAsync -FunctionName "SayHello" -Input "London" -Verbose
12+
13+
Write-Host "MyOrchestrator: finished."
14+
15+
return $output
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bindings": [
3+
{
4+
"name": "name",
5+
"type": "activityTrigger",
6+
"direction": "in"
7+
}
8+
]
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
param($name)
2+
3+
Write-Host "SayHello($name) started"
4+
Start-Sleep -Seconds 5
5+
Write-Host "SayHello($name) finished"
6+
return "Hello $name"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
<WarningsAsErrors></WarningsAsErrors>
5+
<DefaultItemExcludes>**</DefaultItemExcludes>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="1.8.3" />
9+
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.0" />
10+
</ItemGroup>
11+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"version": "2.0"
3+
}

0 commit comments

Comments
 (0)