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
@@ -413,7 +413,7 @@ The following example shows a SQL input binding that is [triggered by an HTTP](.
413
413
414
414
# [Model v3](#tab/nodejs-v3)
415
415
416
-
TypeScript samples are not documented for model v3.
416
+
TypeScript samples aren't documented for model v3.
417
417
418
418
---
419
419
@@ -488,7 +488,7 @@ The following example shows a SQL input binding that is [triggered by an HTTP](.
488
488
489
489
# [Model v3](#tab/nodejs-v3)
490
490
491
-
TypeScript samples are not documented for model v3.
491
+
TypeScript samples aren't documented for model v3.
492
492
493
493
---
494
494
@@ -568,7 +568,7 @@ The stored procedure `dbo.DeleteToDo` must be created on the database. In this
568
568
569
569
# [Model v3](#tab/nodejs-v3)
570
570
571
-
TypeScript samples are not documented for model v3.
571
+
TypeScript samples aren't documented for model v3.
572
572
573
573
---
574
574
@@ -816,6 +816,34 @@ The examples refer to a database table:
816
816
817
817
The following example shows a SQL input binding in a function.json file and a Python function that is [triggered by an HTTP](./functions-bindings-http-webhook-trigger.md) request and reads from a query and returns the results in the HTTP response.
818
818
819
+
# [v2](#tab/python-v2)
820
+
821
+
```python
822
+
import json
823
+
import logging
824
+
import azure.functions as func
825
+
from azure.functions.decorators.core import DataType
826
+
827
+
app = func.FunctionApp()
828
+
829
+
@app.function_name(name="GetToDo")
830
+
@app.route(route="gettodo")
831
+
@app.sql_input(arg_name="todo",
832
+
command_text="select [Id], [order], [title], [url], [completed] from dbo.ToDo",
The following example shows a SQL input binding in a Python function that is [triggered by an HTTP](./functions-bindings-http-webhook-trigger.md) request and reads from a query filtered by a parameter from the query string and returns the row in the HTTP response.
869
899
900
+
# [v2](#tab/python-v2)
901
+
902
+
```python
903
+
import json
904
+
import logging
905
+
import azure.functions as func
906
+
from azure.functions.decorators.core import DataType
907
+
908
+
app = func.FunctionApp()
909
+
910
+
@app.function_name(name="GetToDo")
911
+
@app.route(route="gettodo/{id}")
912
+
@app.sql_input(arg_name="todo",
913
+
command_text="select [Id], [order], [title], [url], [completed] from dbo.ToDo where Id = @Id",
@@ -1058,7 +1148,7 @@ The attribute's constructor takes the SQL command text, the command type, parame
1058
1148
1059
1149
Queries executed by the input binding are [parameterized](/dotnet/api/microsoft.data.sqlclient.sqlparameter) in Microsoft.Data.SqlClient to reduce the risk of [SQL injection](/sql/relational-databases/security/sql-injection) from the parameter values passed into the binding.
1060
1150
1061
-
If an exception occurs when a SQL input binding is executed then the function code will not execute. This may result in an error code being returned, such as an HTTP trigger returning a 500 error code.
1151
+
If an exception occurs when a SQL input binding is executed then the function code won't execute. This may result in an error code being returned, such as an HTTP trigger returning a 500 error code.
To return [multiple output bindings](./dotnet-isolated-process-guide.md#multiple-output-bindings) in our samples, we will create a custom return type:
47
+
To return [multiple output bindings](./dotnet-isolated-process-guide.md#multiple-output-bindings) in our samples, we'll create a custom return type:
48
48
49
49
```cs
50
50
publicstaticclassOutputType
@@ -539,7 +539,7 @@ The following example shows a SQL output binding that adds records to a table, u
539
539
540
540
# [Model v3](#tab/nodejs-v3)
541
541
542
-
TypeScript samples are not documented for model v3.
542
+
TypeScript samples aren't documented for model v3.
543
543
544
544
---
545
545
@@ -621,7 +621,7 @@ CREATE TABLE dbo.RequestLog (
621
621
622
622
# [Model v3](#tab/nodejs-v3)
623
623
624
-
TypeScript samples are not documented for model v3.
624
+
TypeScript samples aren't documented for model v3.
625
625
626
626
---
627
627
@@ -860,6 +860,35 @@ The examples refer to a database table:
860
860
861
861
The following example shows a SQL output binding in a function.json file and a Python function that adds records to a table, using data provided in an HTTP POST request as a JSON body.
862
862
863
+
# [v2](#tab/python-v2)
864
+
865
+
```python
866
+
import json
867
+
import logging
868
+
import azure.functions as func
869
+
from azure.functions.decorators.core import DataType
0 commit comments