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-mysql-output.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ CREATE TABLE Products (
69
69
70
70
### HTTP trigger, write one record
71
71
72
-
The following example shows a [C# function](functions-dotnet-class-library.md) that adds a recordto a database, by using data provided in an HTTP `POST` request as a JSON body:
72
+
The following example shows a [C# function](functions-dotnet-class-library.md) that adds a recordto a database, by using data provided in an HTTP `POST` request as a JSON body.
The following example shows a MySQL output binding in a function.json file and a PowerShell function that adds records to a table, by using data provided in an HTTP `POST` request as a JSON body:
450
+
The following example shows a MySQL output binding in a function.json file and a PowerShell function that adds records to a table, by using data provided in an HTTP `POST` request as a JSON body.
451
+
452
+
The following example is binding data in the function.json file:
451
453
452
454
```json
453
455
{
@@ -641,7 +643,7 @@ The [C# library](functions-dotnet-class-library.md) uses the `MySqlAttribute` at
641
643
| Attribute property |Description|
642
644
|---------|---------|
643
645
|`CommandText`| Required. The name of the table that the binding writes to. |
644
-
|`ConnectionStringSetting`| Required. The name of an app setting that contains the connection string for the database to which data is being written. This value isn't the actual connection string and must instead resolve to an environment variable. |
646
+
|`ConnectionStringSetting`| Required. The name of an app setting that contains the connection string for the database to which data is written. This value isn't the actual connection string and must instead resolve to an environment variable. |
645
647
646
648
::: zone-end
647
649
@@ -654,7 +656,7 @@ In the [Java functions runtime library](/java/api/overview/azure/functions/runti
654
656
| Element |Description|
655
657
|---------|---------|
656
658
|`commandText`| Required. The name of the table that the binding writes to. |
657
-
|`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.|
659
+
|`connectionStringSetting`| Required. The name of an app setting that contains the connection string for the database to which data is written. This isn't the actual connection string and must instead resolve to an environment variable.|
658
660
|`name`| Required. The unique name of the function binding. |
659
661
660
662
::: zone-end
@@ -670,7 +672,7 @@ The following table explains the properties that you can set on the `options` ob
670
672
| Property | Description |
671
673
|---------|----------------------|
672
674
|`commandText`| Required. The name of the table that the binding writes to. |
673
-
|`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. |
675
+
|`connectionStringSetting`| Required. The name of an app setting that contains the connection string for the database to which data is written. This isn't the actual connection string and must instead resolve to an environment variable. |
674
676
675
677
# [Model v3](#tab/nodejs-v3)
676
678
@@ -682,7 +684,7 @@ The following table explains the binding configuration properties that you set i
682
684
|`direction`| Required. Must be set to `out`. |
683
685
|`name`| Required. The name of the variable that represents the entity in function code. |
684
686
|`commandText`| Required. The name of the table that the binding writes to. |
685
-
|`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. |
687
+
|`connectionStringSetting`| Required. The name of an app setting that contains the connection string for the database to which data is written. This isn't the actual connection string and must instead resolve to an environment variable. |
686
688
687
689
---
688
690
@@ -700,7 +702,7 @@ The following table explains the binding configuration properties that you set i
700
702
|`direction`| Required. Must be set to `out`. |
701
703
|`name`| Required. The name of the variable that represents the entity in function code. |
702
704
|`commandText`| Required. The name of the table that the binding writes to. |
703
-
|`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. |
705
+
|`connectionStringSetting`| Required. The name of an app setting that contains the connection string for the database to which data is written. This isn't the actual connection string and must instead resolve to an environment variable. |
704
706
705
707
::: zone-end
706
708
@@ -709,13 +711,13 @@ The following table explains the binding configuration properties that you set i
709
711
> [!NOTE]
710
712
> The output binding supports all special characters, including dollar sign ($), backtick (`), hyphen (-), and underscore (_) . For more information, see the [MySQL community documentation](https://dev.mysql.com/doc/refman/8.0/en/identifiers.html).
711
713
>
712
-
> A programming language might define member attributes that contain special characters that it supports. For example, C# has few limitations for defining [variables](/dotnet/csharp/fundamentals/coding-style/identifier-names).
714
+
> A programming language might define member attributes that contain special characters that it supports. For example, C# has a few limitations for defining [variables](/dotnet/csharp/fundamentals/coding-style/identifier-names).
713
715
>
714
716
> Otherwise, you can use `JObject` for the output binding that covers all special characters. You can follow a [detailed example on GitHub](https://github.com/Azure/azure-functions-mysql-extension/blob/main/samples/samples-csharp/OutputBindingSamples/AddProductJObject.cs).
715
717
716
718
## Usage
717
719
718
-
The `CommandText` property is the name of the table where the data will be stored. The name of the connection string setting corresponds to the application setting that contains the connection string to Azure Database for MySQL.
720
+
The `CommandText` property is the name of the table where the data is stored. The name of the connection string setting corresponds to the application setting that contains the connection string to Azure Database for MySQL.
719
721
720
722
If an exception occurs when a MySQL input binding is executed, the function code won't run. The result might be an error code, such as an HTTP trigger that returns a 500 error code.
0 commit comments