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-05-20 19:18:45Z]: 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: 7c8aca19-0a83-4bb2-8949-1ba556397100 Correlation ID: 3ae72313-5cf9-4f72-934c-ee20c15694f9 Timestamp: 2026-05-20 19:18:45Z - Correlation ID: 3ae72313-5cf9-4f72-934c-ee20c15694f9 - Trace ID: 7c8aca19-0a83-4bb2-8949-1ba556397100
(node:2496) [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-05-20 19:18:45Z]: 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: 350efbbd-27cc-4dc0-af3f-d87c4c1f7b00 Correlation ID: 55f32682-3f4d-4b4a-a398-cab48d61a9a1 Timestamp: 2026-05-20 19:18:45Z - Correlation ID: 55f32682-3f4d-4b4a-a398-cab48d61a9a1 - Trace ID: 350efbbd-27cc-4dc0-af3f-d87c4c1f7b00
Error getting the secret: invalid_client: 7000222 - [2026-05-20 19:18: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: 27f4c394-9e8b-4a60-8a01-1dd15abd7000 Correlation ID: c220b6b8-9302-486a-8882-a82eae01b7e9 Timestamp: 2026-05-20 19:18:46Z - Correlation ID: c220b6b8-9302-486a-8882-a82eae01b7e9 - Trace ID: 27f4c394-9e8b-4a60-8a01-1dd15abd7000
Error getting the secret: invalid_client: 7000222 - [2026-05-20 19:18: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: 3181d8c9-eb81-4363-a510-e97392d26600 Correlation ID: 89cce003-503e-4d38-9d79-bd0b334eabc1 Timestamp: 2026-05-20 19:18:46Z - Correlation ID: 89cce003-503e-4d38-9d79-bd0b334eabc1 - Trace ID: 3181d8c9-eb81-4363-a510-e97392d26600
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)