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
# Quickstart: Create a C# durable function (isolated worker model)
13
+
# Quickstart: Create a C# Durable Functions app
14
14
15
15
Durable Functions is a feature of [Azure Functions](../functions-overview.md) that you can use to write stateful functions in a serverless environment. Durable Functions manages state, checkpoints, and restarts for you.
16
16
@@ -22,9 +22,9 @@ To learn more about the two processes, see [Differences between in-process and i
22
22
23
23
::: zone pivot="code-editor-vscode"
24
24
25
-
In this quickstart, you use Visual Studio Code to locally create and test a "hello world" durable function. This function orchestrates and chains together calls to other functions. Then, you publish the function code in Azure. The tools you use are available via the Visual Studio Code [Azure Functions extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions).
25
+
In this quickstart, you use Visual Studio Code to locally create and test a "hello world" Durable Functions app. The function app orchestrates and chains together calls to other functions. Then, you publish the function code in Azure. The tools you use are available via the Visual Studio Code [Azure Functions extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions).
26
26
27
-
:::image type="content" source="./media/durable-functions-create-first-csharp/functions-vscode-complete.png" alt-text="Screenshot of durable function code in Visual Studio Code.":::
27
+
:::image type="content" source="./media/durable-functions-create-first-csharp/functions-vscode-complete.png" alt-text="Screenshot of Durable Functions app code in Visual Studio Code.":::
28
28
29
29
## Prerequisites
30
30
@@ -76,7 +76,7 @@ Another file, *HelloOrchestration.cs*, contains the basic building blocks of a D
76
76
77
77
| Method | Description |
78
78
| ----- | ----------- |
79
-
|`HelloOrchestration`| Defines the durable function orchestration. In this case, the orchestration starts, creates a list, and then adds the result of three functions calls to the list. When the three function calls finish, it returns the list. |
79
+
|`HelloOrchestration`| Defines the Durable Functions app orchestration. In this case, the orchestration starts, creates a list, and then adds the result of three functions calls to the list. When the three function calls finish, it returns the list. |
80
80
|`SayHello`| A simple function app that returns *hello*. This function contains the business logic that is orchestrated. |
81
81
|`HelloOrchestration_HttpStart`| An [HTTP-triggered function](../functions-bindings-http-webhook.md) that starts an instance of the orchestration and returns a *check status* response. |
82
82
@@ -98,7 +98,7 @@ You can use [Azurite](../../storage/common/storage-use-azurite.md?tabs=visual-st
98
98
99
99
To install and start running the Azurite extension in Visual Studio Code, in the command palette, enter **Azurite: Start** and select Enter.
100
100
101
-
You can use other storage options for your durable function app. For more information about storage options and benefits, see [Durable Functions storage providers](durable-functions-storage-providers.md).
101
+
You can use other storage options for your Durable Functions app. For more information about storage options and benefits, see [Durable Functions storage providers](durable-functions-storage-providers.md).
102
102
103
103
## Test the function locally
104
104
@@ -117,13 +117,13 @@ Azure Functions Core Tools gives you the capability to run an Azure Functions pr
117
117
118
118
1. Use a tool like [Postman](https://www.getpostman.com/) or [cURL](https://curl.haxx.se/) to send an HTTP POST request to the URL endpoint.
119
119
120
-
The response is the HTTP function's initial result. It lets you know that the durable function orchestration started successfully. It doesn't yet display the end result of the orchestration. The response includes a few useful URLs.
120
+
The response is the HTTP function's initial result. It lets you know that the Durable Functions app orchestration started successfully. It doesn't yet display the end result of the orchestration. The response includes a few useful URLs.
121
121
122
122
At this point, your breakpoint in the activity function should be hit because the orchestration has started. Step through it to get a response for the status of the orchestration.
123
123
124
124
1. Copy the URL value for `statusQueryGetUri`, paste it in your browser's address bar, and execute the request. Alternatively, you can also continue to use Postman to issue the GET request.
125
125
126
-
The request queries the orchestration instance for the status. You should see that the instance finished and that it includes the outputs or results of the durable function like in this example:
126
+
The request queries the orchestration instance for the status. You should see that the instance finished and that it includes the outputs or results of the Durable Functions app like in this example:
127
127
128
128
```json
129
129
{
@@ -139,7 +139,7 @@ Azure Functions Core Tools gives you the capability to run an Azure Functions pr
139
139
```
140
140
141
141
> [!TIP]
142
-
> Learn how you can observe the [replay behavior](./durable-functions-orchestrations.md#reliability) of a durable function through breakpoints.
142
+
> Learn how you can observe the [replay behavior](./durable-functions-orchestrations.md#reliability) of a Durable Functions app through breakpoints.
143
143
144
144
1. To stop debugging, in Visual Studio Code, select Shift+F5.
145
145
@@ -157,23 +157,23 @@ After you verify that the function runs correctly on your local computer, it's t
157
157
158
158
1. Paste the new URL for the HTTP request in your browser's address bar. You must get the same status response that you got when you tested locally when you use the published app.
159
159
160
-
The C# durable function app that you created and published by using Visual Studio Code is ready to use.
160
+
The C# Durable Functions app that you created and published by using Visual Studio Code is ready to use.
161
161
162
162
## Clean up resources
163
163
164
164
If you no longer need the resources that you created to complete the quickstart, to avoid related costs in your Azure subscription, [delete the resource group](/azure/azure-resource-manager/management/delete-resource-group?tabs=azure-portal#delete-resource-group) and all related resources.
165
165
166
166
## Related content
167
167
168
-
* Learn about [common durable function patterns](durable-functions-overview.md#application-patterns).
168
+
* Learn about [common Durable Functions app patterns](durable-functions-overview.md#application-patterns).
169
169
170
170
::: zone-end
171
171
172
172
::: zone pivot="code-editor-visualstudio"
173
173
174
-
In this quickstart, you use Visual Studio 2022 to locally create and test a "hello world" durable function that runs in the isolated worker process. The function orchestrates and chains together calls to other functions. Then, you publish the function code in Azure. The tools you use are available via the *Azure development workload* in Visual Studio 2022.
174
+
In this quickstart, you use Visual Studio 2022 to locally create and test a "hello world" Durable Functions app that runs in the isolated worker process. The function orchestrates and chains together calls to other functions. Then, you publish the function code in Azure. The tools you use are available via the *Azure development workload* in Visual Studio 2022.
175
175
176
-
:::image type="content" source="./media/durable-functions-create-first-csharp/functions-vs-complete.png" alt-text="Screenshot of durable function code in Visual Studio 2019.":::
176
+
:::image type="content" source="./media/durable-functions-create-first-csharp/functions-vs-complete.png" alt-text="Screenshot of Durable Functions app code in Visual Studio 2019.":::
177
177
178
178
## Prerequisites
179
179
@@ -216,11 +216,11 @@ The Azure Functions template creates a project that you can publish to a functio
216
216
> [!NOTE]
217
217
> You can choose other storage options for your Durable Functions app. For more information, see [Durable Functions storage providers](durable-functions-storage-providers.md).
218
218
219
-
In your app folder, a file named *Function1.cs* contains three functions. The three functions are the basic building blocks of a durable function:
219
+
In your app folder, a file named *Function1.cs* contains three functions. The three functions are the basic building blocks of a Durable Functions app:
220
220
221
221
| Method | Description |
222
222
| ----- | ----------- |
223
-
| `RunOrchestrator` | Defines the durable function orchestration. In this case, the orchestration starts, creates a list, and then adds the result of three functions calls to the list. When the three function calls finish, it returns the list. |
223
+
| `RunOrchestrator` | Defines the Durable Functions app orchestration. In this case, the orchestration starts, creates a list, and then adds the result of three functions calls to the list. When the three function calls finish, it returns the list. |
224
224
| `SayHello` | A simple function app that returns *hello*. This function contains the business logic that is orchestrated. |
225
225
| `HttpStart` | An [HTTP-triggered function](../functions-bindings-http-webhook.md) that starts an instance of the orchestration and returns a *check status* response. |
226
226
@@ -249,7 +249,7 @@ Azure Functions Core Tools gives you the capability to run an Azure Functions pr
249
249
250
250
1. Copy the URL value for `statusQueryGetUri`, paste it in your browser's address bar, and execute the request.
251
251
252
-
The request queries the orchestration instance for the status. You should see that the instance finished and that it includes the outputs or results of the durable function like in this example:
252
+
The request queries the orchestration instance for the status. You should see that the instance finished and that it includes the outputs or results of the durable function, like in this example:
253
253
254
254
```json
255
255
{
@@ -265,7 +265,7 @@ Azure Functions Core Tools gives you the capability to run an Azure Functions pr
265
265
```
266
266
267
267
> [!TIP]
268
-
> Learn how you can observe the [replay behavior](./durable-functions-orchestrations.md#reliability) of a durable function through breakpoints.
268
+
> Learn how you can observe the [replay behavior](./durable-functions-orchestrations.md#reliability) of a Durable Functions app through breakpoints.
269
269
270
270
1. To stop debugging, select Shift+F5.
271
271
@@ -287,14 +287,14 @@ You must have a function app in your Azure subscription before you publish your
287
287
288
288
1. Paste the new URL for the HTTP request in your browser's address bar. When you test the published app, you must get the same status response that you got when you tested locally.
289
289
290
-
The C# durable function app that you created and published by using Visual Studio is ready to use.
290
+
The C# Durable Functions app that you created and published by using Visual Studio is ready to use.
291
291
292
292
## Clean up resources
293
293
294
294
If you no longer need the resources that you created to complete the quickstart, to avoid related costs in your Azure subscription, [delete the resource group](/azure/azure-resource-manager/management/delete-resource-group?tabs=azure-portal#delete-resource-group) and all related resources.
295
295
296
296
## Related content
297
297
298
-
* Learn about [common durable function patterns](durable-functions-overview.md#application-patterns).
298
+
* Learn about [common Durable Functions app patterns](durable-functions-overview.md#application-patterns).
Durable Functions is a feature of [Azure Functions](../functions-overview.md) that you can use to write stateful functions in a serverless environment. Durable Functions manages state, checkpoints, and restarts for you.
16
16
17
-
In this quickstart, you create and test a "hello world" durable function app in Java.
17
+
In this quickstart, you create and test a "hello world" Durable Functions app in Java.
18
18
19
-
The most basic durable function app has three functions:
19
+
The most basic Durable Functions app has three functions:
20
20
21
21
***Orchestrator function**: A workflow that orchestrates other functions.
22
22
***Activity function**: A function that is called by the orchestrator function, performs work, and optionally returns a value.
@@ -216,7 +216,7 @@ public class DurableFunctionsSample {
216
216
217
217
## Create a local project by using the Maven command
218
218
219
-
Run the following command to generate a project that contains the basic functions of a durable function app:
219
+
Run the following command to generate a project that contains the basic functions of a Durable Functions app:
220
220
221
221
# [Bash](#tab/bash)
222
222
@@ -248,7 +248,7 @@ At the prompts, provide the following information:
248
248
|**package**| Enter **com.function**. |
249
249
|**Y**| Enter **Y** and select Enter to confirm. |
250
250
251
-
Now you have a local project that has the three functions that are in a basic durable function app.
251
+
Now you have a local project that has the three functions that are in a basic Durable Functions app.
252
252
253
253
Check to ensure that `com.microsoft:durabletask-azure-functions` is set as a dependency in your _pom.xml_ file.
254
254
@@ -292,7 +292,7 @@ Durable Functions needs a storage provider to store runtime state. You can set A
292
292
|**Select the build tool for Java project**| Select **Maven**. |
293
293
|**Select how you would like to open your project**| Select **Open in new window**. |
294
294
295
-
You now have a project that has an example HTTP function. You can remove this function if you'd like to, because you add the basic functions of a durable function app in the next step.
295
+
You now have a project that has an example HTTP function. You can remove this function if you'd like to, because you add the basic functions of a Durable Functions app in the next step.
296
296
297
297
## Add functions to the project
298
298
@@ -310,7 +310,7 @@ You now have a project that has an example HTTP function. You can remove this fu
310
310
311
311
1. In the dialog, choose **Select storage account** to set up a storage account, and then follow the prompts.
312
312
313
-
You should now have the three basic functions generated for a durable function app.
313
+
You should now have the three basic functions generated for a Durable Functions app.
314
314
315
315
## Configure pom.xml and host.json
316
316
@@ -371,7 +371,7 @@ Azure Functions Core Tools gives you the capability to run an Azure Functions pr
371
371
372
372
1. Copy the URL value for `statusQueryGetUri`, paste it in your browser's address bar, and execute the request. Alternatively, you can continue to use Postman to issue the GET request.
373
373
374
-
The request queries the orchestration instance for the status. You should see that the instance finished and that it includes the outputs or results of the durable function like in this example:
374
+
The request queries the orchestration instance for the status. You should see that the instance finished and that it includes the outputs or results of the durable function, like in this example:
0 commit comments