Skip to content

Commit 5d80e4b

Browse files
Merge branch 'main' into release/LogicApps
# Conflicts: # builds/azure-pipelines/build-release.yml
2 parents e77e74d + eebcf3e commit 5d80e4b

File tree

182 files changed

+4838
-760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+4838
-760
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners.
33
# Syntax can be found here: https://docs.github.com/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
44

5-
* @Charles-Gagnon @lucyzhang929 @chlafreniere @MaddyDev
5+
* @Charles-Gagnon @lucyzhang929 @chlafreniere @MaddyDev @VasuBhog

.vscode/launch.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
"name": "Attach to Function Host",
1919
"type": "coreclr",
2020
"request": "attach",
21-
"processName": "func.exe"
21+
"Windows": {
22+
"processName": "func.exe"
23+
},
24+
"processName": "func"
2225
}
2326
]
2427
}

Directory.Build.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@
1010
<DelaySign>True</DelaySign>
1111
<SignAssembly>True</SignAssembly>
1212
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/SQL2003.snk</AssemblyOriginatorKeyFile>
13+
<Company>Microsoft</Company>
14+
<Authors>Microsoft</Authors>
15+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1316
<IsPackable>false</IsPackable>
17+
<DebugSymbols>true</DebugSymbols>
18+
<IncludeSymbols>true</IncludeSymbols>
19+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20+
<DebugType>portable</DebugType>
21+
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
22+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
23+
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
24+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
25+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
26+
<PackageProjectUrl>https://github.com/Azure/azure-functions-sql-extension</PackageProjectUrl>
27+
<PackageIcon>pkgicon.png</PackageIcon>
28+
<PackageReadmeFile>README.md</PackageReadmeFile>
1429
</PropertyGroup>
1530
</Project>
File renamed without changes.

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Azure SQL bindings for Azure Functions - Preview
22

3-
[![Build Status](https://mssqltools.visualstudio.com/CrossPlatBuildScripts/_apis/build/status/SQL%20Bindings/SQL%20Bindings%20-%20Nightly?branchName=main)](https://mssqltools.visualstudio.com/CrossPlatBuildScripts/_build/latest?definitionId=481&branchName=main)
4-
53
## Table of Contents
64
- [Azure SQL bindings for Azure Functions - Preview](#azure-sql-bindings-for-azure-functions---preview)
75
- [Table of Contents](#table-of-contents)
@@ -18,22 +16,22 @@
1816

1917
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:
2018

21-
- **Input Binding**: takes a SQL query to run and returns the output of the query in the function.
19+
- **Input Binding**: takes a SQL query or stored procedure to run and returns the output to the function.
2220
- **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).
2321
- **Trigger Binding**: monitors the user table for changes (i.e., row inserts, updates, and deletes) and invokes the function with updated rows.
2422

25-
For a more detailed overview of the different types of bindings see the [Bindings Overview](./docs/BindingsOverview.md).
23+
For a more detailed overview of the different types of bindings see the [Bindings Overview](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/BindingsOverview.md).
2624

2725
For further details on setup, usage and samples of the bindings see the language-specific guides below:
2826

29-
- [.NET (C# in-process)](./docs/SetupGuide_Dotnet.md)
30-
- [.NET (C# out-of-proc)](./docs/SetupGuide_DotnetOutOfProc.md)
31-
- [Java](./docs/SetupGuide_Java.md)
32-
- [Javascript](./docs/SetupGuide_Javascript.md)
33-
- [PowerShell](./docs/SetupGuide_PowerShell.md)
34-
- [Python](./docs/SetupGuide_Python.md)
27+
- [.NET (C# in-process)](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Dotnet.md)
28+
- [.NET (C# out-of-proc)](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_DotnetOutOfProc.md)
29+
- [Java](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Java.md)
30+
- [Javascript](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Javascript.md)
31+
- [PowerShell](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_PowerShell.md)
32+
- [Python](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Python.md)
3533

36-
Further information on the Azure SQL binding for Azure Functions is also available in the [Azure Functions docs](https://docs.microsoft.com/azure/azure-functions/functions-bindings-azure-sql).
34+
Further information on the Azure SQL binding for Azure Functions is also available in the [docs](https://aka.ms/sqlbindings).
3735

3836
## Supported SQL Server Versions
3937

@@ -42,18 +40,24 @@ This extension uses the [OPENJSON](https://learn.microsoft.com/sql/t-sql/functio
4240
Databases on SQL Server, Azure SQL Database, or Azure SQL Managed Instance which meet the compatibility level requirement above are supported.
4341

4442
## Known Issues
43+
- The table used by a SQL binding or SQL trigger cannot contain two columns that only differ by casing (Ex. 'Name' and 'name').
4544

4645
### Output Bindings
4746
- Output bindings against tables with columns of data types `NTEXT`, `TEXT`, or `IMAGE` are not supported and data upserts will fail. These types [will be removed](https://docs.microsoft.com/sql/t-sql/data-types/ntext-text-and-image-transact-sql) in a future version of SQL Server and are not compatible with the `OPENJSON` function used by this Azure Functions binding.
47+
- .NET In-Proc output bindings against tables with columns of data types `DATE`, `DATETIME`, `DATETIME2`, `DATETIMEOFFSET`, or `SMALLDATETIME` will 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.
4848
- Output bindings execution order is not deterministic ([azure-webjobs-sdk#1025](https://github.com/Azure/azure-webjobs-sdk/issues/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.
4949

5050
Some options for working around this :
5151
* Have multiple functions, with dependent functions being triggered by the initial functions (through a trigger binding or other such method)
5252
* Use [dynamic (imperative)](https://learn.microsoft.com/azure/azure-functions/functions-bindings-expressions-patterns#binding-at-runtime) bindings (.NET only)
5353
* Use [IAsyncCollector](https://learn.microsoft.com/azure/azure-functions/functions-dotnet-class-library?tabs=v2%2Ccmd#writing-multiple-output-values) and call `FlushAsync` in the order desired (.NET only)
54+
- 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](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-powershell/AddProductsWithIdentityColumnArray/run.ps1).
55+
- Java, PowerShell, and Python Functions using Output bindings cannot pass in null or empty values via the query string.
56+
- Java: Issue is tracked [here](https://github.com/Azure/azure-functions-java-worker/issues/683).
57+
- PowerShell: The workaround is to use the `$TriggerMetadata[$keyName]` to retrieve the query property - an example can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-powershell/AddProductParams/run.ps1). Issue is tracked [here](https://github.com/Azure/azure-functions-powershell-worker/issues/895).
58+
- Python: The workaround is to use `parse_qs` - an example can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-python/AddProductParams/__init__.py). Issue is tracked [here](https://github.com/Azure/azure-functions-python-worker/issues/894).
5459

5560
### Input Bindings
56-
- Input bindings against tables with columns of data types 'DATETIME', 'DATETIME2', or 'SMALLDATETIME' will assume that the values are in UTC format.
5761
- For Java Functions using Output bindings against a table with columns of data types 'DATETIME', 'DATETIME2', or 'SMALLDATETIME', use java.util.Date type to ensure the datetime is formatted correctly.
5862

5963
### Trigger Bindings

WebJobs.Extensions.Sql.sln

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Ext
2424
EndProject
2525
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "performance", "performance", "{F0F3562F-9176-4461-98E4-13D38D3DD056}"
2626
EndProject
27-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Worker.Extension.Sql", "Worker.Extension.Sql", "{605E19C0-3A77-477F-928E-85B8972B734D}"
28-
EndProject
29-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Functions.Worker.Extension.Sql", "Worker.Extension.Sql\src\Microsoft.Azure.Functions.Worker.Extension.Sql.csproj", "{84D97605-F1BF-4083-9C93-2B68A9FBB00F}"
30-
EndProject
3127
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.WebJobs.Extensions.Sql.SamplesOutOfProc", "samples\samples-outofproc\Microsoft.Azure.WebJobs.Extensions.Sql.SamplesOutOfProc.csproj", "{BD0CE086-1778-4B08-905F-6766399C1D44}"
3228
EndProject
3329
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test-outofproc", "test-outofproc\test-outofproc.csproj", "{4E09227F-3F7C-4FAC-997A-24EB799CEC61}"
3430
EndProject
31+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Worker.Extensions.Sql", "Worker.Extensions.Sql", "{D5212466-7F2E-4E6E-A939-12286F4BF53C}"
32+
EndProject
33+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Functions.Worker.Extensions.Sql", "Worker.Extensions.Sql\src\Microsoft.Azure.Functions.Worker.Extensions.Sql.csproj", "{08A2C78A-E494-4B45-94FF-BE199DE0ACC4}"
34+
EndProject
3535
Global
3636
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3737
Debug|Any CPU = Debug|Any CPU
@@ -54,10 +54,6 @@ Global
5454
{1A5148B7-F877-4813-852C-F94D6EF795E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
5555
{1A5148B7-F877-4813-852C-F94D6EF795E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
5656
{1A5148B7-F877-4813-852C-F94D6EF795E8}.Release|Any CPU.Build.0 = Release|Any CPU
57-
{84D97605-F1BF-4083-9C93-2B68A9FBB00F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58-
{84D97605-F1BF-4083-9C93-2B68A9FBB00F}.Debug|Any CPU.Build.0 = Debug|Any CPU
59-
{84D97605-F1BF-4083-9C93-2B68A9FBB00F}.Release|Any CPU.ActiveCfg = Release|Any CPU
60-
{84D97605-F1BF-4083-9C93-2B68A9FBB00F}.Release|Any CPU.Build.0 = Release|Any CPU
6157
{BD0CE086-1778-4B08-905F-6766399C1D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6258
{BD0CE086-1778-4B08-905F-6766399C1D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
6359
{BD0CE086-1778-4B08-905F-6766399C1D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -66,6 +62,10 @@ Global
6662
{4E09227F-3F7C-4FAC-997A-24EB799CEC61}.Debug|Any CPU.Build.0 = Debug|Any CPU
6763
{4E09227F-3F7C-4FAC-997A-24EB799CEC61}.Release|Any CPU.ActiveCfg = Release|Any CPU
6864
{4E09227F-3F7C-4FAC-997A-24EB799CEC61}.Release|Any CPU.Build.0 = Release|Any CPU
65+
{08A2C78A-E494-4B45-94FF-BE199DE0ACC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
66+
{08A2C78A-E494-4B45-94FF-BE199DE0ACC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
67+
{08A2C78A-E494-4B45-94FF-BE199DE0ACC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
68+
{08A2C78A-E494-4B45-94FF-BE199DE0ACC4}.Release|Any CPU.Build.0 = Release|Any CPU
6969
EndGlobalSection
7070
GlobalSection(SolutionProperties) = preSolution
7171
HideSolutionNode = FALSE
@@ -75,8 +75,8 @@ Global
7575
{4453B407-2CA3-4011-BDE5-247FCE5C1974} = {21CDC01C-247B-46B0-A8F5-9D35686C628B}
7676
{A5B55530-71C8-4A9A-92AD-1D33A5E80FC1} = {F7E99EB5-47D3-4B50-A6AA-D8D5508A121A}
7777
{1A5148B7-F877-4813-852C-F94D6EF795E8} = {F0F3562F-9176-4461-98E4-13D38D3DD056}
78-
{84D97605-F1BF-4083-9C93-2B68A9FBB00F} = {605E19C0-3A77-477F-928E-85B8972B734D}
7978
{BD0CE086-1778-4B08-905F-6766399C1D44} = {3691FB44-971D-43FD-9B2F-916B8CE689DB}
79+
{08A2C78A-E494-4B45-94FF-BE199DE0ACC4} = {D5212466-7F2E-4E6E-A939-12286F4BF53C}
8080
EndGlobalSection
8181
GlobalSection(ExtensibilityGlobals) = postSolution
8282
SolutionGuid = {49902AA5-150F-4567-B562-4AA8549B2CF4}

Worker.Extension.Sql/src/Microsoft.Azure.Functions.Worker.Extension.Sql.csproj

Lines changed: 0 additions & 21 deletions
This file was deleted.

Worker.Extension.Sql/src/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<AssemblyName>Microsoft.Azure.Functions.Worker.Extensions.Sql</AssemblyName>
5+
<RootNamespace>Microsoft.Azure.Functions.Worker.Extensions.Sql</RootNamespace>
6+
<Description>Sql extension for .NET isolated Azure Functions</Description>
7+
<Product>SQL Binding Worker</Product>
8+
<!--Version information-->
9+
<VersionPrefix>99.99.99</VersionPrefix>
10+
<SupportedVersion>1.*-*</SupportedVersion>
11+
<PackageId>Microsoft.Azure.Functions.Worker.Extensions.Sql</PackageId>
12+
<PackageTags>Microsoft Azure WebJobs AzureFunctions Isolated DotnetIsolated SQL AzureSQL Worker</PackageTags>
13+
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
14+
<IsPackable>true</IsPackable>
15+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
16+
</PropertyGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" />
20+
<PackageReference Include="Microsoft.Data.SqlClient" />
21+
<PackageReference Include="System.Drawing.Common" />
22+
<None Include="..\..\Images\pkgicon.png" Pack="true" PackagePath="" />
23+
<None Include=".\README.md" Pack="true" PackagePath="" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<AssemblyAttribute Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions.ExtensionInformationAttribute">
28+
<_Parameter1>Microsoft.Azure.WebJobs.Extensions.Sql</_Parameter1>
29+
<_Parameter2>$(SupportedVersion)</_Parameter2>
30+
</AssemblyAttribute>
31+
</ItemGroup>
32+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Azure SQL bindings .NET Worker
2+
3+
Welcome to the Azure SQL bindings .NET Worker Repository. The .NET Worker provides .NET 5 support in Azure Functions, introducing an **Isolated Model**, running as an out-of-process language worker that is separate from the Azure Functions runtime. This allows you to have full control over your application's dependencies as well as other new features like a middleware pipeline.
4+
5+
A .NET Isolated function app works differently than a .NET Core 3.1 function app. For .NET Isolated, you build an executable that imports the .NET Isolated language worker as a NuGet package. Your app includes a [`Program.cs`](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-outofproc/Program.cs) that starts the worker.
6+
7+
## Binding Model
8+
9+
.NET Isolated introduces a new binding model, slightly different from the binding model exposed in .NET Core 3 Azure Functions. More information can be [found here](https://github.com/Azure/azure-functions-dotnet-worker/wiki/.NET-Worker-bindings). Please review our samples for usage [information](#samples).
10+
11+
## Middleware
12+
13+
The Azure Functions .NET Isolated supports middleware registration, following a model similar to what exists in ASP.NET and giving you the ability to inject logic into the invocation pipeline, pre and post function executions.
14+
15+
## Samples
16+
17+
Get started quickly with the samples available in our [repository](https://github.com/Azure/azure-functions-sql-extension/tree/main/samples/samples-outofproc)
18+
19+
For further details on setup, usage and samples of the bindings see the guide below:
20+
21+
- [.NET (C# out-of-proc)](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_DotnetOutOfProc.md)

0 commit comments

Comments
 (0)