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-03-21 10:24:24Z]: 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: 40131e53-8861-4e16-a334-928f14110700 Correlation ID: f4740f89-d440-40b1-a9a2-400679d5c760 Timestamp: 2026-03-21 10:24:24Z - Correlation ID: f4740f89-d440-40b1-a9a2-400679d5c760 - Trace ID: 40131e53-8861-4e16-a334-928f14110700
(node:4228) [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-03-21 10:24:24Z]: 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: c1332a54-8e5c-414d-8d98-fc781b211900 Correlation ID: 9484549b-2e48-4115-a4c0-c9fc43fca4ce Timestamp: 2026-03-21 10:24:24Z - Correlation ID: 9484549b-2e48-4115-a4c0-c9fc43fca4ce - Trace ID: c1332a54-8e5c-414d-8d98-fc781b211900
Error getting the secret: invalid_client: 7000222 - [2026-03-21 10:24:24Z]: 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: f2cbc29a-0ef0-4d67-a912-78b5957f2300 Correlation ID: 154ac992-23c8-4675-8c40-603b3a59b783 Timestamp: 2026-03-21 10:24:24Z - Correlation ID: 154ac992-23c8-4675-8c40-603b3a59b783 - Trace ID: f2cbc29a-0ef0-4d67-a912-78b5957f2300
Error getting the secret: invalid_client: 7000222 - [2026-03-21 10:24:24Z]: 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: 6920b7c3-be7c-4e34-a5e1-aa1b25ad0500 Correlation ID: c74943c3-267a-4a5e-879f-b146fd98ac60 Timestamp: 2026-03-21 10:24:24Z - Correlation ID: c74943c3-267a-4a5e-879f-b146fd98ac60 - Trace ID: 6920b7c3-be7c-4e34-a5e1-aa1b25ad0500
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)