Skip to content

Commit 4008949

Browse files
Add OOP function app setup (#676)
* add set up instructions * add toc link * Update docs/SetupGuide_DotnetOutOfProc.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * rename app to project * fix typo and missed references * missed references * rename app to project in all docs * update missed places1 --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
1 parent 032d811 commit 4008949

File tree

7 files changed

+60
-37
lines changed

7 files changed

+60
-37
lines changed

docs/GeneralSetup.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ ALTER TABLE ['{table_name}'] ALTER COLUMN ['{primary_key_column_name}'] int NOT
4242
ALTER TABLE ['{table_name}'] ADD CONSTRAINT PKey PRIMARY KEY CLUSTERED (['{primary_key_column_name}']);
4343
```
4444

45-
## Create a Function App
45+
## Create a Function Project
4646

47-
Now you will need a Function App to add the binding to. If you have one created already you can skip this step.
47+
Now you will need a Function Project to add the binding to. If you have one created already you can skip this step.
4848

4949
These steps can be done in the Terminal/CLI or with PowerShell.
5050

5151
1. Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local)
5252

53-
2. Create a function app for .NET, JavaScript, TypeScript, Python or Java.
53+
2. Create a function project for .NET, JavaScript, TypeScript, Python or Java.
5454

5555
**.NET**
5656

@@ -102,7 +102,7 @@ These steps can be done in the Terminal/CLI or with PowerShell.
102102
func init --worker-runtime powershell
103103
```
104104

105-
3. Enable SQL bindings on the function app. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
105+
3. Enable SQL bindings on the function project. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
106106

107107
**.NET:** Install the extension.
108108

@@ -172,9 +172,9 @@ These steps can be done in the Terminal/CLI or with PowerShell.
172172
}
173173
```
174174

175-
## Configure Function App
175+
## Configure Function Project
176176

177-
Once you have your Function App you need to configure it for use with Azure SQL bindings for Azure Functions.
177+
Once you have your Function Project you need to configure it for use with Azure SQL bindings for Azure Functions.
178178

179179
1. Ensure you have Azure Storage Emulator running. This is specific to the sample functions in this repository with a non-HTTP trigger. For information on the Azure Storage Emulator, refer to the docs on its use in [functions local development](https://docs.microsoft.com/azure/azure-functions/functions-app-settings#azurewebjobsstorage) and [installation](https://docs.microsoft.com/azure/storage/common/storage-use-emulator#get-the-storage-emulator).
180180

docs/SetupGuide_Dotnet.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- [Azure SQL bindings for Azure Functions - .NET](#azure-sql-bindings-for-azure-functions---net)
66
- [Table of Contents](#table-of-contents)
7-
- [Setup Function App](#setup-function-app)
7+
- [Setup Function Project](#setup-function-project)
88
- [Input Binding](#input-binding)
99
- [SqlAttribute for Input Bindings](#sqlattribute-for-input-bindings)
1010
- [Setup for Input Bindings](#setup-for-input-bindings)
@@ -25,21 +25,21 @@
2525
- [SqlTriggerAttribute](#sqltriggerattribute)
2626
- [Setup for Trigger Bindings](#setup-for-trigger-bindings)
2727

28-
## Setup Function App
28+
## Setup Function Project
2929

30-
These instructions will guide you through creating your Function App and adding the SQL binding extension. This only needs to be done once for every function app you create. If you have one created already you can skip this step.
30+
These instructions will guide you through creating your Function Project and adding the SQL binding 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.
3131

3232
1. Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local)
3333

34-
2. Create a function app for .NET:
34+
2. Create a function project for .NET:
3535

3636
```bash
3737
mkdir MyApp
3838
cd MyApp
3939
func init --worker-runtime dotnet
4040
```
4141

42-
3. Enable SQL bindings on the function app. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
42+
3. Enable SQL bindings on the function project. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
4343

4444
Install the extension.
4545

@@ -73,7 +73,7 @@ The repo contains examples of each of these binding types [here](https://github.
7373

7474
Note: This tutorial requires that a SQL database is setup as shown in [Create a SQL Server](./GeneralSetup.md#create-a-sql-server).
7575

76-
- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
76+
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
7777
- Press 'F1' and search for 'Azure Functions: Create Function'
7878
- Choose HttpTrigger -> (Provide a function name) -> Company.namespace -> anonymous
7979
- In the file that opens, replace the `public static async Task<IActionResult> Run` block with the below code.

docs/SetupGuide_DotnetOutOfProc.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [Table of Contents](#table-of-contents)
77
- [Binding Model](#binding-model)
88
- [Key differences with .NET (Isolated Process)](#key-differences-with-net-isolated-process)
9+
- [Setup Function Project](#setup-function-project)
910
- [Input Binding](#input-binding)
1011
- [SqlInputAttribute for Input Bindings](#sqlinputattribute-for-input-bindings)
1112
- [Setup for Input Bindings](#setup-for-input-bindings)
@@ -35,6 +36,28 @@ Please refer to the functions documentation [here](https://learn.microsoft.com/a
3536
- 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).
3637
- 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.
3738

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+
3861
## Input Binding
3962

4063
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.
6285
6386
Note: This tutorial requires that a SQL database is setup as shown in [Create a SQL Server](./GeneralSetup.md#create-a-sql-server).
6487
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
6689
- Press 'F1' and search for 'Azure Functions: Create Function'
6790
- Choose HttpTrigger -> (Provide a function name) -> Company.namespace -> anonymous
6891
- In the file that opens, replace the `public static async Task<IActionResult> Run` block with the below code.

docs/SetupGuide_Java.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Table of Contents
44
- [Azure SQL bindings for Azure Functions - Java](#azure-sql-bindings-for-azure-functions---java)
55
- [Table of Contents](#table-of-contents)
6-
- [Setup Function App](#setup-function-app)
6+
- [Setup Function Project](#setup-function-project)
77
- [Input Binding](#input-binding)
88
- [SQLInput Attribute](#sqlinput-attribute)
99
- [Setup for Input Bindings](#setup-for-input-bindings)
@@ -21,21 +21,21 @@
2121
- [Trigger Binding](#trigger-binding)
2222
- [Known Issues](#known-issues)
2323

24-
## Setup Function App
24+
## Setup Function Project
2525

26-
These instructions will guide you through creating your Function App and adding the SQL binding extension. This only needs to be done once for every function app you create. If you have one created already you can skip this step.
26+
These instructions will guide you through creating your Function Project and adding the SQL binding 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.
2727

2828
1. Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local)
2929

30-
2. Create a function app for Java:
30+
2. Create a Function Project for Java:
3131

3232
```bash
3333
mkdir MyApp
3434
cd MyApp
3535
func init --worker-runtime java
3636
```
3737

38-
3. Enable SQL bindings on the function app. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
38+
3. Enable SQL bindings on the function project. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
3939

4040
Update the `host.json` file to the preview extension bundle.
4141

@@ -78,7 +78,7 @@ When you're developing locally, add your application settings in the local.setti
7878
7979
Note: This tutorial requires that a SQL database is setup as shown in [Create a SQL Server](./GeneralSetup.md#create-a-sql-server).
8080
81-
- Open your app that you created in [Setup Function App](#setup-function-app) in VS Code
81+
- Open your app that you created in [Setup Function Project](#setup-function-project) in VS Code
8282
- Press 'F1' and search for 'Azure Functions: Create Function'
8383
- Choose HttpTrigger -> (Provide a package name) -> (Provide a function name) -> anonymous
8484
- In the file that opens, replace the `public HttpResponseMessage run` block with the below code.

docs/SetupGuide_Javascript.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- [Azure SQL bindings for Azure Functions - Javascript](#azure-sql-bindings-for-azure-functions---javascript)
66
- [Table of Contents](#table-of-contents)
7-
- [Setup Function App](#setup-function-app)
7+
- [Setup Function Project](#setup-function-project)
88
- [Input Binding](#input-binding)
99
- [function.json Properties for Input Bindings](#functionjson-properties-for-input-bindings)
1010
- [Setup for Input Bindings](#setup-for-input-bindings)
@@ -23,21 +23,21 @@
2323
- [Single Row](#single-row)
2424
- [Trigger Binding](#trigger-binding)
2525

26-
## Setup Function App
26+
## Setup Function Project
2727

28-
These instructions will guide you through creating your Function App and adding the SQL binding extension. This only needs to be done once for every function app you create. If you have one created already you can skip this step.
28+
These instructions will guide you through creating your Function Project and adding the SQL binding 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.
2929

3030
1. Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local)
3131

32-
2. Create a function app for Javascript:
32+
2. Create a Function Project for Javascript:
3333

3434
```bash
3535
mkdir MyApp
3636
cd MyApp
3737
func init --worker-runtime node --language javascript
3838
```
3939

40-
3. Enable SQL bindings on the function app. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
40+
3. Enable SQL bindings on the function project. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
4141

4242
Update the `host.json` file to the preview extension bundle.
4343

@@ -70,7 +70,7 @@ The following table explains the binding configuration properties that you set i
7070

7171
Note: This tutorial requires that a SQL database is setup as shown in [Create a SQL Server](./GeneralSetup.md#create-a-sql-server).
7272

73-
- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
73+
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
7474
- Press 'F1' and search for 'Azure Functions: Create Function'
7575
- Choose HttpTrigger -> (Provide a function name) -> anonymous
7676
- In the file that opens (`index.js`), replace the `module.exports = async function (context, req)` block with the below code.

docs/SetupGuide_PowerShell.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- [Azure SQL bindings for Azure Functions - PowerShell](#azure-sql-bindings-for-azure-functions---powershell)
66
- [Table of Contents](#table-of-contents)
7-
- [Setup Function App](#setup-function-app)
7+
- [Setup Function Project](#setup-function-project)
88
- [Input Binding](#input-binding)
99
- [function.json Properties for Input Bindings](#functionjson-properties-for-input-bindings)
1010
- [Setup for Input Bindings](#setup-for-input-bindings)
@@ -22,21 +22,21 @@
2222
- [Single Row](#single-row)
2323
- [Trigger Binding](#trigger-binding)
2424

25-
## Setup Function App
25+
## Setup Function Project
2626

27-
These instructions will guide you through creating your Function App and adding the SQL binding extension. This only needs to be done once for every function app you create. If you have one created already you can skip this step.
27+
These instructions will guide you through creating your Function Project and adding the SQL binding 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.
2828

2929
1. Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local)
3030

31-
2. Create a function app for PowerShell:
31+
2. Create a Function Project for PowerShell:
3232

3333
```bash
3434
mkdir MyApp
3535
cd MyApp
3636
func init --worker-runtime powershell
3737
```
3838

39-
3. Enable SQL bindings on the function app. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
39+
3. Enable SQL bindings on the function project. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
4040

4141
Update the `host.json` file to the preview extension bundle.
4242

@@ -69,7 +69,7 @@ The following table explains the binding configuration properties that you set i
6969

7070
Note: This tutorial requires that a SQL database is setup as shown in [Create a SQL Server](./GeneralSetup.md#create-a-sql-server).
7171

72-
- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
72+
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
7373
- Press 'F1' and search for 'Azure Functions: Create Function'
7474
- Choose HttpTrigger -> (Provide a function name) -> anonymous
7575
- In the file that opens (`run.ps1`), replace the code within the file the below code.

docs/SetupGuide_Python.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- [Azure SQL bindings for Azure Functions - Python](#azure-sql-bindings-for-azure-functions---python)
66
- [Table of Contents](#table-of-contents)
7-
- [Setup Function App](#setup-function-app)
7+
- [Setup Function Project](#setup-function-project)
88
- [Input Binding](#input-binding)
99
- [function.json Properties for Input Bindings](#functionjson-properties-for-input-bindings)
1010
- [Setup for Input Bindings](#setup-for-input-bindings)
@@ -23,13 +23,13 @@
2323
- [Single Row](#single-row)
2424
- [Trigger Binding](#trigger-binding)
2525

26-
## Setup Function App
26+
## Setup Function Project
2727

28-
These instructions will guide you through creating your Function App and adding the SQL binding extension. This only needs to be done once for every function app you create. If you have one created already you can skip this step.
28+
These instructions will guide you through creating your Function Project and adding the SQL binding 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.
2929

3030
1. Install [Azure Functions Core Tools](https://docs.microsoft.com/azure/azure-functions/functions-run-local)
3131

32-
2. Create a function app for Python:
32+
2. Create a Function Project for Python:
3333
*See [#250](https://github.com/Azure/azure-functions-sql-extension/issues/250) before starting.*
3434

3535
```bash
@@ -38,7 +38,7 @@ These instructions will guide you through creating your Function App and adding
3838
func init --worker-runtime python
3939
```
4040

41-
3. Enable SQL bindings on the function app. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
41+
3. Enable SQL bindings on the function project. More information can be found in the [Azure SQL bindings for Azure Functions docs](https://aka.ms/sqlbindings).
4242

4343
Update the `host.json` file to the preview extension bundle.
4444

@@ -69,7 +69,7 @@ See [Input Binding Overview](./BindingsOverview.md#input-binding) for general in
6969

7070
Note: This tutorial requires that a SQL database is setup as shown in [Create a SQL Server](./GeneralSetup.md#create-a-sql-server).
7171

72-
- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
72+
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
7373
- Press 'F1' and search for 'Azure Functions: Create Function'
7474
- Choose HttpTrigger -> (Provide a function name) -> anonymous
7575
- In the file that opens (`__init__.py`), replace the generated function with the following

0 commit comments

Comments
 (0)