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-02-22 10:32:19Z]: 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: 78b465b9-24a1-4d7f-99df-7b4c13084000 Correlation ID: d73299d3-4afd-49b4-b7ca-5392d0d1f104 Timestamp: 2026-02-22 10:32:19Z - Correlation ID: d73299d3-4afd-49b4-b7ca-5392d0d1f104 - Trace ID: 78b465b9-24a1-4d7f-99df-7b4c13084000
(node:4896) [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-02-22 10:32:19Z]: 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: afe2ba89-57ca-40b1-97dd-0e2988474c00 Correlation ID: 21475a36-16cc-4599-892c-92647be861a8 Timestamp: 2026-02-22 10:32:19Z - Correlation ID: 21475a36-16cc-4599-892c-92647be861a8 - Trace ID: afe2ba89-57ca-40b1-97dd-0e2988474c00
Error getting the secret: invalid_client: 7000222 - [2026-02-22 10:32:19Z]: 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: ba4f023c-77a3-46da-97a3-f597c2264300 Correlation ID: b1d407db-e68a-4f14-9c95-4b527c28714f Timestamp: 2026-02-22 10:32:19Z - Correlation ID: b1d407db-e68a-4f14-9c95-4b527c28714f - Trace ID: ba4f023c-77a3-46da-97a3-f597c2264300
Error getting the secret: invalid_client: 7000222 - [2026-02-22 10:32:20Z]: 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: 78c234cb-9cac-438c-be67-ce16be474800 Correlation ID: 0125af2e-90f5-427e-b96d-52a574eafd5d Timestamp: 2026-02-22 10:32:20Z - Correlation ID: 0125af2e-90f5-427e-b96d-52a574eafd5d - Trace ID: 78c234cb-9cac-438c-be67-ce16be474800
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)