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-18 13:47:34Z]: 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: 6f0bcf36-955f-4522-809d-c6b7fe8a0900 Correlation ID: 24af42e0-7707-491d-884a-dff9ffeda1f1 Timestamp: 2026-03-18 13:47:34Z - Correlation ID: 24af42e0-7707-491d-884a-dff9ffeda1f1 - Trace ID: 6f0bcf36-955f-4522-809d-c6b7fe8a0900
(node:3452) [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-18 13:47:34Z]: 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: ac550ce9-d84d-4533-be88-e45888cd2300 Correlation ID: 4be13e93-450f-4225-9c81-9a80a609a883 Timestamp: 2026-03-18 13:47:34Z - Correlation ID: 4be13e93-450f-4225-9c81-9a80a609a883 - Trace ID: ac550ce9-d84d-4533-be88-e45888cd2300
Error getting the secret: invalid_client: 7000222 - [2026-03-18 13:47: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: ac550ce9-d84d-4533-be88-e4588ecd2300 Correlation ID: f1818ba6-2665-4fb3-8218-6fce819e4a49 Timestamp: 2026-03-18 13:47:35Z - Correlation ID: f1818ba6-2665-4fb3-8218-6fce819e4a49 - Trace ID: ac550ce9-d84d-4533-be88-e4588ecd2300
Error getting the secret: invalid_client: 7000222 - [2026-03-18 13:47: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: 2a6e0569-4630-40a6-b1dc-84828a722200 Correlation ID: 4e5371e6-f2c2-4917-864a-21394ec61f77 Timestamp: 2026-03-18 13:47:35Z - Correlation ID: 4e5371e6-f2c2-4917-864a-21394ec61f77 - Trace ID: 2a6e0569-4630-40a6-b1dc-84828a722200
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)