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-23 10:58:54Z]: 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: 7ceff8c5-5e01-4ead-9981-861f34c20b00 Correlation ID: 04ecf62a-5f15-46ad-91ce-58268f0cf425 Timestamp: 2026-04-23 10:58:54Z - Correlation ID: 04ecf62a-5f15-46ad-91ce-58268f0cf425 - Trace ID: 7ceff8c5-5e01-4ead-9981-861f34c20b00
(node:4084) [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-23 10:58:54Z]: 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: 76ed52f6-258a-4e43-80c9-74d70cda0000 Correlation ID: 096b750d-9828-4303-84bd-9fcfe38d817a Timestamp: 2026-04-23 10:58:54Z - Correlation ID: 096b750d-9828-4303-84bd-9fcfe38d817a - Trace ID: 76ed52f6-258a-4e43-80c9-74d70cda0000
Error getting the secret: invalid_client: 7000222 - [2026-04-23 10:58:55Z]: 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: 4c962112-15de-4ff8-add9-0511cccd1a00 Correlation ID: 27ac0ad5-86e9-49e9-8d98-40991ee15e35 Timestamp: 2026-04-23 10:58:55Z - Correlation ID: 27ac0ad5-86e9-49e9-8d98-40991ee15e35 - Trace ID: 4c962112-15de-4ff8-add9-0511cccd1a00
Error getting the secret: invalid_client: 7000222 - [2026-04-23 10:58:55Z]: 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: 7d00060e-30b3-4a05-8d1e-103d9db52f00 Correlation ID: 7ff2a7ab-56b6-4d21-ac08-9d82f22c9f2f Timestamp: 2026-04-23 10:58:55Z - Correlation ID: 7ff2a7ab-56b6-4d21-ac08-9d82f22c9f2f - Trace ID: 7d00060e-30b3-4a05-8d1e-103d9db52f00
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)