iisnode encountered an error when processing the request.

HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error

You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stderr is shown below:

Error getting the secret: invalid_client: 7000222 - [2026-04-23 09:10:18Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: d2ebc63c-0f0d-4050-9587-587f927c6500 Correlation ID: 8977857e-f64a-450a-a873-8cfbd7703d27 Timestamp: 2026-04-23 09:10:18Z - Correlation ID: 8977857e-f64a-450a-a873-8cfbd7703d27 - Trace ID: d2ebc63c-0f0d-4050-9587-587f927c6500
(node:5224) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error getting the secret: invalid_client: 7000222 - [2026-04-23 09:10:19Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: fcf4f218-f529-4bb7-ac49-86ec74d85c00 Correlation ID: 65a509a3-a5a4-4a6c-af6b-4ef65dfb6755 Timestamp: 2026-04-23 09:10:19Z - Correlation ID: 65a509a3-a5a4-4a6c-af6b-4ef65dfb6755 - Trace ID: fcf4f218-f529-4bb7-ac49-86ec74d85c00
Error getting the secret: invalid_client: 7000222 - [2026-04-23 09:10:19Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 259cd39a-6d77-4c84-a488-cafb4bea1600 Correlation ID: 5af877f4-2e3d-4c08-9606-015a2ca41b33 Timestamp: 2026-04-23 09:10:19Z - Correlation ID: 5af877f4-2e3d-4c08-9606-015a2ca41b33 - Trace ID: 259cd39a-6d77-4c84-a488-cafb4bea1600
Error getting the secret: invalid_client: 7000222 - [2026-04-23 09:10:19Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 45dc1b13-bca4-431a-80ba-473d16575700 Correlation ID: 408dfc29-cf46-4bf8-87e4-a15063fdb681 Timestamp: 2026-04-23 09:10:19Z - Correlation ID: 408dfc29-cf46-4bf8-87e4-a15063fdb681 - Trace ID: 45dc1b13-bca4-431a-80ba-473d16575700
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read properties of undefined (reading 'cosdb')
    at C:\stop_order_dev\server.js:25:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)