Skip to content

Commit d77979f

Browse files
authored
Update docs with LeasesTableName (#898)
* add leasestablename to docs * fix links
1 parent 89ab16d commit d77979f

11 files changed

+17
-10
lines changed

Worker.Extensions.Sql/src/SqlTriggerAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public SqlTriggerAttribute(string tableName, string connectionStringSetting) : t
4242
/// Name of the table used to store leases.
4343
/// If not specified, the leases table name will be Leases_{FunctionId}_{TableId}
4444
/// More information on how this is generated can be found here
45-
/// https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleases_
45+
/// https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename
4646
/// </summary>
4747
public string LeasesTableName { get; }
4848
}

docs/BindingsOverview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ If an exception occurs in the user function when processing changes then the bat
149149

150150
If the function execution fails 5 times in a row for a given row then that row is completely ignored for all future changes. Because the rows in a batch are not deterministic, rows in a failed batch may end up in different batches in subsequent invocations. This means that not all rows in the failed batch will necessarily be ignored. If other rows in the batch were the ones causing the exception, the "good" rows may end up in a different batch that doesn't fail in future invocations.
151151
152-
You can run this query to see what rows have failed 5 times and are currently ignored, see [Leases table](./TriggerBinding.md#az_funcleases_) documentation for how to get the correct Leases table to query for your function.
152+
You can run this query to see what rows have failed 5 times and are currently ignored, see [Leases table](./TriggerBinding.md#az_funcleasestablename) documentation for how to get the correct Leases table to query for your function.
153153
154154
```sql
155155
SELECT * FROM [az_func].[Leases_<FunctionId>_<TableId>] WHERE _az_func_AttemptCount = 5
@@ -173,7 +173,7 @@ UPDATE [Products].[az_func].[Leases_<FunctionId>_<TableId>] SET _az_func_Attempt
173173
174174
#### Lease Tables clean up
175175
176-
Before clean up, please see [Leases table](./TriggerBinding.md#az_funcleases_) documentation for understanding how they are created and used.
176+
Before clean up, please see [Leases table](./TriggerBinding.md#az_funcleasestablename) documentation for understanding how they are created and used.
177177
178178
Why clean up?
179179
1. You renamed your function/class/method name, which causes a new lease table to be created and the old one to be obsolete.

docs/SetupGuide_Dotnet.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,11 @@ See [Trigger Binding Overview](./BindingsOverview.md#trigger-binding) for genera
404404
405405
### SqlTriggerAttribute
406406
407-
The SqlAttribute for Trigger bindings takes two [arguments](https://github.com/Azure/azure-functions-sql-extension/blob/main/src/TriggerBinding/SqlTriggerAttribute.cs)
407+
The SqlAttribute for Trigger bindings takes three [arguments](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/src/TriggerBinding/SqlTriggerAttribute.cs)
408408
409409
- **TableName**: Represents the name of the table to be monitored for changes.
410410
- **ConnectionStringSetting**: Specifies the name of the app setting that contains the SQL connection string used to connect to a database. The connection string must follow the format specified [here](https://docs.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlconnection.connectionstring?view=sqlclient-dotnet-core-2.0).
411+
- **LeasesTableName**: Optional. Name of the table used to store leases. If not specified, the leases table name will be Leases_{FunctionId}_{TableId}. More information on how this is generated can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename).
411412
412413
The trigger binding can bind to type `IReadOnlyList<SqlChange<T>>`:
413414

docs/SetupGuide_DotnetCSharpScript.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ The following table explains the binding configuration properties that you set i
245245
|**name** | Required. The name of the variable that represents the set of changes that triggered the function code. Must be set to `changes`. |
246246
| **tableName** | Required. The name of the table to be monitored for changes. |
247247
| **connectionStringSetting** | Required. The name of an app setting that contains the SQL connection string used to connect to a database. The connection string must follow the format specified [here](https://docs.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlconnection.connectionstring?view=sqlclient-dotnet-core-2.0). |
248+
| **leasesTableName** | Optional. The name of the table used to store leases. If not specified, the leases table name will be Leases_{FunctionId}_{TableId}. More information on how this is generated can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename).|
248249

249250
### Setup for Trigger Bindings
250251

docs/SetupGuide_DotnetOutOfProc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ The SqlAttribute for Trigger bindings takes two [arguments](https://github.com/A
362362
363363
- **TableName**: Represents the name of the table to be monitored for changes.
364364
- **ConnectionStringSetting**: Specifies the name of the app setting that contains the SQL connection string used to connect to a database. The connection string must follow the format specified [here](https://docs.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlconnection.connectionstring?view=sqlclient-dotnet-core-2.0).
365+
- **LeasesTableName**: Optional. Name of the table used to store leases. If not specified, the leases table name will be Leases_{FunctionId}_{TableId}. More information on how this is generated can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename).
365366
366367
The trigger binding can bind to type `IReadOnlyList<SqlChange<T>>`:
367368

docs/SetupGuide_Java.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ In the Java functions runtime library, use the @SQLTrigger annotation (com.micro
439439
| **name** | Required. The name of the parameter that the trigger binds to. |
440440
| **tableName** | Required. The name of the table monitored by the trigger. |
441441
| **connectionStringSetting** | Required. The name of an app setting that contains the connection string for the database containing the table monitored for changes. This isn't the actual connection string and must instead resolve to an environment variable. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](https://aka.ms/sqlbindings#sql-connection-string). |
442+
| **leasesTableName** | Optional. The name of the table used to store leases. If not specified, the leases table name will be Leases_{FunctionId}_{TableId}. More information on how this is generated can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename).|
442443
443444
When you're developing locally, add your application settings in the local.settings.json file in the Values collection.
444445
### Setup for Trigger Bindings

docs/SetupGuide_Javascript.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ The following table explains the binding configuration properties that you set i
219219
| **name** | Required. The name of the parameter that the trigger binds to. |
220220
| **type** | Required. Must be set to `sqlTrigger`.|
221221
| **direction** | Required. Must be set to `in`. |
222-
| **commandText** | Required. The name of the table being monitored by the trigger. |
222+
| **tableName** | Required. The name of the table being monitored by the trigger. |
223223
| **connectionStringSetting** | Required. The name of an app setting that contains the connection string for the database containing the table monitored for changes. This isn't the actual connection string and must instead resolve to an environment variable. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](https://aka.ms/sqlbindings#sql-connection-string). |
224+
| **leasesTableName** | Optional. The name of the table used to store leases. If not specified, the leases table name will be Leases_{FunctionId}_{TableId}. More information on how this is generated can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename).|
224225

225226
### Setup for Trigger Bindings
226227

docs/SetupGuide_PowerShell.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ The following table explains the binding configuration properties that you set i
229229
| **name** | Required. The name of the parameter that the trigger binds to. |
230230
| **type** | Required. Must be set to `sqlTrigger`.|
231231
| **direction** | Required. Must be set to `in`. |
232-
| **commandText** | Required. The name of the table being monitored by the trigger. |
232+
| **tableName** | Required. The name of the table being monitored by the trigger. |
233233
| **connectionStringSetting** | Required. The name of an app setting that contains the connection string for the database containing the table monitored for changes. This isn't the actual connection string and must instead resolve to an environment variable. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](https://aka.ms/sqlbindings#sql-connection-string). |
234+
| **leasesTableName** | Optional. The name of the table used to store leases. If not specified, the leases table name will be Leases_{FunctionId}_{TableId}. More information on how this is generated can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename).|
234235

235236
### Setup for Trigger Bindings
236237

docs/SetupGuide_Python.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ The following table explains the binding configuration properties that you set i
216216
| **name** | Required. The name of the parameter that the trigger binds to. |
217217
| **type** | Required. Must be set to `sqlTrigger`.|
218218
| **direction** | Required. Must be set to `in`. |
219-
| **commandText** | Required. The name of the table being monitored by the trigger. |
219+
| **tableName** | Required. The name of the table being monitored by the trigger. |
220220
| **connectionStringSetting** | Required. The name of an app setting that contains the connection string for the database containing the table monitored for changes. This isn't the actual connection string and must instead resolve to an environment variable. Optional keywords in the connection string value are [available to refine SQL bindings connectivity](https://aka.ms/sqlbindings#sql-connection-string). |
221+
| **leasesTableName** | Optional. The name of the table used to store leases. If not specified, the leases table name will be Leases_{FunctionId}_{TableId}. More information on how this is generated can be found [here](https://github.com/Azure/azure-functions-sql-extension/blob/release/trigger/docs/TriggerBinding.md#az_funcleasestablename).|
221222
222223
### Setup for Trigger Bindings
223224

docs/TriggerBinding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ If the tables are deleted or modified, then unexpected behavior may occur. To re
8686

8787
This table stores information about each function being executed, what table that function is watching and what the [last sync state](https://learn.microsoft.com/sql/relational-databases/track-changes/work-with-change-tracking-sql-server) that has been processed.
8888

89-
### az_func.Leases_*
89+
### az_func.\<LeasesTableName\>
9090

91-
A `Leases_*` table is created for every unique instance of a function and table. The full name will be in the format `Leases_<FunctionId>_<TableId>` where `<FunctionId>` is generated from the function ID and `<TableId>` is the object ID of the table being tracked. Such as `Leases_7d12c06c6ddff24c_1845581613`.
91+
If the [LeasesTableName](https://github.com/Azure/azure-functions-sql-extension/blob/30d361021c6760938db659cbe535a9b4f00fc942/docs/SetupGuide_Dotnet.md#L411) property is defined, `az_func.<LeasesTableName>` is created. If LeasesTableName is not defined, a `Leases_*` table is created for every unique instance of a function and table. The full name will be in the format `Leases_<FunctionId>_<TableId>` where `<FunctionId>` is generated from the function ID and `<TableId>` is the object ID of the table being tracked. Such as `Leases_7d12c06c6ddff24c_1845581613`.
9292

9393
To find the name of the leases table associated with your function, look in the log output for a line such as this which is emitted when the trigger is started.
9494

0 commit comments

Comments
 (0)