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-05-13 23:51:06Z]: 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: cd11aaf2-992a-4bba-99fe-da2d75035d00 Correlation ID: ef1c0075-23dc-47bf-a2d6-bd5812a1de18 Timestamp: 2026-05-13 23:51:06Z - Correlation ID: ef1c0075-23dc-47bf-a2d6-bd5812a1de18 - Trace ID: cd11aaf2-992a-4bba-99fe-da2d75035d00
(node:2872) [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-05-13 23:51:06Z]: 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: cc23fd45-eb2f-4823-ba54-e971c56d0700 Correlation ID: 504f85bf-b722-442f-932c-e1fd7ae0588c Timestamp: 2026-05-13 23:51:06Z - Correlation ID: 504f85bf-b722-442f-932c-e1fd7ae0588c - Trace ID: cc23fd45-eb2f-4823-ba54-e971c56d0700
Error getting the secret: invalid_client: 7000222 - [2026-05-13 23:51:06Z]: 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: b6cf0cf8-c23b-418d-a633-786e75b32100 Correlation ID: 878736c8-5da4-4025-b1c9-49ead3e32765 Timestamp: 2026-05-13 23:51:06Z - Correlation ID: 878736c8-5da4-4025-b1c9-49ead3e32765 - Trace ID: b6cf0cf8-c23b-418d-a633-786e75b32100
Error getting the secret: invalid_client: 7000222 - [2026-05-13 23:51:06Z]: 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: 355ba167-1abb-4551-93f6-897c3ce46b00 Correlation ID: 1d112b71-a625-49d5-a49a-0a94d7efe8f5 Timestamp: 2026-05-13 23:51:06Z - Correlation ID: 1d112b71-a625-49d5-a49a-0a94d7efe8f5 - Trace ID: 355ba167-1abb-4551-93f6-897c3ce46b00
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)