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-05-01 03:00:24Z]: 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: 1145f2c5-a248-4db1-af77-d19089451900 Correlation ID: 5eea6fd0-cba8-4bba-b5ba-5d008507d070 Timestamp: 2026-05-01 03:00:24Z - Correlation ID: 5eea6fd0-cba8-4bba-b5ba-5d008507d070 - Trace ID: 1145f2c5-a248-4db1-af77-d19089451900
(node:2316) [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-05-01 03:00:24Z]: 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: 878153c8-d37e-4d62-8f34-4aefd53d1600 Correlation ID: 37e68fcb-39a9-49b2-ad62-1edef27412c0 Timestamp: 2026-05-01 03:00:24Z - Correlation ID: 37e68fcb-39a9-49b2-ad62-1edef27412c0 - Trace ID: 878153c8-d37e-4d62-8f34-4aefd53d1600
Error getting the secret: invalid_client: 7000222 - [2026-05-01 03:00:25Z]: 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: 09a118e9-d17a-41cf-9791-de5176071400 Correlation ID: e61c6887-e62c-46bc-bd12-6e4da1c16851 Timestamp: 2026-05-01 03:00:25Z - Correlation ID: e61c6887-e62c-46bc-bd12-6e4da1c16851 - Trace ID: 09a118e9-d17a-41cf-9791-de5176071400
Error getting the secret: invalid_client: 7000222 - [2026-05-01 03:00:25Z]: 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: 34de36a7-c940-412a-814d-e97ac8661600 Correlation ID: b3373ad3-26b8-4b51-985e-eab2583d1e56 Timestamp: 2026-05-01 03:00:25Z - Correlation ID: b3373ad3-26b8-4b51-985e-eab2583d1e56 - Trace ID: 34de36a7-c940-412a-814d-e97ac8661600
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)