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-24 12:30:12Z]: 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: 465d6c92-04a8-4e1c-8a28-459712007100 Correlation ID: ecc9d2f7-a5bd-454c-bef5-7c7ac331930f Timestamp: 2026-04-24 12:30:12Z - Correlation ID: ecc9d2f7-a5bd-454c-bef5-7c7ac331930f - Trace ID: 465d6c92-04a8-4e1c-8a28-459712007100
(node:472) [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-24 12:30:12Z]: 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: cb65be74-029e-423a-86b7-1462b8e31500 Correlation ID: abf11ed3-5908-44a3-b0d0-9e64eb4d498d Timestamp: 2026-04-24 12:30:12Z - Correlation ID: abf11ed3-5908-44a3-b0d0-9e64eb4d498d - Trace ID: cb65be74-029e-423a-86b7-1462b8e31500
Error getting the secret: invalid_client: 7000222 - [2026-04-24 12:30:13Z]: 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: c65f8413-9664-48ab-9020-e099a2380300 Correlation ID: 3d6a0440-0afa-444a-95a7-3773185b1ce7 Timestamp: 2026-04-24 12:30:13Z - Correlation ID: 3d6a0440-0afa-444a-95a7-3773185b1ce7 - Trace ID: c65f8413-9664-48ab-9020-e099a2380300
Error getting the secret: invalid_client: 7000222 - [2026-04-24 12:30:13Z]: 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: 2c989958-df8c-48d5-aeee-819cdf5d0800 Correlation ID: 10bb324d-54fd-4a25-9cab-e762ff3a81c3 Timestamp: 2026-04-24 12:30:13Z - Correlation ID: 10bb324d-54fd-4a25-9cab-e762ff3a81c3 - Trace ID: 2c989958-df8c-48d5-aeee-819cdf5d0800
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)