Skip to content

Commit 3c199b6

Browse files
Update functions-bindings-azure-sql-trigger.md
1 parent 3e81a90 commit 3c199b6

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

articles/azure-functions/functions-bindings-azure-sql-trigger.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.custom:
99
- devx-track-js
1010
- devx-track-python
1111
- ignite-2023
12-
ms.date: 11/27/2023
12+
ms.date: 6/20/2024
1313
ms.author: bspendolini
1414
ms.reviewer: glenga
1515
zone_pivot_groups: programming-languages-set-functions-lang-workers
@@ -437,6 +437,27 @@ The SQL trigger binds to a variable `todoChanges`, a list of objects each with t
437437

438438
The following example shows a Python function that is invoked when there are changes to the `ToDo` table.
439439

440+
# [v2](#tab/python-v2)
441+
442+
```python
443+
import json
444+
import logging
445+
import azure.functions as func
446+
from azure.functions.decorators.core import DataType
447+
448+
app = func.FunctionApp()
449+
450+
@app.function_name(name="ToDoTrigger")
451+
@app.sql_trigger(arg_name="todo",
452+
table_name="ToDo",
453+
connection_string_setting="SqlConnectionString")
454+
def todo_trigger(todo: str) -> None:
455+
logging.info("SQL Changes: %s", json.loads(todo))
456+
```
457+
458+
# [v1](#tab/python-v1)
459+
460+
440461
The following is binding data in the function.json file:
441462

442463
```json
@@ -462,6 +483,8 @@ def main(changes):
462483
logging.info("SQL Changes: %s", json.loads(changes))
463484
```
464485

486+
---
487+
465488
::: zone-end
466489

467490

0 commit comments

Comments
 (0)