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-31 14:27:11Z]: 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: b50d99f5-1524-47d8-b68d-ae8bdd982c00 Correlation ID: e5505df9-d8ad-4479-883a-1290f83a5047 Timestamp: 2026-03-31 14:27:11Z - Correlation ID: e5505df9-d8ad-4479-883a-1290f83a5047 - Trace ID: b50d99f5-1524-47d8-b68d-ae8bdd982c00
(node:2300) [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-31 14:27:11Z]: 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: 6ee42730-2d31-463e-af45-a8a1fe870a00 Correlation ID: 7ad30b77-2670-46c1-976e-8ed267f6f29d Timestamp: 2026-03-31 14:27:11Z - Correlation ID: 7ad30b77-2670-46c1-976e-8ed267f6f29d - Trace ID: 6ee42730-2d31-463e-af45-a8a1fe870a00
Error getting the secret: invalid_client: 7000222 - [2026-03-31 14:27:12Z]: 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: 42846139-5e4e-4fc8-8fc6-a8e1c29e3100 Correlation ID: 4e16d969-9a74-4bcb-913d-b1c9f0bdefb0 Timestamp: 2026-03-31 14:27:12Z - Correlation ID: 4e16d969-9a74-4bcb-913d-b1c9f0bdefb0 - Trace ID: 42846139-5e4e-4fc8-8fc6-a8e1c29e3100
Error getting the secret: invalid_client: 7000222 - [2026-03-31 14:27:12Z]: 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: d1782c56-8428-477e-a184-9e06aeeb0b00 Correlation ID: 8936cc39-fdbb-4b82-8b42-a5a9a954f9e9 Timestamp: 2026-03-31 14:27:12Z - Correlation ID: 8936cc39-fdbb-4b82-8b42-a5a9a954f9e9 - Trace ID: d1782c56-8428-477e-a184-9e06aeeb0b00
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)