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-16 21:35:18Z]: 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: 1cbd91c7-3704-4323-b5f4-1fbcb7541900 Correlation ID: b46d09fb-2972-4d7e-84d2-6db11456da55 Timestamp: 2026-04-16 21:35:18Z - Correlation ID: b46d09fb-2972-4d7e-84d2-6db11456da55 - Trace ID: 1cbd91c7-3704-4323-b5f4-1fbcb7541900
(node:376) [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-16 21:35:18Z]: 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: e489ccd3-3c8a-4a55-bdd1-c1005c692100 Correlation ID: b32b8cd9-7bf1-4178-a535-f25ba8d5b0b6 Timestamp: 2026-04-16 21:35:18Z - Correlation ID: b32b8cd9-7bf1-4178-a535-f25ba8d5b0b6 - Trace ID: e489ccd3-3c8a-4a55-bdd1-c1005c692100
Error getting the secret: invalid_client: 7000222 - [2026-04-16 21:35:18Z]: 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: 8d43a8ad-6861-4556-83d0-723e56ea2900 Correlation ID: c9bdbf71-41a8-4312-b5a3-f593d0e4e0d9 Timestamp: 2026-04-16 21:35:18Z - Correlation ID: c9bdbf71-41a8-4312-b5a3-f593d0e4e0d9 - Trace ID: 8d43a8ad-6861-4556-83d0-723e56ea2900
Error getting the secret: invalid_client: 7000222 - [2026-04-16 21:35: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: def0d4d8-feb5-423e-9982-1072bc284d00 Correlation ID: 18e11655-55d2-4a80-bc03-33232adc36d9 Timestamp: 2026-04-16 21:35:19Z - Correlation ID: 18e11655-55d2-4a80-bc03-33232adc36d9 - Trace ID: def0d4d8-feb5-423e-9982-1072bc284d00
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)