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-08 13:23:24Z]: 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: d9ebcb1a-194b-4848-b3d2-cff094f93000 Correlation ID: d3592013-3d0d-420a-8e64-89db3752bf15 Timestamp: 2026-04-08 13:23:24Z - Correlation ID: d3592013-3d0d-420a-8e64-89db3752bf15 - Trace ID: d9ebcb1a-194b-4848-b3d2-cff094f93000
(node:3624) [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-08 13:23:24Z]: 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: c2e44f30-c9bd-4330-ae7a-067865e30300 Correlation ID: b2bb602b-d0ec-4d26-852a-964aaac62f0e Timestamp: 2026-04-08 13:23:24Z - Correlation ID: b2bb602b-d0ec-4d26-852a-964aaac62f0e - Trace ID: c2e44f30-c9bd-4330-ae7a-067865e30300
Error getting the secret: invalid_client: 7000222 - [2026-04-08 13:23:24Z]: 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: 2693b2b2-8b30-4c30-b2d8-9ecc23513200 Correlation ID: 793b9fda-52dc-4fe1-85ed-2685e80f6bb9 Timestamp: 2026-04-08 13:23:24Z - Correlation ID: 793b9fda-52dc-4fe1-85ed-2685e80f6bb9 - Trace ID: 2693b2b2-8b30-4c30-b2d8-9ecc23513200
Error getting the secret: invalid_client: 7000222 - [2026-04-08 13:23:25Z]: 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: 4fb4b8b1-350d-4bfc-a633-f6ee4de93500 Correlation ID: 97a5208c-f667-4844-81cc-a53c9aa0926e Timestamp: 2026-04-08 13:23:25Z - Correlation ID: 97a5208c-f667-4844-81cc-a53c9aa0926e - Trace ID: 4fb4b8b1-350d-4bfc-a633-f6ee4de93500
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)