Skip to content

Commit c86e154

Browse files
Minor trigger doc updates (#800)
* Minor trigger doc updates * fix
1 parent 50fb7c3 commit c86e154

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

docs/BindingsOverview.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ Azure SQL Trigger bindings utilize SQL [change tracking](https://docs.microsoft.
8686
(CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON);
8787
```
8888

89-
The `CHANGE_RETENTION` option specifies the duration for which the changes are retained in the change tracking table. This may affect the trigger functionality. For example, if the user application is turned off for several days and then resumed, it will only be able to catch the changes that occurred in past two days with the above query. Hence, please update the value of `CHANGE_RETENTION` to suit your requirements. The `AUTO_CLEANUP` option is used to enable or disable the clean-up task that removes the stale data. Please refer to SQL Server documentation [here](https://docs.microsoft.com/sql/relational-databases/track-changes/enable-and-disable-change-tracking-sql-server#enable-change-tracking-for-a-database) for more information.
89+
The `CHANGE_RETENTION` option specifies the duration for which the changes are retained in the change tracking table. This may affect the trigger functionality. For example, if the user application is turned off for several days and then resumed, the database will contain the changes that occurred in past two days in the above setup example. Hence, please update the value of `CHANGE_RETENTION` to suit your requirements.
90+
91+
The `AUTO_CLEANUP` option is used to enable or disable the clean-up task that removes the stale data. Please refer to SQL Server documentation [here](https://docs.microsoft.com/sql/relational-databases/track-changes/enable-and-disable-change-tracking-sql-server#enable-change-tracking-for-a-database) for more information.
9092

9193
1. Enabling change tracking on the SQL table:
9294

@@ -95,7 +97,7 @@ Azure SQL Trigger bindings utilize SQL [change tracking](https://docs.microsoft.
9597
ENABLE CHANGE_TRACKING;
9698
```
9799

98-
For more information, please refer to the documentation [here](https://docs.microsoft.com/sql/relational-databases/track-changes/enable-and-disable-change-tracking-sql-server#enable-change-tracking-for-a-table). The trigger needs to have read access on the table being monitored for changes as well as to the change tracking system tables. It also needs write access to an `az_func` schema within the database, where it will create additional leases tables to store the trigger states and leases. Each function trigger will thus have an associated change tracking table and leases table.
100+
For more information, please refer to the documentation [here](https://docs.microsoft.com/sql/relational-databases/track-changes/enable-and-disable-change-tracking-sql-server#enable-change-tracking-for-a-table). The trigger needs to have read access on the table being monitored for changes as well as to the change tracking system tables. It also needs write access to an `az_func` schema within the database, where it will create additional leases tables to store the trigger states and leases. Each function trigger has an associated change tracking table and leases table.
99101

100102
> **NOTE:** The leases table contains all columns corresponding to the primary key from the user table and three additional columns named `_az_func_ChangeVersion`, `_az_func_AttemptCount` and `_az_func_LeaseExpirationTime`. If any of the primary key columns happen to have the same name, that will result in an error message listing any conflicts. In this case, the listed primary key columns must be renamed for the trigger to work.
101103

@@ -105,15 +107,15 @@ This section goes over some of the configuration values you can use to customize
105107

106108
#### Sql_Trigger_MaxBatchSize
107109

108-
This controls the maximum number of changes sent to the function during each iteration of the change processing loop.
110+
The maximum number of changes sent to the function during each iteration of the change processing loop.
109111

110112
#### Sql_Trigger_PollingIntervalMs
111113

112-
This controls the delay in milliseconds between processing each batch of changes.
114+
The delay in milliseconds between processing each batch of changes.
113115

114116
#### Sql_Trigger_MaxChangesPerWorker
115117

116-
This controls the upper limit on the number of pending changes in the user table that are allowed per application-worker. If the count of changes exceeds this limit, it may result in a scale out. The setting only applies for Azure Function Apps with runtime driven scaling enabled. See the [Scaling](#scaling-for-trigger-bindings) section for more information.
118+
The upper limit on the number of pending changes in the user table that are allowed per application-worker. If the count of changes exceeds this limit, it may result in a scale out. The setting only applies for Azure Function Apps with runtime driven scaling enabled. See the [Scaling](#scaling-for-trigger-bindings) section for more information.
117119

118120
### Scaling for Trigger Bindings
119121

@@ -127,7 +129,6 @@ There are two types of scaling available:
127129
128130
For more information, check documentation on [Runtime Scaling](https://learn.microsoft.com/azure/azure-functions/event-driven-scaling#runtime-scaling). You can configure scaling parameters by going to 'Scale out (App Service plan)' setting on the function app's page. To understand various scale settings, please check the respective sections in [Azure Functions Premium plan](https://learn.microsoft.com/azure/azure-functions/functions-premium-plan?tabs=portal#eliminate-cold-starts)'s documentation.
129131

130-
131132
### Retry support for Trigger Bindings
132133

133134
#### Startup retries

docs/TriggerBinding.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ G --> E
3030
E --> H
3131
```
3232

33-
Changes will always be processed in the order that their changes were made, with the oldest changes being processed first. A couple notes about this :
33+
Changes are processed in the order that they were made, with the oldest changes being processed first. A couple notes about change processing:
3434

35-
1. If changes to multiple rows are made at once the exact order that they'll be sent to the function is based on the order returned by the CHANGETABLE function
36-
2. Changes are "batched" together for a row - if multiple changes are made to a row between each iteration of the loop than only a single change entry will exist for that row that shows the difference between the last processed state and the current state
37-
3. If changes are made to a set of rows, and then another set of changes are made to half of those same rows then the half that wasn't changed a second time will be processed first. This is due to the above note with the changes being batched - the trigger will only see the "last" change made and use that for the order it processes them in
35+
1. If changes to multiple rows are made at once the exact order that they are sent to the function is based on the order returned by the CHANGETABLE function
36+
2. Changes are "batched" together for a row. If multiple changes are made to a row between each iteration of the loop then only a single change entry exists for that row which will show the difference between the last processed state and the current state
37+
3. If changes are made to a set of rows, and then another set of changes are made to half of those same rows, then the half of the rows that weren't changed a second time are processed first. This processing logic is due to the above note with the changes being batched - the trigger will only see the "last" change made and use that for the order it processes them in
3838

39-
See [Work with change tracking](https://learn.microsoft.com/sql/relational-databases/track-changes/work-with-change-tracking-sql-server) for more information on change tracking and how it is used by applications such as Azure SQL triggers.
39+
For more information on change tracking and how it's used by applications such as Azure SQL triggers, see [Work with change tracking](https://learn.microsoft.com/sql/relational-databases/track-changes/work-with-change-tracking-sql-server).
4040

4141
#### Getting changed rows
4242

0 commit comments

Comments
 (0)