azure-functions-sql-extension/README.md

95 строки
9.4 KiB
Markdown
Исходник Постоянная ссылка Обычный вид История

# Azure SQL bindings for Azure Functions
2021-09-02 21:41:43 +03:00
## Table of Contents
2023-02-08 00:33:31 +03:00
- [Azure SQL bindings for Azure Functions](#azure-sql-bindings-for-azure-functions)
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Supported SQL Server Versions](#supported-sql-server-versions)
- [Known/By Design Issues](#knownby-design-issues)
- [Output Bindings](#output-bindings)
Merge release/trigger to main (#913) * Revert "Remove trigger binding for GA release (#732)" (#733) This reverts commit 78f48533b57c46da9c19230a256185dbb5d805bf. * vBump release/trigger 2.* -> 3.* (#738) * Add JObject support for SQL trigger (#722) * add support for jobject and js, ps, python samples * use utils JsonSerializeObject + comment * Update src/TriggerBinding/SqlTriggerBindingProvider.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * fix unit test + pylint --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix trigger connection not being retried when connection is closed (#731) * Add Privacy Statement to README and telemetry message (#751) * Add link to privacy statement * Add privacy link to output message * add to output message * Fix typos (cherry picked from commit 623118f3ea2dd58e5369bd627774224f9bc9594b) * enable trigger oop (#750) * add sqltrigger attribute * add SqlChange type * enable oop test * add check * fix the null reference * use GetLogger * Enable debug logging for Python and PS samples (#754) * enable debug logging for ps and python samples * enable debug logs for js samples * Add docs & logging information for Leases table info (#756) * Add ProductsTriggerWithValidation tests for Python, JS, PS (#753) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * Further clarifications to trigger retry docs (#770) * Further clarifications to trigger retry docs * Update description * increase timeout to 120 minutes (#776) * Enable more tests for OOP trigger (#777) * add more oop test samples * update logger * bump jackson dependency (#782) * Add detailed trigger docs (#780) * Filter out more default telemetry properties (cherry picked from commit d6ea6d79077fb6ac27fd0d32d1fb431fd9aae86e) * bring back trigger text * Fixes * Add SQLTrigger annotation to java library (#783) * add SQLTrigger annotation to java library * remove default values * use enum for commandtype * Disable CSX trigger tests * fix regex for java library version (#788) * Adding rest of Trigger integration tests for Python, PS, JS (#763) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * add tests * remove extra comments + powershell compress * update comment * Skip more trigger tests for CSX (#791) * Introduce Target Based Scaling (#598) * Refactor SqlTriggerListener scaling to SqlTriggerMetricsProvider and SqlTriggerScaleMonitor * Create SqlTriggerTargetScaler * Refactor unit tests * Refactor to include common queries for scaling and listener class to SqlTriggerUtils * Add doc comments for scaling classes * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix log statement * Update WebJobs package * Update nuget.config * Address review comments * Address review comments pt2 * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Address comments, test failures * Fix packages lock file * Fix error message * Address comments and test failures * Apply suggestions from code review Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Change in documentation * Fix log level --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Enable trace level logging for tests (#795) * Enable trace level logging for tests * one more * Add java trigger samples (#793) * add java trigger samples * update test-java * add SqlChangeProduct type * add rest of tests * fix polling interval test * Fix up performance tests & enable schedule (#799) * Minor trigger doc updates (#800) * Minor trigger doc updates * fix * enable rest of the trigger tests for oop (#798) * enable all trigger tests for OOP * undo * fix test * merge conflict * remove Java * add sample for python v2 model (#803) * Fix logs * fix compile * remove delegate (#809) Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> * add csx trigger samples (#806) * add trigger samples for csx * enable csx tests * add copy trigger sample * use utils.josnserialize * separate utils file * reuse utils from sql extension * remove deleted references * Cleanup trigger logging (#808) * Cleanup trigger logging * more * fix compile * Default log level of debug * Fix scale monitor tests * [Trigger] Update from main (#820) * update java library 0.1.1 -> 1.0.0 (#804) * Pin Node version to 18.15 (#818) * Pin Node version to 18.15 * Update build pipeline * Set node modules path for all * Debug * Pass in env var * Update pipeline comments (#819) --------- Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * [Trigger] Rename csharpscript and align host.json (#825) * Merge branch 'main' into release/trigger # Conflicts: # docs/SetupGuide_DotnetCSharpScript.md # samples/samples-csharp/host.json # test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj * Move triggers * Fix java version in setup guide (#821) * Refactor integration tests (#813) * create database once * fix compat level test * fix compat + logs * start func host in the beginning * fix change tracking * fix tests * fix tests * add CSharpscript and fix change tracking * set port * update xunit analyzers & temp skip failling tests * update port from fixture * pass console writeline as logger * enable identity tests * fix case sensitive tests + temp disable identity * fix indent * AddProductWithIdentityColumnIncluded fix * AddProductWithIdentityColumnIncluded * cleanup * remove extra fixture * default port * fix csx * Clean csx samples (#812) * sql attribute not needed * simplify the folder structure for csx * add local.settings.json * rename folders in proj file * clean up logs and unused * remove TriggerSamples folder * update trigger docs for csx * Fix compilation error (#835) * Add retry for Trigger tests (#836) * add retry logic * fix the csx compilation error * use xRetry * replace with RetryTheory * add diagnostic messages to logs * Update Trigger Binding set up in SetupGuide_DotnetOutOfProc.md (#845) * Update SetupGuide_DotnetOutOfProc.md * fixes * Update Trigger Binding set up in SetupGuide_Java.md (#846) * Update SetupGuide_Java.md * fix annotation * Update SetupGuide_Javascript.md (#847) * Update SetupGuide_Javascript.md * fix toc * FIx perf pipeline (#838) * dont start func host in fixture for perf * don't use fixture in perf test * finally block * Update SetupGuide_PowerShell.md (#848) * Update SetupGuide_Python.md (#849) * enable test TriggerWithException (#801) * enable the TriggerWithException test * update comment * remove logger delegate * fix error * add retry * remove Java test and try --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Add additional check for closed/broken connection errors (#862) * add timestamp to global state table for lease table cleanup (#861) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test to check LastAccessTime column creation for existing triggers (#865) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test * fix test error * use constants * Merge latest from main into trigger (#866) * Fix the race condition by adding the extension reference to build first. (#839) * fix the correct path separator * add the extension ref to avoid race condition * format files * pack and copy the sql nupkg to local-packages after build (#853) * copy to local packages before build * AfterTargets since package is created after build * make sure pack runs after build * address comments * Remove doc/sample references to preview bundle (#744) * Remove doc/sample references to preview bundle * Few more * undo * Powershell -> PowerShell * fix version * use scriptdom nuget (#864) * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * Fix nuget package versioning --------- Co-authored-by: Maddy <12754347+MaddyDev@users.noreply.github.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * add troubleshooting information to the overview doc (#871) * add troubleshooting section * update format * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * clarifying view change tracking command (#873) * Add sql trigger test for different data types (#876) * add productcolumntypestriggertest * try running only csharp * try running js * comment out column values check temporarily * skip date and byte checks * fix build error * skip byte check * remove date/time, add back binary * fix build error * remove only binary check * remove only nchar and nvarchar * check equality of nchar and nvarchar * fix tests * change nchar to test * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Fix code coverage in trigger branch (#880) * run only csharp test task * comment out trigger tests * don't start func hosts in the beginning * start three functions in beginning * start only csharp host * fix build error * start both csharp and java hosts * start only csharp and oop hosts * add logging for disposefunctionhosts * start only csharp host * revert commented out code * add comment * Fix schema parse error when using reserved keys as table names (#881) * bracketed name for reserved words as table name * add test * add tests * fix csx test * enable test only for csharp * fix TableNotPresentTest * revert GetUserTableIdAsync change * refactor GetUserTableIdAsync * comment out Java test * refactor code to use SqlObject * Add LeasesTableName to SqlTriggerAttribute (#893) * addLeasesTableNameSetting to SqlTriggerAttribute * add provider test * add samples * remove setting * add new constructor * fix metrics provider * add integration test * fix oop * fix test * cleanup + pr comments * quote escape leasestablename * Add leasesTableName to SqlTrigger Java annotation (#897) * add leasestablename to java sqltrigger * add default value for commandtype * remove sample * update java library to 2.1.0-preview (#899) * Update docs with LeasesTableName (#898) * add leasestablename to docs * fix links * GetLeaseLockedRows for debug logging (#900) * add isLeaseLocked into the getchanges query * add log message * add debug logging for row counts * update log msg * create a separate query for getting the locked rows * update ver name * update * remove user table join * unused var * correct xml info * address comments * remove extra line * dont throw * Update src/TriggerBinding/SqlTableChangeMonitor.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * rename leasesTableName to bracketedLeasesTableName (#902) * rename leasesTableName to bracketedLeasesTableName * merge error * [Trigger] Sync with main (#906) * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Update GetProducts.js (#884) Corrected input model so it works * Bump word-wrap from 1.2.3 to 1.2.4 in /samples/samples-js (#885) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump word-wrap from 1.2.3 to 1.2.4 in /test/Integration/test-js (#886) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update dependencies (#887) * update all dependencies to latest versions * revert xunit package update * undo * test * restoreArguments * --no-restore * force-evaluate * noCache * revert xunit update * undo exception change * Update docs with details about output binding columns (#889) * update sdk and xunit (#890) * package lock updates * restore packages * merge conflicts * exclusing oop test for timeout issue * remove retrytheory * add oop * use TrySetResult * revert back to RetryTheory --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * undo logging deletes * uno default * update perf.yml --------- Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> Co-authored-by: AmeyaRele <35621237+AmeyaRele@users.noreply.github.com> Co-authored-by: Drew Skwiers-Koballa <dzsquared@users.noreply.github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 02:05:37 +03:00
- [Trigger Bindings](#trigger-bindings)
- [Telemetry](#telemetry)
- [Troubleshooting](#troubleshooting)
- [Privacy Statement](#privacy-statement)
- [Trademarks](#trademarks)
## Introduction
2021-09-02 21:41:43 +03:00
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:
2021-09-02 21:41:43 +03:00
- **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).
Merge release/trigger to main (#913) * Revert "Remove trigger binding for GA release (#732)" (#733) This reverts commit 78f48533b57c46da9c19230a256185dbb5d805bf. * vBump release/trigger 2.* -> 3.* (#738) * Add JObject support for SQL trigger (#722) * add support for jobject and js, ps, python samples * use utils JsonSerializeObject + comment * Update src/TriggerBinding/SqlTriggerBindingProvider.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * fix unit test + pylint --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix trigger connection not being retried when connection is closed (#731) * Add Privacy Statement to README and telemetry message (#751) * Add link to privacy statement * Add privacy link to output message * add to output message * Fix typos (cherry picked from commit 623118f3ea2dd58e5369bd627774224f9bc9594b) * enable trigger oop (#750) * add sqltrigger attribute * add SqlChange type * enable oop test * add check * fix the null reference * use GetLogger * Enable debug logging for Python and PS samples (#754) * enable debug logging for ps and python samples * enable debug logs for js samples * Add docs & logging information for Leases table info (#756) * Add ProductsTriggerWithValidation tests for Python, JS, PS (#753) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * Further clarifications to trigger retry docs (#770) * Further clarifications to trigger retry docs * Update description * increase timeout to 120 minutes (#776) * Enable more tests for OOP trigger (#777) * add more oop test samples * update logger * bump jackson dependency (#782) * Add detailed trigger docs (#780) * Filter out more default telemetry properties (cherry picked from commit d6ea6d79077fb6ac27fd0d32d1fb431fd9aae86e) * bring back trigger text * Fixes * Add SQLTrigger annotation to java library (#783) * add SQLTrigger annotation to java library * remove default values * use enum for commandtype * Disable CSX trigger tests * fix regex for java library version (#788) * Adding rest of Trigger integration tests for Python, PS, JS (#763) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * add tests * remove extra comments + powershell compress * update comment * Skip more trigger tests for CSX (#791) * Introduce Target Based Scaling (#598) * Refactor SqlTriggerListener scaling to SqlTriggerMetricsProvider and SqlTriggerScaleMonitor * Create SqlTriggerTargetScaler * Refactor unit tests * Refactor to include common queries for scaling and listener class to SqlTriggerUtils * Add doc comments for scaling classes * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix log statement * Update WebJobs package * Update nuget.config * Address review comments * Address review comments pt2 * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Address comments, test failures * Fix packages lock file * Fix error message * Address comments and test failures * Apply suggestions from code review Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Change in documentation * Fix log level --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Enable trace level logging for tests (#795) * Enable trace level logging for tests * one more * Add java trigger samples (#793) * add java trigger samples * update test-java * add SqlChangeProduct type * add rest of tests * fix polling interval test * Fix up performance tests & enable schedule (#799) * Minor trigger doc updates (#800) * Minor trigger doc updates * fix * enable rest of the trigger tests for oop (#798) * enable all trigger tests for OOP * undo * fix test * merge conflict * remove Java * add sample for python v2 model (#803) * Fix logs * fix compile * remove delegate (#809) Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> * add csx trigger samples (#806) * add trigger samples for csx * enable csx tests * add copy trigger sample * use utils.josnserialize * separate utils file * reuse utils from sql extension * remove deleted references * Cleanup trigger logging (#808) * Cleanup trigger logging * more * fix compile * Default log level of debug * Fix scale monitor tests * [Trigger] Update from main (#820) * update java library 0.1.1 -> 1.0.0 (#804) * Pin Node version to 18.15 (#818) * Pin Node version to 18.15 * Update build pipeline * Set node modules path for all * Debug * Pass in env var * Update pipeline comments (#819) --------- Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * [Trigger] Rename csharpscript and align host.json (#825) * Merge branch 'main' into release/trigger # Conflicts: # docs/SetupGuide_DotnetCSharpScript.md # samples/samples-csharp/host.json # test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj * Move triggers * Fix java version in setup guide (#821) * Refactor integration tests (#813) * create database once * fix compat level test * fix compat + logs * start func host in the beginning * fix change tracking * fix tests * fix tests * add CSharpscript and fix change tracking * set port * update xunit analyzers & temp skip failling tests * update port from fixture * pass console writeline as logger * enable identity tests * fix case sensitive tests + temp disable identity * fix indent * AddProductWithIdentityColumnIncluded fix * AddProductWithIdentityColumnIncluded * cleanup * remove extra fixture * default port * fix csx * Clean csx samples (#812) * sql attribute not needed * simplify the folder structure for csx * add local.settings.json * rename folders in proj file * clean up logs and unused * remove TriggerSamples folder * update trigger docs for csx * Fix compilation error (#835) * Add retry for Trigger tests (#836) * add retry logic * fix the csx compilation error * use xRetry * replace with RetryTheory * add diagnostic messages to logs * Update Trigger Binding set up in SetupGuide_DotnetOutOfProc.md (#845) * Update SetupGuide_DotnetOutOfProc.md * fixes * Update Trigger Binding set up in SetupGuide_Java.md (#846) * Update SetupGuide_Java.md * fix annotation * Update SetupGuide_Javascript.md (#847) * Update SetupGuide_Javascript.md * fix toc * FIx perf pipeline (#838) * dont start func host in fixture for perf * don't use fixture in perf test * finally block * Update SetupGuide_PowerShell.md (#848) * Update SetupGuide_Python.md (#849) * enable test TriggerWithException (#801) * enable the TriggerWithException test * update comment * remove logger delegate * fix error * add retry * remove Java test and try --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Add additional check for closed/broken connection errors (#862) * add timestamp to global state table for lease table cleanup (#861) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test to check LastAccessTime column creation for existing triggers (#865) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test * fix test error * use constants * Merge latest from main into trigger (#866) * Fix the race condition by adding the extension reference to build first. (#839) * fix the correct path separator * add the extension ref to avoid race condition * format files * pack and copy the sql nupkg to local-packages after build (#853) * copy to local packages before build * AfterTargets since package is created after build * make sure pack runs after build * address comments * Remove doc/sample references to preview bundle (#744) * Remove doc/sample references to preview bundle * Few more * undo * Powershell -> PowerShell * fix version * use scriptdom nuget (#864) * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * Fix nuget package versioning --------- Co-authored-by: Maddy <12754347+MaddyDev@users.noreply.github.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * add troubleshooting information to the overview doc (#871) * add troubleshooting section * update format * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * clarifying view change tracking command (#873) * Add sql trigger test for different data types (#876) * add productcolumntypestriggertest * try running only csharp * try running js * comment out column values check temporarily * skip date and byte checks * fix build error * skip byte check * remove date/time, add back binary * fix build error * remove only binary check * remove only nchar and nvarchar * check equality of nchar and nvarchar * fix tests * change nchar to test * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Fix code coverage in trigger branch (#880) * run only csharp test task * comment out trigger tests * don't start func hosts in the beginning * start three functions in beginning * start only csharp host * fix build error * start both csharp and java hosts * start only csharp and oop hosts * add logging for disposefunctionhosts * start only csharp host * revert commented out code * add comment * Fix schema parse error when using reserved keys as table names (#881) * bracketed name for reserved words as table name * add test * add tests * fix csx test * enable test only for csharp * fix TableNotPresentTest * revert GetUserTableIdAsync change * refactor GetUserTableIdAsync * comment out Java test * refactor code to use SqlObject * Add LeasesTableName to SqlTriggerAttribute (#893) * addLeasesTableNameSetting to SqlTriggerAttribute * add provider test * add samples * remove setting * add new constructor * fix metrics provider * add integration test * fix oop * fix test * cleanup + pr comments * quote escape leasestablename * Add leasesTableName to SqlTrigger Java annotation (#897) * add leasestablename to java sqltrigger * add default value for commandtype * remove sample * update java library to 2.1.0-preview (#899) * Update docs with LeasesTableName (#898) * add leasestablename to docs * fix links * GetLeaseLockedRows for debug logging (#900) * add isLeaseLocked into the getchanges query * add log message * add debug logging for row counts * update log msg * create a separate query for getting the locked rows * update ver name * update * remove user table join * unused var * correct xml info * address comments * remove extra line * dont throw * Update src/TriggerBinding/SqlTableChangeMonitor.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * rename leasesTableName to bracketedLeasesTableName (#902) * rename leasesTableName to bracketedLeasesTableName * merge error * [Trigger] Sync with main (#906) * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Update GetProducts.js (#884) Corrected input model so it works * Bump word-wrap from 1.2.3 to 1.2.4 in /samples/samples-js (#885) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump word-wrap from 1.2.3 to 1.2.4 in /test/Integration/test-js (#886) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update dependencies (#887) * update all dependencies to latest versions * revert xunit package update * undo * test * restoreArguments * --no-restore * force-evaluate * noCache * revert xunit update * undo exception change * Update docs with details about output binding columns (#889) * update sdk and xunit (#890) * package lock updates * restore packages * merge conflicts * exclusing oop test for timeout issue * remove retrytheory * add oop * use TrySetResult * revert back to RetryTheory --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * undo logging deletes * uno default * update perf.yml --------- Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> Co-authored-by: AmeyaRele <35621237+AmeyaRele@users.noreply.github.com> Co-authored-by: Drew Skwiers-Koballa <dzsquared@users.noreply.github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 02:05:37 +03:00
- **Trigger Binding**: monitors the user table for changes (i.e., row inserts, updates, and deletes) and invokes the function with updated rows.
2022-12-06 23:36:38 +03:00
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).
For further details on setup, usage and samples of the bindings see the language-specific guides below:
2022-12-06 23:36:38 +03:00
- [.NET (C# in-process)](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Dotnet.md)
- [.NET (C# out-of-proc)](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_DotnetOutOfProc.md)
- [Java](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Java.md)
- [Javascript](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Javascript.md)
- [PowerShell](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_PowerShell.md)
- [Python](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/SetupGuide_Python.md)
2021-09-02 21:41:43 +03:00
Further information on the Azure SQL binding for Azure Functions is also available in the [docs](https://aka.ms/sqlbindings).
## Supported SQL Server Versions
This extension uses the [OPENJSON](https://learn.microsoft.com/sql/t-sql/functions/openjson-transact-sql) 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](https://learn.microsoft.com/sql/relational-databases/databases/view-or-change-the-compatibility-level-of-a-database) 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
2023-02-08 00:33:31 +03:00
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.
Merge release/trigger to main (#913) * Revert "Remove trigger binding for GA release (#732)" (#733) This reverts commit 78f48533b57c46da9c19230a256185dbb5d805bf. * vBump release/trigger 2.* -> 3.* (#738) * Add JObject support for SQL trigger (#722) * add support for jobject and js, ps, python samples * use utils JsonSerializeObject + comment * Update src/TriggerBinding/SqlTriggerBindingProvider.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * fix unit test + pylint --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix trigger connection not being retried when connection is closed (#731) * Add Privacy Statement to README and telemetry message (#751) * Add link to privacy statement * Add privacy link to output message * add to output message * Fix typos (cherry picked from commit 623118f3ea2dd58e5369bd627774224f9bc9594b) * enable trigger oop (#750) * add sqltrigger attribute * add SqlChange type * enable oop test * add check * fix the null reference * use GetLogger * Enable debug logging for Python and PS samples (#754) * enable debug logging for ps and python samples * enable debug logs for js samples * Add docs & logging information for Leases table info (#756) * Add ProductsTriggerWithValidation tests for Python, JS, PS (#753) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * Further clarifications to trigger retry docs (#770) * Further clarifications to trigger retry docs * Update description * increase timeout to 120 minutes (#776) * Enable more tests for OOP trigger (#777) * add more oop test samples * update logger * bump jackson dependency (#782) * Add detailed trigger docs (#780) * Filter out more default telemetry properties (cherry picked from commit d6ea6d79077fb6ac27fd0d32d1fb431fd9aae86e) * bring back trigger text * Fixes * Add SQLTrigger annotation to java library (#783) * add SQLTrigger annotation to java library * remove default values * use enum for commandtype * Disable CSX trigger tests * fix regex for java library version (#788) * Adding rest of Trigger integration tests for Python, PS, JS (#763) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * add tests * remove extra comments + powershell compress * update comment * Skip more trigger tests for CSX (#791) * Introduce Target Based Scaling (#598) * Refactor SqlTriggerListener scaling to SqlTriggerMetricsProvider and SqlTriggerScaleMonitor * Create SqlTriggerTargetScaler * Refactor unit tests * Refactor to include common queries for scaling and listener class to SqlTriggerUtils * Add doc comments for scaling classes * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix log statement * Update WebJobs package * Update nuget.config * Address review comments * Address review comments pt2 * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Address comments, test failures * Fix packages lock file * Fix error message * Address comments and test failures * Apply suggestions from code review Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Change in documentation * Fix log level --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Enable trace level logging for tests (#795) * Enable trace level logging for tests * one more * Add java trigger samples (#793) * add java trigger samples * update test-java * add SqlChangeProduct type * add rest of tests * fix polling interval test * Fix up performance tests & enable schedule (#799) * Minor trigger doc updates (#800) * Minor trigger doc updates * fix * enable rest of the trigger tests for oop (#798) * enable all trigger tests for OOP * undo * fix test * merge conflict * remove Java * add sample for python v2 model (#803) * Fix logs * fix compile * remove delegate (#809) Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> * add csx trigger samples (#806) * add trigger samples for csx * enable csx tests * add copy trigger sample * use utils.josnserialize * separate utils file * reuse utils from sql extension * remove deleted references * Cleanup trigger logging (#808) * Cleanup trigger logging * more * fix compile * Default log level of debug * Fix scale monitor tests * [Trigger] Update from main (#820) * update java library 0.1.1 -> 1.0.0 (#804) * Pin Node version to 18.15 (#818) * Pin Node version to 18.15 * Update build pipeline * Set node modules path for all * Debug * Pass in env var * Update pipeline comments (#819) --------- Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * [Trigger] Rename csharpscript and align host.json (#825) * Merge branch 'main' into release/trigger # Conflicts: # docs/SetupGuide_DotnetCSharpScript.md # samples/samples-csharp/host.json # test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj * Move triggers * Fix java version in setup guide (#821) * Refactor integration tests (#813) * create database once * fix compat level test * fix compat + logs * start func host in the beginning * fix change tracking * fix tests * fix tests * add CSharpscript and fix change tracking * set port * update xunit analyzers & temp skip failling tests * update port from fixture * pass console writeline as logger * enable identity tests * fix case sensitive tests + temp disable identity * fix indent * AddProductWithIdentityColumnIncluded fix * AddProductWithIdentityColumnIncluded * cleanup * remove extra fixture * default port * fix csx * Clean csx samples (#812) * sql attribute not needed * simplify the folder structure for csx * add local.settings.json * rename folders in proj file * clean up logs and unused * remove TriggerSamples folder * update trigger docs for csx * Fix compilation error (#835) * Add retry for Trigger tests (#836) * add retry logic * fix the csx compilation error * use xRetry * replace with RetryTheory * add diagnostic messages to logs * Update Trigger Binding set up in SetupGuide_DotnetOutOfProc.md (#845) * Update SetupGuide_DotnetOutOfProc.md * fixes * Update Trigger Binding set up in SetupGuide_Java.md (#846) * Update SetupGuide_Java.md * fix annotation * Update SetupGuide_Javascript.md (#847) * Update SetupGuide_Javascript.md * fix toc * FIx perf pipeline (#838) * dont start func host in fixture for perf * don't use fixture in perf test * finally block * Update SetupGuide_PowerShell.md (#848) * Update SetupGuide_Python.md (#849) * enable test TriggerWithException (#801) * enable the TriggerWithException test * update comment * remove logger delegate * fix error * add retry * remove Java test and try --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Add additional check for closed/broken connection errors (#862) * add timestamp to global state table for lease table cleanup (#861) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test to check LastAccessTime column creation for existing triggers (#865) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test * fix test error * use constants * Merge latest from main into trigger (#866) * Fix the race condition by adding the extension reference to build first. (#839) * fix the correct path separator * add the extension ref to avoid race condition * format files * pack and copy the sql nupkg to local-packages after build (#853) * copy to local packages before build * AfterTargets since package is created after build * make sure pack runs after build * address comments * Remove doc/sample references to preview bundle (#744) * Remove doc/sample references to preview bundle * Few more * undo * Powershell -> PowerShell * fix version * use scriptdom nuget (#864) * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * Fix nuget package versioning --------- Co-authored-by: Maddy <12754347+MaddyDev@users.noreply.github.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * add troubleshooting information to the overview doc (#871) * add troubleshooting section * update format * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * clarifying view change tracking command (#873) * Add sql trigger test for different data types (#876) * add productcolumntypestriggertest * try running only csharp * try running js * comment out column values check temporarily * skip date and byte checks * fix build error * skip byte check * remove date/time, add back binary * fix build error * remove only binary check * remove only nchar and nvarchar * check equality of nchar and nvarchar * fix tests * change nchar to test * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Fix code coverage in trigger branch (#880) * run only csharp test task * comment out trigger tests * don't start func hosts in the beginning * start three functions in beginning * start only csharp host * fix build error * start both csharp and java hosts * start only csharp and oop hosts * add logging for disposefunctionhosts * start only csharp host * revert commented out code * add comment * Fix schema parse error when using reserved keys as table names (#881) * bracketed name for reserved words as table name * add test * add tests * fix csx test * enable test only for csharp * fix TableNotPresentTest * revert GetUserTableIdAsync change * refactor GetUserTableIdAsync * comment out Java test * refactor code to use SqlObject * Add LeasesTableName to SqlTriggerAttribute (#893) * addLeasesTableNameSetting to SqlTriggerAttribute * add provider test * add samples * remove setting * add new constructor * fix metrics provider * add integration test * fix oop * fix test * cleanup + pr comments * quote escape leasestablename * Add leasesTableName to SqlTrigger Java annotation (#897) * add leasestablename to java sqltrigger * add default value for commandtype * remove sample * update java library to 2.1.0-preview (#899) * Update docs with LeasesTableName (#898) * add leasestablename to docs * fix links * GetLeaseLockedRows for debug logging (#900) * add isLeaseLocked into the getchanges query * add log message * add debug logging for row counts * update log msg * create a separate query for getting the locked rows * update ver name * update * remove user table join * unused var * correct xml info * address comments * remove extra line * dont throw * Update src/TriggerBinding/SqlTableChangeMonitor.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * rename leasesTableName to bracketedLeasesTableName (#902) * rename leasesTableName to bracketedLeasesTableName * merge error * [Trigger] Sync with main (#906) * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Update GetProducts.js (#884) Corrected input model so it works * Bump word-wrap from 1.2.3 to 1.2.4 in /samples/samples-js (#885) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump word-wrap from 1.2.3 to 1.2.4 in /test/Integration/test-js (#886) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update dependencies (#887) * update all dependencies to latest versions * revert xunit package update * undo * test * restoreArguments * --no-restore * force-evaluate * noCache * revert xunit update * undo exception change * Update docs with details about output binding columns (#889) * update sdk and xunit (#890) * package lock updates * restore packages * merge conflicts * exclusing oop test for timeout issue * remove retrytheory * add oop * use TrySetResult * revert back to RetryTheory --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * undo logging deletes * uno default * update perf.yml --------- Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> Co-authored-by: AmeyaRele <35621237+AmeyaRele@users.noreply.github.com> Co-authored-by: Drew Skwiers-Koballa <dzsquared@users.noreply.github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 02:05:37 +03:00
- **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 `BINARY` or `VARBINARY` need 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 `GEOMETRY` and `GEOGRAPHY` are not supported. Issue is tracked [here](https://github.com/Azure/azure-functions-sql-extension/issues/654).
- Issues resulting from upstream dependencies can be found [here](https://github.com/Azure/azure-functions-sql-extension/issues?q=is%3Aopen+is%3Aissue+label%3Aupstream).
### Output Bindings
2023-02-08 00:33:31 +03:00
- **By Design:** 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.
- **By Design:** .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.
- **By Design:** 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.
Some options for working around this :
2023-02-08 00:33:31 +03:00
- Have multiple functions, with dependent functions being triggered by the initial functions (through a trigger binding or other such method)
- Use [dynamic (imperative)](https://learn.microsoft.com/azure/azure-functions/functions-bindings-expressions-patterns#binding-at-runtime) bindings (.NET only)
- 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)
- **By Design:** Output bindings require that their payloads contain ALL columns defined in every execution, even optional ones. See [BindingsOverview.md#output-binding-columns](https://github.com/Azure/azure-functions-sql-extension/blob/main/docs/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](https://github.com/Azure/azure-functions-sql-extension/blob/main/samples/samples-powershell/AddProductsWithIdentityColumnArray/run.ps1).
- **Planned for Future Support:** Java, PowerShell, and Python Functions using Output bindings cannot pass in null or empty values via the query string.
2023-01-19 05:01:56 +03:00
- Java: Issue is tracked [here](https://github.com/Azure/azure-functions-java-worker/issues/683).
- 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).
- 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).
Merge release/trigger to main (#913) * Revert "Remove trigger binding for GA release (#732)" (#733) This reverts commit 78f48533b57c46da9c19230a256185dbb5d805bf. * vBump release/trigger 2.* -> 3.* (#738) * Add JObject support for SQL trigger (#722) * add support for jobject and js, ps, python samples * use utils JsonSerializeObject + comment * Update src/TriggerBinding/SqlTriggerBindingProvider.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * fix unit test + pylint --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix trigger connection not being retried when connection is closed (#731) * Add Privacy Statement to README and telemetry message (#751) * Add link to privacy statement * Add privacy link to output message * add to output message * Fix typos (cherry picked from commit 623118f3ea2dd58e5369bd627774224f9bc9594b) * enable trigger oop (#750) * add sqltrigger attribute * add SqlChange type * enable oop test * add check * fix the null reference * use GetLogger * Enable debug logging for Python and PS samples (#754) * enable debug logging for ps and python samples * enable debug logs for js samples * Add docs & logging information for Leases table info (#756) * Add ProductsTriggerWithValidation tests for Python, JS, PS (#753) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * Further clarifications to trigger retry docs (#770) * Further clarifications to trigger retry docs * Update description * increase timeout to 120 minutes (#776) * Enable more tests for OOP trigger (#777) * add more oop test samples * update logger * bump jackson dependency (#782) * Add detailed trigger docs (#780) * Filter out more default telemetry properties (cherry picked from commit d6ea6d79077fb6ac27fd0d32d1fb431fd9aae86e) * bring back trigger text * Fixes * Add SQLTrigger annotation to java library (#783) * add SQLTrigger annotation to java library * remove default values * use enum for commandtype * Disable CSX trigger tests * fix regex for java library version (#788) * Adding rest of Trigger integration tests for Python, PS, JS (#763) * add js, py, ps ProductsTriggerWithValidation test * fix test + missing file * add tests * remove extra comments + powershell compress * update comment * Skip more trigger tests for CSX (#791) * Introduce Target Based Scaling (#598) * Refactor SqlTriggerListener scaling to SqlTriggerMetricsProvider and SqlTriggerScaleMonitor * Create SqlTriggerTargetScaler * Refactor unit tests * Refactor to include common queries for scaling and listener class to SqlTriggerUtils * Add doc comments for scaling classes * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Fix log statement * Update WebJobs package * Update nuget.config * Address review comments * Address review comments pt2 * Update src/TriggerBinding/SqlTriggerTargetScaler.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Address comments, test failures * Fix packages lock file * Fix error message * Address comments and test failures * Apply suggestions from code review Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Change in documentation * Fix log level --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Enable trace level logging for tests (#795) * Enable trace level logging for tests * one more * Add java trigger samples (#793) * add java trigger samples * update test-java * add SqlChangeProduct type * add rest of tests * fix polling interval test * Fix up performance tests & enable schedule (#799) * Minor trigger doc updates (#800) * Minor trigger doc updates * fix * enable rest of the trigger tests for oop (#798) * enable all trigger tests for OOP * undo * fix test * merge conflict * remove Java * add sample for python v2 model (#803) * Fix logs * fix compile * remove delegate (#809) Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> * add csx trigger samples (#806) * add trigger samples for csx * enable csx tests * add copy trigger sample * use utils.josnserialize * separate utils file * reuse utils from sql extension * remove deleted references * Cleanup trigger logging (#808) * Cleanup trigger logging * more * fix compile * Default log level of debug * Fix scale monitor tests * [Trigger] Update from main (#820) * update java library 0.1.1 -> 1.0.0 (#804) * Pin Node version to 18.15 (#818) * Pin Node version to 18.15 * Update build pipeline * Set node modules path for all * Debug * Pass in env var * Update pipeline comments (#819) --------- Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * [Trigger] Rename csharpscript and align host.json (#825) * Merge branch 'main' into release/trigger # Conflicts: # docs/SetupGuide_DotnetCSharpScript.md # samples/samples-csharp/host.json # test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj * Move triggers * Fix java version in setup guide (#821) * Refactor integration tests (#813) * create database once * fix compat level test * fix compat + logs * start func host in the beginning * fix change tracking * fix tests * fix tests * add CSharpscript and fix change tracking * set port * update xunit analyzers & temp skip failling tests * update port from fixture * pass console writeline as logger * enable identity tests * fix case sensitive tests + temp disable identity * fix indent * AddProductWithIdentityColumnIncluded fix * AddProductWithIdentityColumnIncluded * cleanup * remove extra fixture * default port * fix csx * Clean csx samples (#812) * sql attribute not needed * simplify the folder structure for csx * add local.settings.json * rename folders in proj file * clean up logs and unused * remove TriggerSamples folder * update trigger docs for csx * Fix compilation error (#835) * Add retry for Trigger tests (#836) * add retry logic * fix the csx compilation error * use xRetry * replace with RetryTheory * add diagnostic messages to logs * Update Trigger Binding set up in SetupGuide_DotnetOutOfProc.md (#845) * Update SetupGuide_DotnetOutOfProc.md * fixes * Update Trigger Binding set up in SetupGuide_Java.md (#846) * Update SetupGuide_Java.md * fix annotation * Update SetupGuide_Javascript.md (#847) * Update SetupGuide_Javascript.md * fix toc * FIx perf pipeline (#838) * dont start func host in fixture for perf * don't use fixture in perf test * finally block * Update SetupGuide_PowerShell.md (#848) * Update SetupGuide_Python.md (#849) * enable test TriggerWithException (#801) * enable the TriggerWithException test * update comment * remove logger delegate * fix error * add retry * remove Java test and try --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Add additional check for closed/broken connection errors (#862) * add timestamp to global state table for lease table cleanup (#861) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test to check LastAccessTime column creation for existing triggers (#865) * add LastAccessTime column to GlobalState * update docs with clean up scripts * update createtable * add comments * refine comments * fix script error * add print * add test * fix test error * use constants * Merge latest from main into trigger (#866) * Fix the race condition by adding the extension reference to build first. (#839) * fix the correct path separator * add the extension ref to avoid race condition * format files * pack and copy the sql nupkg to local-packages after build (#853) * copy to local packages before build * AfterTargets since package is created after build * make sure pack runs after build * address comments * Remove doc/sample references to preview bundle (#744) * Remove doc/sample references to preview bundle * Few more * undo * Powershell -> PowerShell * fix version * use scriptdom nuget (#864) * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * Fix nuget package versioning --------- Co-authored-by: Maddy <12754347+MaddyDev@users.noreply.github.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> * Revert "Remove doc/sample references to preview bundle (#744)" This reverts commit b21fc0bb325110943412d5d20a34b2af299b5b86. * add troubleshooting information to the overview doc (#871) * add troubleshooting section * update format * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Update docs/BindingsOverview.md Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * clarifying view change tracking command (#873) * Add sql trigger test for different data types (#876) * add productcolumntypestriggertest * try running only csharp * try running js * comment out column values check temporarily * skip date and byte checks * fix build error * skip byte check * remove date/time, add back binary * fix build error * remove only binary check * remove only nchar and nvarchar * check equality of nchar and nvarchar * fix tests * change nchar to test * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Fix code coverage in trigger branch (#880) * run only csharp test task * comment out trigger tests * don't start func hosts in the beginning * start three functions in beginning * start only csharp host * fix build error * start both csharp and java hosts * start only csharp and oop hosts * add logging for disposefunctionhosts * start only csharp host * revert commented out code * add comment * Fix schema parse error when using reserved keys as table names (#881) * bracketed name for reserved words as table name * add test * add tests * fix csx test * enable test only for csharp * fix TableNotPresentTest * revert GetUserTableIdAsync change * refactor GetUserTableIdAsync * comment out Java test * refactor code to use SqlObject * Add LeasesTableName to SqlTriggerAttribute (#893) * addLeasesTableNameSetting to SqlTriggerAttribute * add provider test * add samples * remove setting * add new constructor * fix metrics provider * add integration test * fix oop * fix test * cleanup + pr comments * quote escape leasestablename * Add leasesTableName to SqlTrigger Java annotation (#897) * add leasestablename to java sqltrigger * add default value for commandtype * remove sample * update java library to 2.1.0-preview (#899) * Update docs with LeasesTableName (#898) * add leasestablename to docs * fix links * GetLeaseLockedRows for debug logging (#900) * add isLeaseLocked into the getchanges query * add log message * add debug logging for row counts * update log msg * create a separate query for getting the locked rows * update ver name * update * remove user table join * unused var * correct xml info * address comments * remove extra line * dont throw * Update src/TriggerBinding/SqlTableChangeMonitor.cs Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * rename leasesTableName to bracketedLeasesTableName (#902) * rename leasesTableName to bracketedLeasesTableName * merge error * [Trigger] Sync with main (#906) * Bump Version of Grpc.Net.Client (#877) * Bump version of Grpc.Net.Client * Bump grpc.net.client to latest * Update packages.lock * Add to Directory.Packages.props * Update GetProducts.js (#884) Corrected input model so it works * Bump word-wrap from 1.2.3 to 1.2.4 in /samples/samples-js (#885) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump word-wrap from 1.2.3 to 1.2.4 in /test/Integration/test-js (#886) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update dependencies (#887) * update all dependencies to latest versions * revert xunit package update * undo * test * restoreArguments * --no-restore * force-evaluate * noCache * revert xunit update * undo exception change * Update docs with details about output binding columns (#889) * update sdk and xunit (#890) * package lock updates * restore packages * merge conflicts * exclusing oop test for timeout issue * remove retrytheory * add oop * use TrySetResult * revert back to RetryTheory --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * undo logging deletes * uno default * update perf.yml --------- Signed-off-by: Maddy Koripalli <makoripa@microsoft.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> Co-authored-by: Lucy Zhang <luczhan@microsoft.com> Co-authored-by: AmeyaRele <35621237+AmeyaRele@users.noreply.github.com> Co-authored-by: Drew Skwiers-Koballa <dzsquared@users.noreply.github.com> Co-authored-by: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Co-authored-by: Taigh Hawkins <taigh.hawkins@cloud-trade.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 02:05:37 +03:00
### Trigger Bindings
- **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.
## Telemetry
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';
## Troubleshooting
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
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](https://learn.microsoft.com/azure/azure-functions/streaming-logs?tabs=azure-portal) or in [Application Insights](https://learn.microsoft.com/azure/azure-functions/analyze-telemetry-data#view-telemetry-in-application-insights). More information on logging can be found [here](https://learn.microsoft.com/azure/azure-functions/functions-monitoring).
## Privacy Statement
To learn more about our Privacy Statement visit [this link](https://go.microsoft.com/fwlink/?LinkID=824704).
## Trademarks
2021-09-02 21:41:43 +03:00
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 [Microsofts Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). 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-partys policies.