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-22 17:03:46Z]: 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: 1cfd9e16-0302-497f-bd1c-1ae189eb2900 Correlation ID: 72aa8d73-75b6-4a36-86a8-4795364d92c9 Timestamp: 2026-04-22 17:03:46Z - Correlation ID: 72aa8d73-75b6-4a36-86a8-4795364d92c9 - Trace ID: 1cfd9e16-0302-497f-bd1c-1ae189eb2900
(node:4608) [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-22 17:03:46Z]: 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: 75913703-1431-4847-b873-ba8157b34300 Correlation ID: bb1f3a35-f8ac-460d-b5e5-f09972f095e5 Timestamp: 2026-04-22 17:03:46Z - Correlation ID: bb1f3a35-f8ac-460d-b5e5-f09972f095e5 - Trace ID: 75913703-1431-4847-b873-ba8157b34300
Error getting the secret: invalid_client: 7000222 - [2026-04-22 17:03:47Z]: 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: 43d436df-cbc7-44da-ad53-0a969e115900 Correlation ID: feebafb3-b76a-4f6d-9435-80db377f71ce Timestamp: 2026-04-22 17:03:47Z - Correlation ID: feebafb3-b76a-4f6d-9435-80db377f71ce - Trace ID: 43d436df-cbc7-44da-ad53-0a969e115900
Error getting the secret: invalid_client: 7000222 - [2026-04-22 17:03:47Z]: 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: 1cfd9e16-0302-497f-bd1c-1ae1a3eb2900 Correlation ID: 716b9643-173d-47bb-a53a-f3acdf796e45 Timestamp: 2026-04-22 17:03:47Z - Correlation ID: 716b9643-173d-47bb-a53a-f3acdf796e45 - Trace ID: 1cfd9e16-0302-497f-bd1c-1ae1a3eb2900
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)