WebJobs. Extensions. Sql
dotnet add package Microsoft.Azure.WebJobs.Extensions.Sql --version 3.0.461
NuGet\Install-Package Microsoft.Azure.WebJobs.Extensions.Sql -Version 3.0.461
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Sql" Version="3.0.461" />
paket add Microsoft.Azure.WebJobs.Extensions.Sql --version 3.0.461
#r "nuget: Microsoft.Azure.WebJobs.Extensions.Sql, 3.0.461"
// Install Microsoft.Azure.WebJobs.Extensions.Sql as a Cake Addin #addin nuget:?package=Microsoft.Azure.WebJobs.Extensions.Sql&version=3.0.461 // Install Microsoft.Azure.WebJobs.Extensions.Sql as a Cake Tool #tool nuget:?package=Microsoft.Azure.WebJobs.Extensions.Sql&version=3.0.461
Azure SQL bindings for Azure Functions - Preview
Table of Contents
- Azure SQL bindings for Azure Functions - Preview
This repository contains the Azure SQL bindings for Azure Functions extension code as well as a quick start tutorial and samples illustrating how to use the binding in different ways. The types of bindings supported are:
- Input Binding: takes a SQL query or stored procedure to run and returns the output to the function.
- Output Binding: takes a list of rows and upserts them into the user table (i.e. If a row doesn't already exist, it is added. If it does, it is updated).
- Trigger Binding: monitors the user table for changes (i.e., row inserts, updates, and deletes) and invokes the function with updated rows.
For a more detailed overview of the different types of bindings see the Bindings Overview.
For further details on setup, usage and samples of the bindings see the language-specific guides below:
Further information on the Azure SQL binding for Azure Functions is also available in the docs.
Supported SQL Server Versions
This extension uses the OPENJSON statement which requires a database compatibility level of 130 or higher (2016 or higher). To view or change the compatibility level of your database, see this documentation article for more information.
Databases on SQL Server, Azure SQL Database, or Azure SQL Managed Instance which meet the compatibility level requirement above are supported.
Known/By Design Issues
Below is a list of common issues that users may run into when using the SQL Bindings extension.
Note: While we are actively working on resolving the known issues, some may not be supported at this time. We appreciate your patience as we work to improve the Azure Functions SQL Extension.
- By Design: The table used by a SQL binding or SQL trigger cannot contain two columns that only differ by casing (Ex. 'Name' and 'name').
- By Design: Non-CSharp functions using SQL bindings against tables with columns of data types
VARBINARYneed to map those columns to a string type. Input bindings will return the binary value as a base64 encoded string. Output bindings require the value upserted to binary columns to be a base64 encoded string.
- Planned for Future Support: SQL bindings against tables with columns of data types
GEOGRAPHYare not supported. Issue is tracked here.
- Issues resulting from upstream dependencies can be found here.
By Design: Output bindings against tables with columns of data types
IMAGEare not supported and data upserts will fail. These types will be removed in a future version of SQL Server and are not compatible with the
OPENJSONfunction used by this Azure Functions binding.
By Design: .NET In-Proc output bindings against tables with columns of data types
SMALLDATETIMEwill convert values for those columns to ISO8061 format ("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffZ") before upsertion. This does not happen for functions written in C# out-of-proc or other languages.
By Design: Output bindings execution order is not deterministic (azure-webjobs-sdk#1025) and so the order that data is upserted is not guaranteed. This can be problematic if, for example, you upsert rows to two separate tables with one having a foreign key reference to another. The upsert will fail if the dependent table does its upsert first.
Some options for working around this :
By Design: Output bindings require that their payloads contain ALL columns defined in every execution, even optional ones. See BindingsOverview.md#output-binding-columns for more details
Planned for Future Support: For PowerShell Functions that use hashtables must use the
[ordered]@for the request query or request body assertion in order to upsert the data to the SQL table properly. An example can be found here.
Planned for Future Support: Java, PowerShell, and Python Functions using Output bindings cannot pass in null or empty values via the query string.
- By Design: Trigger bindings will exhibit undefined behavior if the SQL table schema gets modified while the user application is running, for example, if a column is added, renamed or deleted or if the primary key is modified or deleted. In such cases, restarting the application should help resolve any errors.
This extension collects usage data in order to help us improve your experience. The data is anonymous and doesn't include any personal information. You can opt-out of telemetry by setting the
AZUREFUNCTIONS_SQLBINDINGS_TELEMETRY_OPTOUT environment variable or the
AzureFunctionsSqlBindingsTelemetryOptOut app setting (in your
*.settings.json file) to '1', 'true' or 'yes';
For troubleshooting SQL Client issues, You can enable verbose logging by setting the
AzureFunctions_SqlBindings_VerboseLogging app setting (in your
*.settings.json file) to '1', 'true' or 'yes';
Logs for function apps deployed in Azure can be viewed in the function's Monitor tab. If logs are not showing in the Monitor tab, they can also be found in the function app's Log Stream or in Application Insights. More information on logging can be found here.
To learn more about our Privacy Statement visit this link.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
|Product||Versions Compatible and additional computed target framework versions.|
|.NET||net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed.|
|.NET Core||netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed.|
|.NET Standard||netstandard2.0 is compatible. netstandard2.1 was computed.|
|.NET Framework||net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed.|
|MonoAndroid||monoandroid was computed.|
|MonoMac||monomac was computed.|
|MonoTouch||monotouch was computed.|
|Tizen||tizen40 was computed. tizen60 was computed.|
|Xamarin.iOS||xamarinios was computed.|
|Xamarin.Mac||xamarinmac was computed.|
|Xamarin.TVOS||xamarintvos was computed.|
|Xamarin.WatchOS||xamarinwatchos was computed.|
- Azure.Identity (>= 1.10.2)
- Microsoft.ApplicationInsights (>= 2.21.0)
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.Azure.WebJobs (>= 3.0.37)
- Microsoft.Data.SqlClient (>= 5.0.1)
- Microsoft.SqlServer.TransactSql.ScriptDom (>= 161.8901.0)
- morelinq (>= 3.4.2)
- Newtonsoft.Json (>= 13.0.3)
- System.Runtime.Caching (>= 5.0.0)
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.