Skip to content

Commit 4acbc2f

Browse files
Merge pull request #2 from MaximRouiller/master
updating Functions to latest version. fixed breaking changes
2 parents 56037cc + 8ffea9b commit 4acbc2f

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

FanOutFanInCrawler.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27703.2026
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30128.36
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FanOutFanInCrawler", "FanOutFanInCrawler\FanOutFanInCrawler.csproj", "{F55A418F-AD22-4F55-92C1-5500C1D000DC}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FanOutFanInCrawler", "FanOutFanInCrawler\FanOutFanInCrawler.csproj", "{CDA8125A-295E-4918-9FA4-70D4BEE685AA}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{F55A418F-AD22-4F55-92C1-5500C1D000DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{F55A418F-AD22-4F55-92C1-5500C1D000DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{F55A418F-AD22-4F55-92C1-5500C1D000DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{F55A418F-AD22-4F55-92C1-5500C1D000DC}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{CDA8125A-295E-4918-9FA4-70D4BEE685AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{CDA8125A-295E-4918-9FA4-70D4BEE685AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{CDA8125A-295E-4918-9FA4-70D4BEE685AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{CDA8125A-295E-4918-9FA4-70D4BEE685AA}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE

FanOutFanInCrawler/FanOutFanInCrawler.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
<ProjectGuid>{CDA8125A-295E-4918-9FA4-70D4BEE685AA}</ProjectGuid>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="1.8.3" />
9-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" />
10-
<PackageReference Include="Octokit" Version="0.32.0" />
11-
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
8+
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
9+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.2.2" />
10+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.2" />
11+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.7" />
12+
<PackageReference Include="Octokit" Version="0.48.0" />
1213
</ItemGroup>
1314
<ItemGroup>
1415
<None Update="host.json">

FanOutFanInCrawler/Orchestrator.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Net.Http;
55
using System.Threading.Tasks;
66
using Microsoft.Azure.WebJobs;
7+
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
78
using Microsoft.Azure.WebJobs.Extensions.Http;
89
using Microsoft.Extensions.Logging;
910
using Microsoft.WindowsAzure.Storage;
@@ -32,21 +33,21 @@ public static class Orchestrator
3233
/// <returns></returns>
3334
[FunctionName("Orchestrator_HttpStart")]
3435
public static async Task<HttpResponseMessage> HttpStart(
35-
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")]HttpRequestMessage req,
36-
[OrchestrationClient]DurableOrchestrationClient starter,
36+
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestMessage req,
37+
[DurableClient] IDurableOrchestrationClient client,
3738
ILogger log)
3839
{
3940
// Function input comes from the request content.
40-
string instanceId = await starter.StartNewAsync("Orchestrator", "Nuget");
41+
string instanceId = await client.StartNewAsync("Orchestrator", null, "Nuget");
4142

4243
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
4344

44-
return starter.CreateCheckStatusResponse(req, instanceId);
45+
return client.CreateCheckStatusResponse(req, instanceId);
4546
}
4647

4748
[FunctionName("Orchestrator")]
4849
public static async Task<string> RunOrchestrator(
49-
[OrchestrationTrigger] DurableOrchestrationContext context)
50+
[OrchestrationTrigger] IDurableOrchestrationContext context)
5051
{
5152
// retrieves the organization name from the Orchestrator_HttpStart function
5253
var organizationName = context.GetInput<string>();
@@ -75,7 +76,7 @@ public static async Task<string> RunOrchestrator(
7576
}
7677

7778
[FunctionName("GetAllRepositoriesForOrganization")]
78-
public static async Task<List<(long id, string name)>> GetAllRepositoriesForOrganization([ActivityTrigger] DurableActivityContext context)
79+
public static async Task<List<(long id, string name)>> GetAllRepositoriesForOrganization([ActivityTrigger] IDurableActivityContext context)
7980
{
8081
// retrieves the organization name from the Orchestrator function
8182
var organizationName = context.GetInput<string>();
@@ -85,11 +86,11 @@ public static async Task<string> RunOrchestrator(
8586
}
8687

8788
[FunctionName("GetOpenedIssues")]
88-
public static async Task<(long id, int openedIssues, string name)> GetOpenedIssues([ActivityTrigger] DurableActivityContext context)
89+
public static async Task<(long id, int openedIssues, string name)> GetOpenedIssues([ActivityTrigger] IDurableActivityContext context)
8990
{
9091
// retrieve a tuple of repositoryId and repository name from the Orchestrator function
9192
var parameters = context.GetInput<(long id, string name)>();
92-
93+
9394
// retrieves a list of issues from a specific repository
9495
var issues = (await github.Issue.GetAllForRepository(parameters.id)).ToList();
9596

@@ -98,7 +99,7 @@ public static async Task<string> RunOrchestrator(
9899
}
99100

100101
[FunctionName("SaveRepositories")]
101-
public static async Task SaveRepositories([ActivityTrigger] DurableActivityContext context)
102+
public static async Task SaveRepositories([ActivityTrigger] IDurableActivityContext context)
102103
{
103104
// retrieves a tuple from the Orchestrator function
104105
var parameters = context.GetInput<List<(long id, int openedIssues, string name)>>();

0 commit comments

Comments
 (0)