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
Now you will need a a Function App to add the binding to. If you have one created already you can skip this step.
97
+
Now you will need a Function App to add the binding to. If you have one created already you can skip this step.
98
98
99
99
These steps can be done in the Terminal/CLI or with PowerShell.
100
100
@@ -132,7 +132,6 @@ These steps can be done in the Terminal/CLI or with PowerShell.
132
132
func init --worker-runtime python
133
133
```
134
134
135
-
136
135
3. Enable SQL bindings on the functionapp. More information can be found [in Microsoft Docs](https://docs.microsoft.com/azure/azure-functions/functions-bindings-azure-sql).
137
136
138
137
**.NET:** Install the extension.
@@ -149,7 +148,7 @@ These steps can be done in the Terminal/CLI or with PowerShell.
149
148
```
150
149
151
150
**Python:**
152
-
151
+
153
152
Update the `host.json` file to the preview extension bundle.
154
153
```json
155
154
"extensionBundle": {
@@ -229,7 +228,7 @@ Note: This tutorial requires that a SQL database is setup as shown in [Create a
229
228
- Open your app that you created in [Create a Function App](#create-a-function-app) in VSCode
230
229
- Press 'F1' and search for'Azure Functions: Create Function'
@@ -516,8 +515,8 @@ The input binding takes four [arguments](https://github.com/Azure/azure-function
516
515
517
516
The following are valid binding types for the result of the query/stored procedure execution:
518
517
519
-
- **IEnumerable<T>**: Each element is a row of the result represented by `T`, where `T` is a user-defined POCO, or Plain Old C# Object. `T` should follow the structure of a row in the queried table. See the [Query String](#query-string) section for an example of what `T` should look like.
520
-
- **IAsyncEnumerable<T>**: Each element is again a row of the result represented by `T`, but the rows are retrieved "lazily". A row of the result is only retrieved when `MoveNextAsync` is called on the enumerator. This is useful in the case that the query can return a very large amount of rows.
518
+
- **IEnumerable<T>**: Each element is a row of the result represented by `T`, where `T` is a user-defined POCO, or Plain Old C# Object. `T` should follow the structure of a row in the queried table. See the [Query String](#query-string) section for an example of what `T` should look like.
519
+
- **IAsyncEnumerable<T>**: Each element is again a row of the result represented by `T`, but the rows are retrieved "lazily". A row of the result is only retrieved when `MoveNextAsync` is called on the enumerator. This is useful in the case that the query can return a very large amount of rows.
521
520
- **String**: A JSON string representation of the rows of the result (an example is provided [here](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-csharp/InputBindingSamples/GetProductsString.cs)).
522
521
- **SqlCommand**: The SqlCommand is populated with the appropriate query and parameters, but the associated connection is not opened. It is the responsiblity of the user to execute the command and read in the results. This is useful in the case that the user wants more control over how the results are read in. An example is provided [here](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-csharp/InputBindingSamples/GetProductsSqlCommand.cs).
523
522
@@ -657,13 +656,13 @@ The output binding takes two [arguments](https://github.com/Azure/azure-function
657
656
658
657
The following are valid binding types for the rows to be upserted into the table:
659
658
660
-
- **ICollector<T>/IAsyncCollector<T>**: Each element is a row represented by `T`, where `T` is a user-defined POCO, or Plain Old C# Object. `T` should follow the structure of a row in the queried table. See the [Query String](#query-string) for an example of what `T` should look like.
659
+
- **ICollector<T>/IAsyncCollector<T>**: Each element is a row represented by `T`, where `T` is a user-defined POCO, or Plain Old C# Object. `T` should follow the structure of a row in the queried table. See the [Query String](#query-string) for an example of what `T` should look like.
661
660
- **T**: Used when just one row is to be upserted into the table.
662
661
- **T[]**: Each element is again a row of the result represented by `T`. This output binding type requires manual instantiation of the array in the function.
663
662
664
663
The repo contains examples of each of these binding types [here](https://github.com/Azure/azure-functions-sql-extension/tree/main/samples/samples-csharp/OutputBindingSamples). A few examples are also included below.
665
664
666
-
#### ICollector<T>/IAsyncCollector<T>
665
+
#### ICollector<T>/IAsyncCollector<T>
667
666
668
667
When using an `ICollector`, it is not necessary to instantiate it. The functioncan add rows to the `ICollector` directly, and its contents are automatically upserted once the functionexits.
0 commit comments