Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/GeneralSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ ALTER TABLE ['{table_name}'] ALTER COLUMN ['{primary_key_column_name}'] int NOT
ALTER TABLE ['{table_name}'] ADD CONSTRAINT PKey PRIMARY KEY CLUSTERED (['{primary_key_column_name}']);
```

## Create a Function App
## Create a Function Project

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

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

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

2. Create a function app for .NET, JavaScript, TypeScript, Python or Java.
2. Create a function project for .NET, JavaScript, TypeScript, Python or Java.

**.NET**

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

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).
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).

**.NET:** Install the extension.

Expand Down Expand Up @@ -172,9 +172,9 @@ These steps can be done in the Terminal/CLI or with PowerShell.
}
```

## Configure Function App
## Configure Function Project

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

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).

Expand Down
12 changes: 6 additions & 6 deletions docs/SetupGuide_Dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

## Setup Function App
## Setup Function Project

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.
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.

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

2. Create a function app for .NET:
2. Create a function project for .NET:

```bash
mkdir MyApp
cd MyApp
func init --worker-runtime dotnet
```

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).
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).

Install the extension.

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

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

- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
- Press 'F1' and search for 'Azure Functions: Create Function'
- Choose HttpTrigger -> (Provide a function name) -> Company.namespace -> anonymous
- In the file that opens, replace the `public static async Task<IActionResult> Run` block with the below code.
Expand Down
25 changes: 24 additions & 1 deletion docs/SetupGuide_DotnetOutOfProc.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Table of Contents](#table-of-contents)
- [Binding Model](#binding-model)
- [Key differences with .NET (Isolated Process)](#key-differences-with-net-isolated-process)
- [Setup Function Project](#setup-function-project)
- [Input Binding](#input-binding)
- [SqlInputAttribute for Input Bindings](#sqlinputattribute-for-input-bindings)
- [Setup for Input Bindings](#setup-for-input-bindings)
Expand Down Expand Up @@ -35,6 +36,28 @@ Please refer to the functions documentation [here](https://learn.microsoft.com/a
- 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).
- 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.

## Setup Function Project

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.

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

2. Create a function project for .NET Isolated:

```bash
mkdir MyApp
cd MyApp
func init --worker-runtime dotnet-isolated
```

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).

Add the SQL binding worker extension package to the project.

```powershell
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Sql --prerelease
```

## Input Binding

See [Input Binding Overview](./BindingsOverview.md#input-binding) for general information about the Azure SQL Input binding.
Expand Down Expand Up @@ -62,7 +85,7 @@ The repo contains examples of each of these binding types [here](https://github.

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

- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
- Press 'F1' and search for 'Azure Functions: Create Function'
- Choose HttpTrigger -> (Provide a function name) -> Company.namespace -> anonymous
- In the file that opens, replace the `public static async Task<IActionResult> Run` block with the below code.
Expand Down
12 changes: 6 additions & 6 deletions docs/SetupGuide_Java.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Table of Contents
- [Azure SQL bindings for Azure Functions - Java](#azure-sql-bindings-for-azure-functions---java)
- [Table of Contents](#table-of-contents)
- [Setup Function App](#setup-function-app)
- [Setup Function Project](#setup-function-project)
- [Input Binding](#input-binding)
- [SQLInput Attribute](#sqlinput-attribute)
- [Setup for Input Bindings](#setup-for-input-bindings)
Expand All @@ -21,21 +21,21 @@
- [Trigger Binding](#trigger-binding)
- [Known Issues](#known-issues)

## Setup Function App
## Setup Function Project

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.
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.

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

2. Create a function app for Java:
2. Create a Function Project for Java:

```bash
mkdir MyApp
cd MyApp
func init --worker-runtime java
```

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).
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).

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

Expand Down Expand Up @@ -78,7 +78,7 @@ When you're developing locally, add your application settings in the local.setti

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

- Open your app that you created in [Setup Function App](#setup-function-app) in VS Code
- Open your app that you created in [Setup Function Project](#setup-function-project) in VS Code
- Press 'F1' and search for 'Azure Functions: Create Function'
- Choose HttpTrigger -> (Provide a package name) -> (Provide a function name) -> anonymous
- In the file that opens, replace the `public HttpResponseMessage run` block with the below code.
Expand Down
12 changes: 6 additions & 6 deletions docs/SetupGuide_Javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

## Setup Function App
## Setup Function Project

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.
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.

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

2. Create a function app for Javascript:
2. Create a Function Project for Javascript:

```bash
mkdir MyApp
cd MyApp
func init --worker-runtime node --language javascript
```

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).
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).

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

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

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

- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
- Press 'F1' and search for 'Azure Functions: Create Function'
- Choose HttpTrigger -> (Provide a function name) -> anonymous
- In the file that opens (`index.js`), replace the `module.exports = async function (context, req)` block with the below code.
Expand Down
12 changes: 6 additions & 6 deletions docs/SetupGuide_PowerShell.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

## Setup Function App
## Setup Function Project

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.
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.

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

2. Create a function app for PowerShell:
2. Create a Function Project for PowerShell:

```bash
mkdir MyApp
cd MyApp
func init --worker-runtime powershell
```

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).
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).

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

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

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

- Open your app that you created in [Create a Function App](./GeneralSetup.md#create-a-function-app) in VS Code
- Open your project that you created in [Create a Function Project](./GeneralSetup.md#create-a-function-project) in VS Code
- Press 'F1' and search for 'Azure Functions: Create Function'
- Choose HttpTrigger -> (Provide a function name) -> anonymous
- In the file that opens (`run.ps1`), replace the code within the file the below code.
Expand Down
12 changes: 6 additions & 6 deletions docs/SetupGuide_Python.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

## Setup Function App
## Setup Function Project

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.
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.

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

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

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

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).
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).

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

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

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

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