|
6 | 6 | - [Table of Contents](#table-of-contents) |
7 | 7 | - [Binding Model](#binding-model) |
8 | 8 | - [Key differences with .NET (Isolated Process)](#key-differences-with-net-isolated-process) |
| 9 | + - [Setup Function Project](#setup-function-project) |
9 | 10 | - [Input Binding](#input-binding) |
10 | 11 | - [SqlInputAttribute for Input Bindings](#sqlinputattribute-for-input-bindings) |
11 | 12 | - [Setup for Input Bindings](#setup-for-input-bindings) |
@@ -35,6 +36,28 @@ Please refer to the functions documentation [here](https://learn.microsoft.com/a |
35 | 36 | - There's also no direct support for types inherited from underlying service SDKs, such as SqlCommand. Instead, bindings rely on strings, arrays, and serializable types, such as plain old class objects (POCOs). |
36 | 37 | - For HTTP triggers, you must use HttpRequestData and HttpResponseData to access the request and response data. This is because you don't have access to the original HTTP request and response objects when running out-of-process. |
37 | 38 |
|
| 39 | +## Setup Function Project |
| 40 | + |
| 41 | +These instructions will guide you through creating your Function Project and adding the SQL binding worker extension. This only needs to be done once for every function project you create. If you have one created already you can skip this step. |
| 42 | + |
| 43 | +1. Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local) |
| 44 | + |
| 45 | +2. Create a function project for .NET Isolated: |
| 46 | + |
| 47 | + ```bash |
| 48 | + mkdir MyApp |
| 49 | + cd MyApp |
| 50 | + func init --worker-runtime dotnet-isolated |
| 51 | + ``` |
| 52 | + |
| 53 | +3. Enable SQL bindings isolated worker on the function project. More information can be found in the [Guide for running C# Azure Functions in an isolated worker process](https://learn.microsoft.com/azure/azure-functions/dotnet-isolated-process-guide). |
| 54 | + |
| 55 | + Add the SQL binding worker extension package to the project. |
| 56 | + |
| 57 | + ```powershell |
| 58 | + dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Sql --prerelease |
| 59 | + ``` |
| 60 | + |
38 | 61 | ## Input Binding |
39 | 62 |
|
40 | 63 | See [Input Binding Overview](./BindingsOverview.md#input-binding) for general information about the Azure SQL Input binding. |
@@ -62,7 +85,7 @@ The repo contains examples of each of these binding types [here](https://github. |
62 | 85 |
|
63 | 86 | Note: This tutorial requires that a SQL database is setup as shown in [Create a SQL Server](./GeneralSetup.md#create-a-sql-server). |
64 | 87 |
|
65 | | -- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code |
| 88 | +- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code |
66 | 89 | - Press 'F1' and search for 'Azure Functions: Create Function' |
67 | 90 | - Choose HttpTrigger -> (Provide a function name) -> Company.namespace -> anonymous |
68 | 91 | - In the file that opens, replace the `public static async Task<IActionResult> Run` block with the below code. |
|
0 commit comments