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-30 18:05:40Z]: 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: 2ad7af70-0b72-482f-b468-55b9662e4000 Correlation ID: 108f2d2e-0e5a-4c68-8f81-e452e9496355 Timestamp: 2026-03-30 18:05:40Z - Correlation ID: 108f2d2e-0e5a-4c68-8f81-e452e9496355 - Trace ID: 2ad7af70-0b72-482f-b468-55b9662e4000
(node:5544) [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-30 18:05:41Z]: 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: 8cdc93dd-7fb1-4804-a209-5ce5561b2f00 Correlation ID: a0e664f7-5143-478b-8265-4c6c2054082f Timestamp: 2026-03-30 18:05:41Z - Correlation ID: a0e664f7-5143-478b-8265-4c6c2054082f - Trace ID: 8cdc93dd-7fb1-4804-a209-5ce5561b2f00
Error getting the secret: invalid_client: 7000222 - [2026-03-30 18:05:41Z]: 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: 2cb6650a-9e40-469a-a96d-2ef75e8e2f00 Correlation ID: b1b47872-8282-4fd8-a680-2d8cb24cfefc Timestamp: 2026-03-30 18:05:41Z - Correlation ID: b1b47872-8282-4fd8-a680-2d8cb24cfefc - Trace ID: 2cb6650a-9e40-469a-a96d-2ef75e8e2f00
Error getting the secret: invalid_client: 7000222 - [2026-03-30 18:05:41Z]: 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: c9993009-614f-451a-ae24-59f3f69e1c00 Correlation ID: 07cf7052-08c2-4344-8ab0-64344faa2934 Timestamp: 2026-03-30 18:05:41Z - Correlation ID: 07cf7052-08c2-4344-8ab0-64344faa2934 - Trace ID: c9993009-614f-451a-ae24-59f3f69e1c00
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)