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-19 01:59:37Z]: 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: fad53ba5-6048-432d-b3c2-13450b9a2f00 Correlation ID: df2d304a-bf8e-4f2e-a29a-b9fec91ff699 Timestamp: 2026-03-19 01:59:37Z - Correlation ID: df2d304a-bf8e-4f2e-a29a-b9fec91ff699 - Trace ID: fad53ba5-6048-432d-b3c2-13450b9a2f00
(node:4088) [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-19 01:59:37Z]: 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: 01def833-2abb-4587-8263-843a670f1b00 Correlation ID: fe371290-eccc-42b2-a2f7-06fe849b3f9c Timestamp: 2026-03-19 01:59:37Z - Correlation ID: fe371290-eccc-42b2-a2f7-06fe849b3f9c - Trace ID: 01def833-2abb-4587-8263-843a670f1b00
Error getting the secret: invalid_client: 7000222 - [2026-03-19 01:59:37Z]: 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: 7a0bb8c9-6ce3-4b56-9f95-e67606982000 Correlation ID: 593aae83-e278-4504-92d4-87fd8a0d9e4f Timestamp: 2026-03-19 01:59:37Z - Correlation ID: 593aae83-e278-4504-92d4-87fd8a0d9e4f - Trace ID: 7a0bb8c9-6ce3-4b56-9f95-e67606982000
Error getting the secret: invalid_client: 7000222 - [2026-03-19 01:59:37Z]: 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: 45b50f13-78bc-4202-8281-c7648cc43b00 Correlation ID: 644c4996-f9fc-4773-80be-0e706144f894 Timestamp: 2026-03-19 01:59:37Z - Correlation ID: 644c4996-f9fc-4773-80be-0e706144f894 - Trace ID: 45b50f13-78bc-4202-8281-c7648cc43b00
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)