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-12 13:22:32Z]: 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: 2d634dcd-4daf-493b-bfef-a8d0b72d2500 Correlation ID: 5d52cba3-c6ab-4d11-b8a8-ecf5fcee45a3 Timestamp: 2026-04-12 13:22:32Z - Correlation ID: 5d52cba3-c6ab-4d11-b8a8-ecf5fcee45a3 - Trace ID: 2d634dcd-4daf-493b-bfef-a8d0b72d2500
(node:5968) [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-12 13:22:32Z]: 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: eb9ba0b7-7955-4a8a-8b0b-d44604c50d00 Correlation ID: 3f203963-558a-40b1-b3c6-51e28873e701 Timestamp: 2026-04-12 13:22:32Z - Correlation ID: 3f203963-558a-40b1-b3c6-51e28873e701 - Trace ID: eb9ba0b7-7955-4a8a-8b0b-d44604c50d00
Error getting the secret: invalid_client: 7000222 - [2026-04-12 13:22:33Z]: 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: a789eadf-3ea0-4252-a2dd-cfade8671c00 Correlation ID: c719af5d-553d-4436-a1b6-b755fbdd073d Timestamp: 2026-04-12 13:22:33Z - Correlation ID: c719af5d-553d-4436-a1b6-b755fbdd073d - Trace ID: a789eadf-3ea0-4252-a2dd-cfade8671c00
Error getting the secret: invalid_client: 7000222 - [2026-04-12 13:22:33Z]: 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: 02d3e8da-34a7-4771-adcc-737cbef90500 Correlation ID: e970d345-f2cd-4843-a90c-6d0857dd4fb5 Timestamp: 2026-04-12 13:22:33Z - Correlation ID: e970d345-f2cd-4843-a90c-6d0857dd4fb5 - Trace ID: 02d3e8da-34a7-4771-adcc-737cbef90500
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)