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-09 00:17:20Z]: 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: e508d93c-2434-4dcf-b792-3fa06edf2f00 Correlation ID: ecfef328-88ca-4990-ad56-5e7ec8ac43d9 Timestamp: 2026-04-09 00:17:20Z - Correlation ID: ecfef328-88ca-4990-ad56-5e7ec8ac43d9 - Trace ID: e508d93c-2434-4dcf-b792-3fa06edf2f00
(node:1456) [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-09 00:17:21Z]: 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: 72b2e8f6-211c-4286-87b4-aed6f2561100 Correlation ID: 514cc8f0-27dc-4ee2-b34d-e7cf4dad6000 Timestamp: 2026-04-09 00:17:21Z - Correlation ID: 514cc8f0-27dc-4ee2-b34d-e7cf4dad6000 - Trace ID: 72b2e8f6-211c-4286-87b4-aed6f2561100
Error getting the secret: invalid_client: 7000222 - [2026-04-09 00:17:21Z]: 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: 92ac0330-4f56-4123-a104-95aae05d3b00 Correlation ID: c5bb9e36-742f-42b9-9f17-c44a20dc08be Timestamp: 2026-04-09 00:17:21Z - Correlation ID: c5bb9e36-742f-42b9-9f17-c44a20dc08be - Trace ID: 92ac0330-4f56-4123-a104-95aae05d3b00
Error getting the secret: invalid_client: 7000222 - [2026-04-09 00:17:21Z]: 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: 311247d9-7452-45c4-976c-4c1107b03900 Correlation ID: c508b01d-d079-44dc-a4d4-ccf61bbd856f Timestamp: 2026-04-09 00:17:21Z - Correlation ID: c508b01d-d079-44dc-a4d4-ccf61bbd856f - Trace ID: 311247d9-7452-45c4-976c-4c1107b03900
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)