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-16 23:39:50Z]: 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: c075da03-0fb3-4fac-9f31-2c4c55021e00 Correlation ID: a2039c58-4eb4-4ea8-b988-d69f2abc3c0f Timestamp: 2026-05-16 23:39:50Z - Correlation ID: a2039c58-4eb4-4ea8-b988-d69f2abc3c0f - Trace ID: c075da03-0fb3-4fac-9f31-2c4c55021e00
(node:5596) [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-16 23:39:50Z]: 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: f255926c-cbb1-475d-8f46-f69dcac20a00 Correlation ID: 2a439e9b-0f3b-461a-ba58-aacbaab49530 Timestamp: 2026-05-16 23:39:50Z - Correlation ID: 2a439e9b-0f3b-461a-ba58-aacbaab49530 - Trace ID: f255926c-cbb1-475d-8f46-f69dcac20a00
Error getting the secret: invalid_client: 7000222 - [2026-05-16 23:39:50Z]: 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: 50f81351-8329-4f7b-8bc2-63230d410b00 Correlation ID: f6609f2d-2291-4fd3-82c0-5dc43b707489 Timestamp: 2026-05-16 23:39:50Z - Correlation ID: f6609f2d-2291-4fd3-82c0-5dc43b707489 - Trace ID: 50f81351-8329-4f7b-8bc2-63230d410b00
Error getting the secret: invalid_client: 7000222 - [2026-05-16 23:39:51Z]: 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: 6a3c4935-8cf6-4100-b522-0e8931f00000 Correlation ID: 08da932d-4c43-4a3e-a943-3351c1c9eff5 Timestamp: 2026-05-16 23:39:51Z - Correlation ID: 08da932d-4c43-4a3e-a943-3351c1c9eff5 - Trace ID: 6a3c4935-8cf6-4100-b522-0e8931f00000
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)