24 Apr 2026 03:00 PM - edited 24 Apr 2026 03:35 PM
We are considering the use of App Functions to provide standardised and simplified approach to certain datasets, however the test platform that I've set up (simple app and notebook module) isn't working. Most of this basic setup is either taken from the docs or the helpers.
The app was created using the app creator and has the following details:
AppId = my.data.builder
and the App Function (again created through the app creator) is as basic as...
export default function () {
return "This Worked";
}... with a name of "getDashboardData"
The notebook JavaScript module has the following script
import { functions } from '@dynatrace-sdk/adhoc-utils';
const response = await functions.call('my.data.builder', 'getDashboardData', {}).then((res) => res.text());{
"error": {
"code": 540,
"message": "Execution crashed.",
"details": {
"logs": "Error: Function getDashboardData within the app my.data.builder failed\n at file:///opt/sdk_modules/@dynatrace-sdk/adhoc-utils@1/esm/index.js:30:13\n at eventLoopTick (ext:core/01_core.js:177:7)\n at async Object.call (file:///opt/sdk_modules/@dynatrace-sdk/adhoc-utils@1/esm/index.js:22:20)\n at async file:///script.ts:3:18\n",
"type": "UNCAUGHT_EXCEPTION",
"message": "Uncaught (in promise) Error: Function getDashboardData within the app my.data.builder failed",
"details": {
"lineNumber": 30,
"startColumn": 13,
"stack": "Error: Function getDashboardData within the app my.data.builder failed\n at file:///opt/sdk_modules/@dynatrace-sdk/adhoc-utils@1/esm/index.js:30:13\n at eventLoopTick (ext:core/01_core.js:177:7)\n at async Object.call (file:///opt/sdk_modules/@dynatrace-sdk/adhoc-utils@1/esm/index.js:22:20)\n at async file:///script.ts:3:18"
}
}
},
"packageVersions": {
"@dynatrace-sdk/adhoc-utils": "1.0.2"
}
}
Clearly, I've missed something somewhere - would you be able to point me in the right direction please?
Thanks
Solved! Go to Solution.
24 Apr 2026 03:26 PM
Hi skirkham,
I see two different app IDs: my.data.builder and my.cwv.data.builder.
Please double-check that you're actually using the correct app ID when calling your function.
Cheers,
David
24 Apr 2026 03:38 PM
Thanks for the heads up David, however it is the same error message from both sources.
I initially created a more functional AppFunction (which tests fine within VSCode) but as I received the error I created a new app and the more simplified AppFunction just to make sure it wasn't within the code.
Is there any permissions needed for allowing AppFunctions?
24 Apr 2026 04:06 PM
Hello @skirkham
Yes, there is a specific permission for running App Functions.
Please check whether the user running the Notebook has at least:
ALLOW app-engine:apps:run;
ALLOW app-engine:functions:run;Or assign the built-in/default AppEngine - User policy, which already includes:
ALLOW app-engine:apps:run, app-engine:functions:run, app-engine:edge-connects:read;app-engine:functions:run is the important one because it enables the App Function executor.
That said, if the permission were completely missing, I would normally expect more of an authorization/permission error. Since your error says the function “failed” and returns code 540, it may also mean the function is being reached but crashing inside the App Function runtime.
27 Apr 2026 08:21 AM
Hi,
Thanks for the detail, I have checked and the user does already have those permissions and I agree that if it were related to permissions I should see a different error message.
I'll drop a ticket into support.
Thanks
27 Apr 2026 11:48 AM
Hello @skirkham,
Yeah should be, but sometimes errors are omitting details like missing permissions, I learned in the worst way... almost 1 week by missing one specific scope 😅
27 Apr 2026 07:22 PM
For anyone else seeing this issue...
A quick conversation with support identified the issue which was due to the application been deployed in development mode, which runs code locally and therefore my notebook wasn't able to connect to the app function, hence the error. However, once the app was fully deployed then the notebook was able to call the function and return the required data.
29 Apr 2026 02:34 PM
Thank you for sharing what the issue was!
Featured Posts