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-03 03:56: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: bfa5fa7d-672f-43a3-ade3-207c74225200 Correlation ID: 9f17af90-e53e-418c-9c82-9d42cfa32e43 Timestamp: 2026-05-03 03:56:06Z - Correlation ID: 9f17af90-e53e-418c-9c82-9d42cfa32e43 - Trace ID: bfa5fa7d-672f-43a3-ade3-207c74225200
(node:6040) [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-03 03:56: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: 05891afb-9864-4c5b-b4b8-6ce7df424c00 Correlation ID: 038000dc-fc9e-4494-aafa-4e11547170fa Timestamp: 2026-05-03 03:56:06Z - Correlation ID: 038000dc-fc9e-4494-aafa-4e11547170fa - Trace ID: 05891afb-9864-4c5b-b4b8-6ce7df424c00
Error getting the secret: invalid_client: 7000222 - [2026-05-03 03:56: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: 429e366b-a32b-4e8c-be9e-7072cc4d4d00 Correlation ID: fd7c622e-5a1b-4b78-b7dd-043cb18bf9f3 Timestamp: 2026-05-03 03:56:06Z - Correlation ID: fd7c622e-5a1b-4b78-b7dd-043cb18bf9f3 - Trace ID: 429e366b-a32b-4e8c-be9e-7072cc4d4d00
Error getting the secret: invalid_client: 7000222 - [2026-05-03 03:56:07Z]: 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: 1d986803-75ad-4a2f-982a-65ccd6054600 Correlation ID: 77d4cb80-6954-40e4-b034-5a29d7bb19b7 Timestamp: 2026-05-03 03:56:07Z - Correlation ID: 77d4cb80-6954-40e4-b034-5a29d7bb19b7 - Trace ID: 1d986803-75ad-4a2f-982a-65ccd6054600
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)