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-23 12:17:35Z]: 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: bf861ebb-a85f-4986-b34f-5c51dbea0100 Correlation ID: 9f399bb4-5cde-4cd4-ade5-c9e260a42165 Timestamp: 2026-03-23 12:17:35Z - Correlation ID: 9f399bb4-5cde-4cd4-ade5-c9e260a42165 - Trace ID: bf861ebb-a85f-4986-b34f-5c51dbea0100
(node:4372) [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-23 12:17:35Z]: 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: 80daeb47-89d5-49c9-98b5-3ffd47964700 Correlation ID: 3e2fddc0-b7f5-4818-8b83-4184d8c4b994 Timestamp: 2026-03-23 12:17:35Z - Correlation ID: 3e2fddc0-b7f5-4818-8b83-4184d8c4b994 - Trace ID: 80daeb47-89d5-49c9-98b5-3ffd47964700
Error getting the secret: invalid_client: 7000222 - [2026-03-23 12:17:35Z]: 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: 0710fa3b-8673-4b38-823f-aae3aa4d0200 Correlation ID: daa92057-280b-4a9e-a39f-eae139113503 Timestamp: 2026-03-23 12:17:35Z - Correlation ID: daa92057-280b-4a9e-a39f-eae139113503 - Trace ID: 0710fa3b-8673-4b38-823f-aae3aa4d0200
Error getting the secret: invalid_client: 7000222 - [2026-03-23 12:17:36Z]: 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: 0710fa3b-8673-4b38-823f-aae3bc4d0200 Correlation ID: 7923ef0a-7b09-491e-a253-3368819d1711 Timestamp: 2026-03-23 12:17:36Z - Correlation ID: 7923ef0a-7b09-491e-a253-3368819d1711 - Trace ID: 0710fa3b-8673-4b38-823f-aae3bc4d0200
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)