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-20 16:02:15Z]: 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: d6f36d98-17f5-40b4-94f6-1d54130f1400 Correlation ID: 22f69374-9d15-4889-ac7b-0b56401d7b1f Timestamp: 2026-04-20 16:02:15Z - Correlation ID: 22f69374-9d15-4889-ac7b-0b56401d7b1f - Trace ID: d6f36d98-17f5-40b4-94f6-1d54130f1400
(node:4892) [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-20 16:02:16Z]: 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: aaa56b37-ae0f-424a-93c5-811917d10900 Correlation ID: 787db21f-0d8f-44d3-bced-59ce524d4f9a Timestamp: 2026-04-20 16:02:16Z - Correlation ID: 787db21f-0d8f-44d3-bced-59ce524d4f9a - Trace ID: aaa56b37-ae0f-424a-93c5-811917d10900
Error getting the secret: invalid_client: 7000222 - [2026-04-20 16:02:16Z]: 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: d5ecd6a3-3056-436c-a8b5-815ba7711100 Correlation ID: 2b4da6b7-5e4e-4d8d-9702-e7de5255b5ef Timestamp: 2026-04-20 16:02:16Z - Correlation ID: 2b4da6b7-5e4e-4d8d-9702-e7de5255b5ef - Trace ID: d5ecd6a3-3056-436c-a8b5-815ba7711100
Error getting the secret: invalid_client: 7000222 - [2026-04-20 16:02:16Z]: 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: af7f12f5-3d35-40fa-947d-1a0c54e81600 Correlation ID: ab43e7bd-3bc8-473f-b585-010f6bd0f538 Timestamp: 2026-04-20 16:02:16Z - Correlation ID: ab43e7bd-3bc8-473f-b585-010f6bd0f538 - Trace ID: af7f12f5-3d35-40fa-947d-1a0c54e81600
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)