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-16 17:59:29Z]: 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: 053d24fd-ed66-4f18-8e43-255439321300 Correlation ID: 049203f1-02fb-4d79-8b74-bbf101725aa5 Timestamp: 2026-04-16 17:59:29Z - Correlation ID: 049203f1-02fb-4d79-8b74-bbf101725aa5 - Trace ID: 053d24fd-ed66-4f18-8e43-255439321300
(node:4164) [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-16 17:59:29Z]: 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: 4b1efc15-94ca-425e-9d33-8f81801c8a00 Correlation ID: 028fb41e-001b-4ec8-83a5-69d203c216b8 Timestamp: 2026-04-16 17:59:29Z - Correlation ID: 028fb41e-001b-4ec8-83a5-69d203c216b8 - Trace ID: 4b1efc15-94ca-425e-9d33-8f81801c8a00
Error getting the secret: invalid_client: 7000222 - [2026-04-16 17:59:29Z]: 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: 63716235-0d3d-45d3-b0f8-5afa15760d00 Correlation ID: 6c694129-c925-4cf3-a93a-c2956f056c00 Timestamp: 2026-04-16 17:59:29Z - Correlation ID: 6c694129-c925-4cf3-a93a-c2956f056c00 - Trace ID: 63716235-0d3d-45d3-b0f8-5afa15760d00
Error getting the secret: invalid_client: 7000222 - [2026-04-16 17:59:29Z]: 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: 3c277d3e-ed8e-48f4-8eae-7027e8801800 Correlation ID: 0d01f2e5-0f67-454c-b050-201cf40cd67e Timestamp: 2026-04-16 17:59:29Z - Correlation ID: 0d01f2e5-0f67-454c-b050-201cf40cd67e - Trace ID: 3c277d3e-ed8e-48f4-8eae-7027e8801800
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)