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-01-01 00:22: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: fbc73f5e-16d4-499e-8a82-19408fc71601 Correlation ID: 526bc1d5-97a0-400a-935e-d2469ad94fd0 Timestamp: 2026-01-01 00:22:35Z - Correlation ID: 526bc1d5-97a0-400a-935e-d2469ad94fd0 - Trace ID: fbc73f5e-16d4-499e-8a82-19408fc71601
(node:2016) [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-01-01 00:22: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: 1d5d4d0e-7dc8-42fe-aeb8-7b2fc8d72101 Correlation ID: ecc8b763-4116-4dbc-8008-8ec67e9246c7 Timestamp: 2026-01-01 00:22:35Z - Correlation ID: ecc8b763-4116-4dbc-8008-8ec67e9246c7 - Trace ID: 1d5d4d0e-7dc8-42fe-aeb8-7b2fc8d72101
Error getting the secret: invalid_client: 7000222 - [2026-01-01 00:22: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: abb95de3-a661-4db3-b8eb-2abffd771601 Correlation ID: e5852210-536f-4beb-9257-20cd9396cae9 Timestamp: 2026-01-01 00:22:36Z - Correlation ID: e5852210-536f-4beb-9257-20cd9396cae9 - Trace ID: abb95de3-a661-4db3-b8eb-2abffd771601
Error getting the secret: invalid_client: 7000222 - [2026-01-01 00:22: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: 7cadeac6-c217-4f16-b83d-aadfeda02801 Correlation ID: 26248852-5be4-4cec-989d-98cc60bf4b79 Timestamp: 2026-01-01 00:22:36Z - Correlation ID: 26248852-5be4-4cec-989d-98cc60bf4b79 - Trace ID: 7cadeac6-c217-4f16-b83d-aadfeda02801
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)