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/functions-bindings-azure-sql-input.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ namespace AzureSQLSamples
121
121
122
122
The following example shows a [C# function](functions-dotnet-class-library.md) that executes a stored procedure with input from the HTTP request query parameter.
123
123
124
-
The stored procedure `dbo.DeleteToDo` must be created on the SQL database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
124
+
The stored procedure `dbo.DeleteToDo` must be created on the SQL database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
The following example shows a [C# function](functions-dotnet-class-library.md) that executes a stored procedure with input from the HTTP request query parameter.
239
239
240
-
The stored procedure `dbo.DeleteToDo` must be created on the SQL database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
240
+
The stored procedure `dbo.DeleteToDo` must be created on the SQL database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
The following example shows a SQL input binding in a Java function that is [triggered by an HTTP](./functions-bindings-http-webhook-trigger.md) request and executes a stored procedure with input from the HTTP request query parameter.
358
358
359
-
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
359
+
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
The following example shows a SQL input binding that is [triggered by an HTTP](./functions-bindings-http-webhook-trigger.md) request and executes a stored procedure with input from the HTTP request query parameter.
557
557
558
-
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
558
+
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
@@ -746,7 +746,7 @@ Push-OutputBinding -Name res -Value ([HttpResponseContext]@{
746
746
747
747
The following example shows a SQL input binding in a function.json file and a PowerShell function that is [triggered by an HTTP](./functions-bindings-http-webhook-trigger.md) request and executes a stored procedure with input from the HTTP request query parameter.
748
748
749
-
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
749
+
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
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 executes a stored procedure with input from the HTTP request query parameter.
985
985
986
-
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
986
+
The stored procedure `dbo.DeleteToDo` must be created on the database. In this example, the stored procedure deletes a single record or all records depending on the value of the parameter.
@@ -1107,7 +1107,7 @@ The following table explains the properties that you can set on the `options` ob
1107
1107
| Property | Description |
1108
1108
|---------|----------------------|
1109
1109
|**commandText**| Required. The Transact-SQL query command or name of the stored procedure executed by the binding. |
1110
-
|**connectionStringSetting**| Required. The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed. This value isn't the actual connection string and must instead resolve to an environment variable name. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](./functions-bindings-azure-sql.md#sql-connection-string). |
1110
+
|**connectionStringSetting**| Required. The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed. This value isn't the actual connection string and must instead resolve to an environment variable name. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](./functions-bindings-azure-sql.md#sql-connection-string). |
1111
1111
|**commandType**| Required. A [CommandType](/dotnet/api/system.data.commandtype) value, which is [Text](/dotnet/api/system.data.commandtype#fields) for a query and [StoredProcedure](/dotnet/api/system.data.commandtype#fields) for a stored procedure. |
1112
1112
|**parameters**| Optional. Zero or more parameter values passed to the command during execution as a single string. Must follow the format `@param1=param1,@param2=param2`. Neither the parameter name nor the parameter value can contain a comma (`,`) or an equals sign (`=`). |
1113
1113
@@ -1121,7 +1121,7 @@ The following table explains the binding configuration properties that you set i
1121
1121
|**direction**| Required. Must be set to `in`. |
1122
1122
|**name**| Required. The name of the variable that represents the query results in function code. |
1123
1123
|**commandText**| Required. The Transact-SQL query command or name of the stored procedure executed by the binding. |
1124
-
|**connectionStringSetting**| Required. The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed. This value isn't the actual connection string and must instead resolve to an environment variable name. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](./functions-bindings-azure-sql.md#sql-connection-string). |
1124
+
|**connectionStringSetting**| Required. The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed. This value isn't the actual connection string and must instead resolve to an environment variable name. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](./functions-bindings-azure-sql.md#sql-connection-string). |
1125
1125
|**commandType**| Required. A [CommandType](/dotnet/api/system.data.commandtype) value, which is [Text](/dotnet/api/system.data.commandtype#fields) for a query and [StoredProcedure](/dotnet/api/system.data.commandtype#fields) for a stored procedure. |
1126
1126
|**parameters**| Optional. Zero or more parameter values passed to the command during execution as a single string. Must follow the format `@param1=param1,@param2=param2`. Neither the parameter name nor the parameter value can contain a comma (`,`) or an equals sign (`=`). |
1127
1127
@@ -1139,7 +1139,7 @@ The following table explains the binding configuration properties that you set i
1139
1139
|**direction**| Required. Must be set to `in`. |
1140
1140
|**name**| Required. The name of the variable that represents the query results in function code. |
1141
1141
|**commandText**| Required. The Transact-SQL query command or name of the stored procedure executed by the binding. |
1142
-
|**connectionStringSetting**| Required. The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed. This value isn't the actual connection string and must instead resolve to an environment variable name. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](./functions-bindings-azure-sql.md#sql-connection-string). |
1142
+
|**connectionStringSetting**| Required. The name of an app setting that contains the connection string for the database against which the query or stored procedure is being executed. This value isn't the actual connection string and must instead resolve to an environment variable name. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](./functions-bindings-azure-sql.md#sql-connection-string). |
1143
1143
|**commandType**| Required. A [CommandType](/dotnet/api/system.data.commandtype) value, which is [Text](/dotnet/api/system.data.commandtype#fields) for a query and [StoredProcedure](/dotnet/api/system.data.commandtype#fields) for a stored procedure. |
1144
1144
|**parameters**| Optional. Zero or more parameter values passed to the command during execution as a single string. Must follow the format `@param1=param1,@param2=param2`. Neither the parameter name nor the parameter value can contain a comma (`,`) or an equals sign (`=`). |
1145
1145
::: zone-end
@@ -1155,11 +1155,11 @@ The binding definition includes the SQL command text, the command type, paramete
1155
1155
1156
1156
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.
1157
1157
1158
-
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.
1158
+
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.
1159
1159
1160
1160
## Next steps
1161
1161
1162
1162
-[Save data to a database (Output binding)](./functions-bindings-azure-sql-output.md)
1163
1163
-[Run a function when data is changed in a SQL table (Trigger)](./functions-bindings-azure-sql-trigger.md)
1164
-
-[Run a function from a HTTP request (trigger)](./functions-bindings-http-webhook-trigger.md)
1164
+
-[Run a function from an HTTP request (trigger)](./functions-bindings-http-webhook-trigger.md)
1165
1165
-[Review ToDo API sample with Azure SQL bindings](/samples/azure-samples/azure-sql-binding-func-dotnet-todo/todo-backend-dotnet-azure-sql-bindings-azure-functions/)
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-azure-sql-output.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ public static class OutputType
59
59
60
60
### HTTP trigger, write one record
61
61
62
-
The following example shows a [C# function](functions-dotnet-class-library.md) that adds a record to a database, using data provided in an HTTP POST request as a JSON body. The return object is the `OutputType` class we created to handle both an HTTP response and the SQL output binding.
62
+
The following example shows a [C# function](functions-dotnet-class-library.md) that adds a record to a database, using data provided in an HTTP POST request as a JSON body. The return object is the `OutputType` class we created to handle both an HTTP response and the SQL output binding.
The following example shows a SQL output binding in a Java function that adds a record to a table, using data provided in an HTTP POST request as a JSON body. The function takes an additional dependency on the [com.google.code.gson](https://github.com/google/gson) library to parse the JSON body.
381
+
The following example shows a SQL output binding in a Java function that adds a record to a table, using data provided in an HTTP POST request as a JSON body. The function takes an additional dependency on the [com.google.code.gson](https://github.com/google/gson) library to parse the JSON body.
382
382
383
383
```xml
384
384
<dependency>
@@ -423,7 +423,7 @@ public class PostToDo {
423
423
<aid="http-trigger-write-to-two-tables-java"></a>
424
424
### HTTP trigger, write to two tables
425
425
426
-
The following example shows a SQL output binding in a JavaS function that adds records to a database in two different tables (`dbo.ToDo` and `dbo.RequestLog`), using data provided in an HTTP POST request as a JSON body and multiple output bindings. The function takes an additional dependency on the [com.google.code.gson](https://github.com/google/gson) library to parse the JSON body.
426
+
The following example shows a SQL output binding in a JavaS function that adds records to a database in two different tables (`dbo.ToDo` and `dbo.RequestLog`), using data provided in an HTTP POST request as a JSON body and multiple output bindings. The function takes an additional dependency on the [com.google.code.gson](https://github.com/google/gson) library to parse the JSON body.
427
427
428
428
```xml
429
429
<dependency>
@@ -1110,7 +1110,7 @@ In the [Java functions runtime library](/java/api/overview/azure/functions/runti
1110
1110
1111
1111
| Element |Description|
1112
1112
|---------|---------|
1113
-
|**commandText**| Required. The name of the table being written to by the binding. |
1113
+
|**commandText**| Required. The name of the table being written to by the binding. |
1114
1114
|**connectionStringSetting**| Required. The name of an app setting that contains the connection string for the database to which data is being written. This isn't the actual connection string and must instead resolve to an environment variable.|
1115
1115
|**name**| Required. The unique name of the function binding. |
1116
1116
@@ -1168,7 +1168,7 @@ The `CommandText` property is the name of the table where the data is to be stor
1168
1168
1169
1169
The output bindings use the T-SQL [MERGE](/sql/t-sql/statements/merge-transact-sql) statement which requires [SELECT](/sql/t-sql/statements/merge-transact-sql#permissions) permissions on the target database.
1170
1170
1171
-
If an exception occurs when a SQL output binding is executed then the function code stop executing. This may result in an error code being returned, such as an HTTP trigger returning a 500 error code. If the `IAsyncCollector` is used in a .NET function then the function code can handle exceptions throw by the call to `FlushAsync()`.
1171
+
If an exception occurs when a SQL output binding is executed then the function code stop executing. This may result in an error code being returned, such as an HTTP trigger returning a 500 error code. If the `IAsyncCollector` is used in a .NET function then the function code can handle exceptions throw by the call to `FlushAsync()`.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-run-local.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -347,6 +347,12 @@ The following considerations apply when using the administrator endpoint for loc
347
347
348
348
+ Calling an administrator endpoint and passing test data is similar to using the **Test** tab in the Azure portal.
349
349
350
+
> [!Note]
351
+
> When supplying complex JSON objects, the following considerations should be taken into account:
352
+
> + JSON data must be escaped properly.
353
+
> + The escaped JSON string must include `"SystemProperties":{}`
354
+
> For example, `'{"input": "{\"SystemProperties\":{},\"testData\":{\"testid\":\"123\"}"}'`
355
+
350
356
### [Event Grid trigger](#tab/event-grid-trigger)
351
357
352
358
Event Grid triggers have specific requirements to enable local testing. For more information, see [Local testing with viewer web app](event-grid-how-tos.md#local-testing-with-viewer-web-app).
0 commit comments