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-04 20:46: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: d2690d71-d985-4cfa-8f3a-13dc1bb09a00 Correlation ID: d2a4019b-488b-4a7a-90c9-ebeea6d2cba9 Timestamp: 2026-03-04 20:46:51Z - Correlation ID: d2a4019b-488b-4a7a-90c9-ebeea6d2cba9 - Trace ID: d2690d71-d985-4cfa-8f3a-13dc1bb09a00
(node:1204) [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-04 20:46:52Z]: 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: d2690d71-d985-4cfa-8f3a-13dc29b09a00 Correlation ID: 6c23fefd-4e26-45bf-be6c-172430a9aa41 Timestamp: 2026-03-04 20:46:52Z - Correlation ID: 6c23fefd-4e26-45bf-be6c-172430a9aa41 - Trace ID: d2690d71-d985-4cfa-8f3a-13dc29b09a00
Error getting the secret: invalid_client: 7000222 - [2026-03-04 20:46:52Z]: 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: 12496dd4-9fee-47c5-bb77-024f48b50e00 Correlation ID: d18b27fd-88ab-4b03-ad2a-51c7d4412cb9 Timestamp: 2026-03-04 20:46:52Z - Correlation ID: d18b27fd-88ab-4b03-ad2a-51c7d4412cb9 - Trace ID: 12496dd4-9fee-47c5-bb77-024f48b50e00
Error getting the secret: invalid_client: 7000222 - [2026-03-04 20:46:52Z]: 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: 341d0a0c-c444-4381-8f56-af2d21d73000 Correlation ID: e1033095-4694-4713-9377-584929d0203f Timestamp: 2026-03-04 20:46:52Z - Correlation ID: e1033095-4694-4713-9377-584929d0203f - Trace ID: 341d0a0c-c444-4381-8f56-af2d21d73000
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)