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-19 08:25:50Z]: 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: 4543797a-5cc2-49b2-9bd1-c87ec1980b00 Correlation ID: e7641dc1-8e87-4ed4-aaaa-6b1fddac26c3 Timestamp: 2026-04-19 08:25:50Z - Correlation ID: e7641dc1-8e87-4ed4-aaaa-6b1fddac26c3 - Trace ID: 4543797a-5cc2-49b2-9bd1-c87ec1980b00
(node:2840) [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-19 08:25:50Z]: 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: 139e6253-9cd0-4b30-8a3b-51f417161000 Correlation ID: d985c52a-b7f0-42d9-9225-ec41ae320358 Timestamp: 2026-04-19 08:25:50Z - Correlation ID: d985c52a-b7f0-42d9-9225-ec41ae320358 - Trace ID: 139e6253-9cd0-4b30-8a3b-51f417161000
Error getting the secret: invalid_client: 7000222 - [2026-04-19 08:25:51Z]: 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: 4543797a-5cc2-49b2-9bd1-c87ed0980b00 Correlation ID: 681d29e1-3b14-4a75-be39-c1e65efc1e34 Timestamp: 2026-04-19 08:25:51Z - Correlation ID: 681d29e1-3b14-4a75-be39-c1e65efc1e34 - Trace ID: 4543797a-5cc2-49b2-9bd1-c87ed0980b00
Error getting the secret: invalid_client: 7000222 - [2026-04-19 08:25:51Z]: 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: 607da932-e269-431e-ba63-6eed5f8b2200 Correlation ID: 55f48a0c-0035-4dc0-830d-62c07d583fed Timestamp: 2026-04-19 08:25:51Z - Correlation ID: 55f48a0c-0035-4dc0-830d-62c07d583fed - Trace ID: 607da932-e269-431e-ba63-6eed5f8b2200
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)