Skip to content

Commit a71f5c3

Browse files
committed
edits
1 parent 09e492b commit a71f5c3

File tree

4 files changed

+36
-30
lines changed

4 files changed

+36
-30
lines changed

articles/azure-functions/durable/durable-functions-bindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Bindings for Durable Functions - Azure
33
description: How to use triggers and bindings for the Durable Functions extension for Azure Functions.
44
ms.topic: conceptual
5-
ms.date: 08/03/2021
5+
ms.date: 02/08/2022
66
ms.author: azfuncdf
77
---
88

articles/azure-functions/durable/durable-functions-sequence.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Function chaining in Durable Functions - Azure
33
description: Learn how to run a Durable Functions sample that executes a sequence of functions.
44
author: cgillum
55
ms.topic: conceptual
6-
ms.date: 11/29/2019
6+
ms.date: 02/08/2022
77
ms.author: azfuncdf
88
ms.devlang: csharp, javascript, python
99
---
@@ -22,7 +22,7 @@ This article explains the following functions in the sample app:
2222
* `E1_SayHello`: An [activity function](durable-functions-bindings.md#activity-trigger) that prepends a string with "Hello".
2323
* `HttpStart`: An HTTP triggered [durable client](durable-functions-bindings.md#orchestration-client) function that starts an instance of the orchestrator.
2424

25-
### E1_HelloSequence orchestrator function
25+
## E1_HelloSequence orchestrator function
2626

2727
# [C#](#tab/csharp)
2828

@@ -94,7 +94,7 @@ The `context` object lets you call other *activity* functions and pass input par
9494

9595
---
9696

97-
### E1_SayHello activity function
97+
## E1_SayHello activity function
9898

9999
# [C#](#tab/csharp)
100100

@@ -148,7 +148,7 @@ Unlike the orchestrator function, an activity function needs no special setup. T
148148

149149
---
150150

151-
### HttpStart client function
151+
## HttpStart client function
152152

153153
You can start an instance of orchestrator function using a client function. You will use the `HttpStart` HTTP triggered function to start instances of `E1_HelloSequence`.
154154

articles/azure-functions/functions-bindings-example.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: craigshoemaker
66
ms.topic: reference
77
ms.devlang: csharp, javascript
88
ms.custom: devx-track-csharp
9-
ms.date: 02/18/2019
9+
ms.date: 02/08/2022
1010
ms.author: cshoe
1111
---
1212

@@ -48,7 +48,7 @@ To view and edit the contents of *function.json* in the Azure portal, click the
4848
> [!NOTE]
4949
> The value of `connection` is the name of an app setting that contains the connection string, not the connection string itself. Bindings use connection strings stored in app settings to enforce the best practice that *function.json* does not contain service secrets.
5050
51-
## C# script example
51+
# [C# script](#tab/csharp)
5252

5353
Here's C# script code that works with this trigger and binding. Notice that the name of the parameter that provides the queue message content is `order`; this name is required because the `name` property value in *function.json* is `order`
5454

@@ -78,26 +78,7 @@ public class Person
7878
}
7979
```
8080

81-
## JavaScript example
82-
83-
The same *function.json* file can be used with a JavaScript function:
84-
85-
```javascript
86-
// From an incoming queue message that is a JSON object, add fields and write to Table Storage
87-
module.exports = async function (context, order) {
88-
order.PartitionKey = "Orders";
89-
order.RowKey = generateRandomId();
90-
91-
context.bindings.order = order;
92-
};
93-
94-
function generateRandomId() {
95-
return Math.random().toString(36).substring(2, 15) +
96-
Math.random().toString(36).substring(2, 15);
97-
}
98-
```
99-
100-
## Class library example
81+
# [C# class library](#tab/csharp-class-library)
10182

10283
In a class library, the same trigger and binding information — queue and table names, storage accounts, function parameters for input and output — is provided by attributes instead of a function.json file. Here's an example:
10384

@@ -127,6 +108,29 @@ public class Person
127108
}
128109
```
129110

111+
# [JavaScript](#tab/javascript)
112+
113+
114+
115+
The same *function.json* file can be used with a JavaScript function:
116+
117+
```javascript
118+
// From an incoming queue message that is a JSON object, add fields and write to Table Storage
119+
module.exports = async function (context, order) {
120+
order.PartitionKey = "Orders";
121+
order.RowKey = generateRandomId();
122+
123+
context.bindings.order = order;
124+
};
125+
126+
function generateRandomId() {
127+
return Math.random().toString(36).substring(2, 15) +
128+
Math.random().toString(36).substring(2, 15);
129+
}
130+
```
131+
132+
---
133+
130134
You now have a working function that is triggered by an Azure Queue and outputs data to Azure Table storage.
131135

132136
## Next steps

includes/functions-host-json-durabletask.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Configuration settings for [Durable Functions](../articles/azure-functions/durab
1414
> [!NOTE]
1515
> All major versions of Durable Functions are supported on all versions of the Azure Functions runtime. However, the schema of the host.json configuration is slightly different depending on the version of the Azure Functions runtime and the Durable Functions extension version you use. The following examples are for use with Azure Functions 2.0 and 3.0. In both examples, if you're using Azure Functions 1.0, the available settings are the same, but the "durableTask" section of the host.json should go in the root of the host.json configuration instead of as a field under "extensions".
1616
17-
### <a name="durable-functions-2-0-host-json"></a>Durable Functions 2.x
17+
# [Durable Functions 2.x](#tab/2x-durable-functions)
18+
19+
<a name="durable-functions-2-0-host-json"></a>
1820

1921
```json
2022
{
@@ -61,10 +63,9 @@ Configuration settings for [Durable Functions](../articles/azure-functions/durab
6163
}
6264
}
6365
}
64-
6566
```
6667

67-
### Durable Functions 1.x
68+
# [Durable Functions 1.x](#tab/1x-durable-functions)
6869

6970
```json
7071
{
@@ -92,6 +93,7 @@ Configuration settings for [Durable Functions](../articles/azure-functions/durab
9293
}
9394
}
9495
```
96+
---
9597

9698
Task hub names must start with a letter and consist of only letters and numbers. If not specified, the default task hub name for a function app is **DurableFunctionsHub**. For more information, see [Task hubs](../articles/azure-functions/durable/durable-functions-task-hubs.md).
9799

0 commit comments

Comments
 (0)