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-add-output-binding-azure-sql-vs-code.md
+46-46Lines changed: 46 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,13 +89,13 @@ Because you're using an Azure SQL output binding, you must have the correspondin
89
89
90
90
With the exception of HTTP and timer triggers, bindings are implemented as extension packages. Run the following [dotnet add package](/dotnet/core/tools/dotnet-add-package) command in the Terminal window to add the Azure SQL extension package to your project.
@@ -131,14 +131,7 @@ Open the *HttpExample.cs* project file and add the following `ToDoItem` class, w
131
131
132
132
In a C# class library project, the bindings are defined as binding attributes on the function method. The *function.json* file required by Functions is then auto-generated based on these attributes.
133
133
134
-
# [In-process](#tab/in-process)
135
-
Open the *HttpExample.cs* project file and add the following parameter to the `Run` method definition:
The `toDoItems` parameter is an `IAsyncCollector<ToDoItem>` type, which represents a collection of ToDo items that are written to your Azure SQL Database when the function completes. Specific attributes indicate the names of the database table (`dbo.ToDo`) and the connection string for your Azure SQL Database (`SqlConnectionString`).
140
-
141
-
# [Isolated process](#tab/isolated-process)
134
+
# [Isolated worker model](#tab/isolated-process)
142
135
143
136
Open the *HttpExample.cs* project file and add the following output type class, which defines the combined objects that will be output from our function for both the HTTP response and the SQL output:
144
137
@@ -157,6 +150,13 @@ Add a using statement to the `Microsoft.Azure.Functions.Worker.Extensions.Sql` l
The `toDoItems` parameter is an `IAsyncCollector<ToDoItem>` type, which represents a collection of ToDo items that are written to your Azure SQL Database when the function completes. Specific attributes indicate the names of the database table (`dbo.ToDo`) and the connection string for your Azure SQL Database (`SqlConnectionString`).
159
+
160
160
---
161
161
162
162
::: zone-end
@@ -247,7 +247,40 @@ In this code, `arg_name` identifies the binding parameter referenced in your cod
247
247
248
248
::: zone pivot="programming-language-csharp"
249
249
250
-
# [In-process](#tab/in-process)
250
+
# [Isolated worker model](#tab/isolated-process)
251
+
252
+
Replace the existing Run method with the following code:
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-add-output-binding-cosmos-db-vs-code.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,13 +94,13 @@ Because you're using an Azure Cosmos DB output binding, you must have the corres
94
94
95
95
Except for HTTP and timer triggers, bindings are implemented as extension packages. Run the following [dotnet add package](/dotnet/core/tools/dotnet-add-package) command in the Terminal window to add the Azure Cosmos DB extension package to your project.
The `documentsOut` parameter is an `IAsyncCollector<T>` type, which represents a collection of JSON documents that are written to your Azure Cosmos DB container when the function completes. Specific attributes indicate the names of the container and its parent database. The connection string for your Azure Cosmos DB account is set by the `ConnectionStringSettingAttribute`.
130
-
131
-
# [Isolated process](#tab/isolated-process)
124
+
# [Isolated worker model](#tab/isolated-process)
132
125
133
126
Open the *HttpExample.cs* project file and add the following classes:
134
127
@@ -138,6 +131,13 @@ The `MyDocument` class defines an object that gets written to the database. The
138
131
139
132
The `MultiResponse` class allows you to both write to the specified collection in the Azure Cosmos DB and return an HTTP success message. Because you need to return a `MultiResponse` object, you need to also update the method signature.
140
133
134
+
# [In-process model](#tab/in-process)
135
+
Open the *HttpExample.cs* project file and add the following parameter to the `Run` method definition:
The `documentsOut` parameter is an `IAsyncCollector<T>` type, which represents a collection of JSON documents that are written to your Azure Cosmos DB container when the function completes. Specific attributes indicate the names of the container and its parent database. The connection string for your Azure Cosmos DB account is set by the `ConnectionStringSettingAttribute`.
140
+
141
141
---
142
142
143
143
Specific attributes specify the name of the container and the name of its parent database. The connection string for your Azure Cosmos DB account is set by the `CosmosDbConnectionString`.
@@ -233,7 +233,13 @@ In this code, `arg_name` identifies the binding parameter referenced in your cod
233
233
234
234
::: zone pivot="programming-language-csharp"
235
235
236
-
# [In-process](#tab/in-process)
236
+
# [Isolated worker model](#tab/isolated-process)
237
+
238
+
Replace the existing Run method with the following code:
More samples for the Azure Data Explorer input binding (out of process) are available in the [GitHub repository](https://github.com/Azure/Webjobs.Extensions.Kusto/tree/main/samples/samples-outofproc).
26
+
27
+
This section contains the following examples:
28
+
29
+
*[HTTP trigger, get row by ID from query string](#http-trigger-look-up-id-from-query-string-c-oop)
30
+
*[HTTP trigger, get multiple rows from route data](#http-trigger-get-multiple-items-from-route-data-c-oop)
31
+
32
+
The examples refer to a `Product` class and the Products table, both of which are defined in the previous sections.
The following example shows a [C# function](functions-dotnet-class-library.md) that retrieves a single record. The function is triggered by an HTTP request that uses a query string to specify the ID. That ID is used to retrieve a `Product` record with the specified query.
39
+
40
+
> [!NOTE]
41
+
> The HTTP query string parameter is case sensitive.
### HTTP trigger, get multiple rows from route parameter
71
+
72
+
The following example shows a [C# function](functions-dotnet-class-library.md) that retrieves records returned by the query (based on the name of the product, in this case). The function is triggered by an HTTP request that uses route data to specify the value of a query parameter. That parameter is used to filter the `Product` records in the specified query.
More samples for the Azure Data Explorer input binding are available in the [GitHub repository](https://github.com/Azure/Webjobs.Extensions.Kusto/blob/main/samples/samples-csharp).
More samples for the Azure Data Explorer input binding (out of process) are available in the [GitHub repository](https://github.com/Azure/Webjobs.Extensions.Kusto/tree/main/samples/samples-outofproc).
141
-
142
-
This section contains the following examples:
143
-
144
-
*[HTTP trigger, get row by ID from query string](#http-trigger-look-up-id-from-query-string-c-oop)
145
-
*[HTTP trigger, get multiple rows from route data](#http-trigger-get-multiple-items-from-route-data-c-oop)
146
-
147
-
The examples refer to a `Product` class and the Products table, both of which are defined in the previous sections.
The following example shows a [C# function](functions-dotnet-class-library.md) that retrieves a single record. The function is triggered by an HTTP request that uses a query string to specify the ID. That ID is used to retrieve a `Product` record with the specified query.
154
-
155
-
> [!NOTE]
156
-
> The HTTP query string parameter is case sensitive.
### HTTP trigger, get multiple rows from route parameter
186
-
187
-
The following example shows a [C# function](functions-dotnet-class-library.md) that retrieves records returned by the query (based on the name of the product, in this case). The function is triggered by an HTTP request that uses route data to specify the value of a query parameter. That parameter is used to filter the `Product` records in the specified query.
0 commit comments