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-31 02:51:12Z]: 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: 9c1547c9-9306-4584-9356-5e5155423700 Correlation ID: e96d0b0a-fc1d-4e0e-8440-7cb9ecb2b62a Timestamp: 2026-03-31 02:51:12Z - Correlation ID: e96d0b0a-fc1d-4e0e-8440-7cb9ecb2b62a - Trace ID: 9c1547c9-9306-4584-9356-5e5155423700
(node:4404) [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-31 02:51:13Z]: 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: 0c31c5dd-53e7-4098-950f-0a6339fe3500 Correlation ID: 93c1205e-7119-4fec-b160-e41766b223fa Timestamp: 2026-03-31 02:51:13Z - Correlation ID: 93c1205e-7119-4fec-b160-e41766b223fa - Trace ID: 0c31c5dd-53e7-4098-950f-0a6339fe3500
Error getting the secret: invalid_client: 7000222 - [2026-03-31 02:51:13Z]: 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: a60b27b3-2950-4dc3-a159-6528b69d3500 Correlation ID: 4571cb9a-2d86-4ee7-8351-e39a194efa9d Timestamp: 2026-03-31 02:51:13Z - Correlation ID: 4571cb9a-2d86-4ee7-8351-e39a194efa9d - Trace ID: a60b27b3-2950-4dc3-a159-6528b69d3500
Error getting the secret: invalid_client: 7000222 - [2026-03-31 02:51:13Z]: 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: 44deca48-5bc9-4587-8f94-71657bc92600 Correlation ID: fbaf67a3-0a61-4de6-bf3c-ceb42f191f46 Timestamp: 2026-03-31 02:51:13Z - Correlation ID: fbaf67a3-0a61-4de6-bf3c-ceb42f191f46 - Trace ID: 44deca48-5bc9-4587-8f94-71657bc92600
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)