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-25 00:17:42Z]: 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: 07f839bb-0d01-4647-9254-1151f64d0700 Correlation ID: 5fcae9b2-3d7f-4bfb-b9e5-1e671986599e Timestamp: 2026-04-25 00:17:42Z - Correlation ID: 5fcae9b2-3d7f-4bfb-b9e5-1e671986599e - Trace ID: 07f839bb-0d01-4647-9254-1151f64d0700
(node:1564) [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-25 00:17:42Z]: 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: cf680a23-4118-4977-9dd6-449388960500 Correlation ID: d03a8a66-9eb7-40e3-8842-8ef2f0160195 Timestamp: 2026-04-25 00:17:42Z - Correlation ID: d03a8a66-9eb7-40e3-8842-8ef2f0160195 - Trace ID: cf680a23-4118-4977-9dd6-449388960500
Error getting the secret: invalid_client: 7000222 - [2026-04-25 00:17:43Z]: 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: 5d57db1c-7b20-44fb-9c7d-f60fb09e2800 Correlation ID: b560a635-8953-4345-9c92-6f241ed703d3 Timestamp: 2026-04-25 00:17:43Z - Correlation ID: b560a635-8953-4345-9c92-6f241ed703d3 - Trace ID: 5d57db1c-7b20-44fb-9c7d-f60fb09e2800
Error getting the secret: invalid_client: 7000222 - [2026-04-25 00:17:43Z]: 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: cf680a23-4118-4977-9dd6-44938f960500 Correlation ID: 2a9d1b8a-7c84-4de5-8403-27839017aa35 Timestamp: 2026-04-25 00:17:43Z - Correlation ID: 2a9d1b8a-7c84-4de5-8403-27839017aa35 - Trace ID: cf680a23-4118-4977-9dd6-44938f960500
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)