Skip to content

Commit 953a1cf

Browse files
authored
UserfunctionId change and integration test. (#1091)
* add integrayion test and use just functionName in userFunctionId * make websitename required * add docs * use MethodInfo.Name * update error msg * methodInfo.DeclaringType.Name * update doc * set WEBSITE_SITE_NAME for tests * add method name to UserFunctionId * remove method name and replace with functionName * update to sdk with latest security patch * do not fail on PRs * argument excepion fix * undo Component Detection change * undo sdk bump * fix FunctionName for non .Net
1 parent e65e93f commit 953a1cf

File tree

15 files changed

+105
-15
lines changed

15 files changed

+105
-15
lines changed

builds/azure-pipelines/build-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ stages:
3737
workspace:
3838
clean: all
3939

40-
timeoutInMinutes: '120'
40+
timeoutInMinutes: '90'
4141

4242
steps:
4343
- template: 'template-steps-build-test.yml'

docs/BindingsOverview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ The delay in milliseconds between processing each batch of changes.
152152

153153
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.
154154

155+
#### WEBSITE_SITE_NAME
156+
157+
The unique name used in creating the lease tables. The local apps depend on this setting for creating unique leases tables, please give a unique name for each app.
158+
> **NOTE:** If the setting is re-used accross apps, having the same function name could cause the functions to use the same lease tables and the function runs to not work as expected.
159+
> **NOTE:** If you have 2 different SQL trigger functions with same functionName locally, not having WEBSITE_SITE_NAME would mean that the same leasees table would be used for both triggers resulting in only one of the functions being triggered.
160+
> **NOTE:** This is a read-only variable that is provided by the azure environment variables for deployed functions and the user provided value will be overridden. Refer to [Environment variables](https://learn.microsoft.com/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment) for apps.
161+
155162
### Scaling for Trigger Bindings
156163

157164
If your application containing functions with SQL trigger bindings is running as an Azure function app, it will be scaled automatically based on the amount of changes that are pending to be processed in the user table. As of today, we only support scaling of function apps running in Elastic Premium plan with 'Runtime Scale Monitoring' enabled. To enable scaling, you will need to go the function app resource's page on Azure Portal, then to Configuration > 'Function runtime settings' and turn on 'Runtime Scale Monitoring'.

samples/samples-csharp/local.settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
55
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
66
"SqlConnectionString": "",
7+
"WEBSITE_SITE_NAME": "SamplesCSharp",
78
"Sp_SelectCost": "SelectProductsCost",
89
"ProductCost": 100
910
}

samples/samples-csx/local.settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
55
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
66
"SqlConnectionString": "",
7+
"WEBSITE_SITE_NAME": "SamplesCsx",
78
"Sp_SelectCost": "SelectProductsCost",
89
"ProductCost": 100
910
}

samples/samples-java/local.settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
55
"FUNCTIONS_WORKER_RUNTIME": "java",
66
"SqlConnectionString": "",
7+
"WEBSITE_SITE_NAME": "SamplesJava",
78
"Sp_SelectCost": "SelectProductsCost",
89
"ProductCost": 100
910
}

samples/samples-js-v4/local.settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
55
"FUNCTIONS_WORKER_RUNTIME": "node",
66
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
7-
"SqlConnectionString": ""
7+
"SqlConnectionString": "",
8+
"WEBSITE_SITE_NAME": "SamplesNodeV4"
89
}
910
}

samples/samples-js/local.settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
55
"FUNCTIONS_WORKER_RUNTIME": "node",
66
"SqlConnectionString": "",
7+
"WEBSITE_SITE_NAME": "SamplesJavascript",
78
"Sp_SelectCost": "SelectProductsCost",
89
"ProductCost": 100
910
}

samples/samples-outofproc/local.settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
55
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
66
"SqlConnectionString": "",
7+
"WEBSITE_SITE_NAME": "SamplesOOP",
78
"Sp_SelectCost": "SelectProductsCost",
89
"ProductCost": 100
910
}

samples/samples-powershell/local.settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"FUNCTIONS_WORKER_RUNTIME": "powershell",
66
"FUNCTIONS_WORKER_RUNTIME_VERSION" : "~7.2",
77
"SqlConnectionString": "",
8+
"WEBSITE_SITE_NAME": "SamplesPowershell",
89
"Sp_SelectCost": "SelectProductsCost",
910
"ProductCost": 100
1011
}

samples/samples-python-v2/local.settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
66
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
77
"SqlConnectionString": "",
8+
"WEBSITE_SITE_NAME": "SamplesPythonV2",
89
"PYTHON_ISOLATE_WORKER_DEPENDENCIES": "1"
910
}
1011
}

0 commit comments

Comments
 (0)