You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/durable/quickstart-js-vscode.md
+27-35Lines changed: 27 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ To complete this tutorial:
28
28
29
29
* Install [Visual Studio Code](https://code.visualstudio.com/download).
30
30
31
-
* Make sure you have the [latest Azure Functions tools](../functions-develop-vs.md#check-your-tools-version).
31
+
* Make sure you have the latest version of the [Azure Functions Core Tools](../functions-run-local.md).
32
32
33
33
* On a Windows computer, verify you have the [Azure Storage Emulator](../../storage/common/storage-use-emulator.md) installed and running. On a Mac or Linux computer, you must use an actual Azure storage account.
34
34
@@ -44,69 +44,61 @@ To complete this tutorial:
44
44
45
45
1. Install the `durable-functions` npm package by running `npm install durable-functions` in the root directory of the function app.
46
46
47
-
## Create a Starter Function
47
+
## Creating your functions
48
+
49
+
We'll now create the three functions you need to get started with Durable Functions: an HTTP starter, an orchestrator, and an activity function. The HTTP starter will initiate your entire solution, and the orchestrator will dispatch work to various activity functions.
50
+
51
+
### HTTP starter
48
52
49
53
First, create an HTTP triggered function that starts a durable function orchestration.
50
54
51
-
1. From **Azure: Functions**, choose the Create Function icon.
55
+
1. From *Azure: Functions*, choose the **Create Function** icon.
52
56
53
57

54
58
55
-
2. Select the folder with your function app project and select the **HTTP trigger** function template.
59
+
2. Select the folder with your function app project and select the **Durable Functions HTTP Starter** function template.
56
60
57
-

61
+

58
62
59
-
3.Type `HttpStart` for the function name and press Enter, then select **Anonymous** authentication.
63
+
3.Leave the default name as `DurableFunctionsHttpStart`and press ****Enter**, then select **Anonymous** authentication.
We've now created an entry-point into our Durable Function. Let's add an orchestrator.
74
68
75
-
## Create an Orchestrator Function
76
-
77
-
Next, you create another function to be the orchestrator. We use the HTTP trigger function template for convenience. The function code itself is replaced by the orchestrator code.
69
+
### Orchestrator
78
70
79
-
1. Repeat the steps from the previous section to create a second function using the HTTP trigger template. This time name the function `OrchestratorFunction`.
71
+
Now, we'll create an orchestrator to coordinate activity functions.
80
72
81
-
2. Open the index.js file for the new function and replace the contents with the following code:
73
+
1. From *Azure: Functions*, choose the **Create Function** icon.

84
76
85
-
3. Open the function.json file and replace it with the following JSON:
77
+
2. Select the folder with your function app project and select the **Durable Functions orchestrator** function template. Leave the name as the default "DurableFunctionsOrchestrator"

88
80
89
81
We've added an orchestrator to coordinate activity functions. Let's now add the referenced activity function.
90
82
91
-
##Create an Activity Function
83
+
### Activity
92
84
93
-
1. Repeat the steps from the previous sections to create a third function using the HTTP trigger template. But this time name the function `E1_SayHello`.
85
+
Now, we'll create an activity function to actually carry out the work of the solution.
94
86
95
-
2. Open the index.js file for the new function and replace the contents with the following code:
87
+
1. From *Azure: Functions*, choose the **Create Function** icon.

98
90
99
-
3. Replace function.json with the below JSON:
91
+
2. Select the folder with your function app project and select the **Durable Functions activity** function template. Leave the name as the default "Hello".

102
94
103
95
We've now added all components needed to start off an orchestration and chain together activity functions.
104
96
105
97
## Test the function locally
106
98
107
-
Azure Functions Core Tools lets you run an Azure Functions project on your local development computer. You're prompted to install these tools the first time you start a function from Visual Studio Code.
99
+
Azure Functions Core Tools lets you run an Azure Functions project on your local development computer. You're prompted to install these tools the first time you start a function from Visual Studio Code.
108
100
109
-
1. On a Windows computer, start the Azure Storage Emulator and make sure that the **AzureWebJobsStorage** property of local.settings.json is set to `UseDevelopmentStorage=true`.
101
+
1. On a Windows computer, start the Azure Storage Emulator and make sure that the **AzureWebJobsStorage** property of *local.settings.json* is set to `UseDevelopmentStorage=true`.
110
102
111
103
For Storage Emulator 5.8 make sure that the **AzureWebJobsSecretStorageType** property of local.settings.json is set to `files`. On a Mac or Linux computer, you must set the **AzureWebJobsStorage** property to the connection string of an existing Azure storage account. You create a storage account later in this article.
112
104
@@ -119,15 +111,15 @@ Azure Functions Core Tools lets you run an Azure Functions project on your local
119
111
120
112

121
113
122
-
4. Replace `{functionName}` with `OrchestratorFunction`.
114
+
4. Replace `{functionName}` with `DurableFunctionsOrchestrator`.
123
115
124
-
5. Using a tool like [Postman](https://www.getpostman.com/) or [cURL](https://curl.haxx.se/), send a HTTP POST request to the URL endpoint.
116
+
5. Using a tool like [Postman](https://www.getpostman.com/) or [cURL](https://curl.haxx.se/), send an HTTP POST request to the URL endpoint.
125
117
126
118
The response is the initial result from the HTTP function letting us know the durable orchestration has started successfully. It is not yet the end result of the orchestration. The response includes a few useful URLs. For now, let's query the status of the orchestration.
127
119
128
120
6. Copy the URL value for `statusQueryGetUri` and paste it in the browser's address bar and execute the request. Alternatively you can also continue to use Postman to issue the GET request.
129
121
130
-
The request will query the orchestration instance for the status. You should get an eventual response which shows us the instance has completed, and includes the outputs or results of the durable function. It looks like:
122
+
The request will query the orchestration instance for the status. You should get an eventual response, which shows us the instance has completed, and includes the outputs or results of the durable function. It looks like:
0 commit comments