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-09 19:52: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: 2b8086b4-5c6c-47b8-ad1a-ae4996d23a01 Correlation ID: 07fd7d0c-0864-4d2a-979d-ebd611a441a5 Timestamp: 2026-03-09 19:52:37Z - Correlation ID: 07fd7d0c-0864-4d2a-979d-ebd611a441a5 - Trace ID: 2b8086b4-5c6c-47b8-ad1a-ae4996d23a01
(node:4936) [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-09 19:52:38Z]: 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: e0d9c6e3-3b82-4305-8347-b60eef6a8d00 Correlation ID: c1896c23-8b93-46d0-a7b7-64834c04588f Timestamp: 2026-03-09 19:52:38Z - Correlation ID: c1896c23-8b93-46d0-a7b7-64834c04588f - Trace ID: e0d9c6e3-3b82-4305-8347-b60eef6a8d00
Error getting the secret: invalid_client: 7000222 - [2026-03-09 19:52:38Z]: 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: e1fe6801-95ff-4b4f-bd95-5462855abd00 Correlation ID: 38559fda-4a5b-45b4-8eb1-8d2cdb85c4ca Timestamp: 2026-03-09 19:52:38Z - Correlation ID: 38559fda-4a5b-45b4-8eb1-8d2cdb85c4ca - Trace ID: e1fe6801-95ff-4b4f-bd95-5462855abd00
Error getting the secret: invalid_client: 7000222 - [2026-03-09 19:52:38Z]: 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: bcf8945c-adea-411b-ad22-75d435980100 Correlation ID: 78e66ce0-8974-45b1-94dd-29548b4f5207 Timestamp: 2026-03-09 19:52:38Z - Correlation ID: 78e66ce0-8974-45b1-94dd-29548b4f5207 - Trace ID: bcf8945c-adea-411b-ad22-75d435980100
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)