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-03-28 02:40:54Z]: 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: 96439c9a-1fdc-4020-b6e6-2f35f50a0000 Correlation ID: 641dbafc-46fd-4792-bb0b-11c11a8c92ca Timestamp: 2026-03-28 02:40:54Z - Correlation ID: 641dbafc-46fd-4792-bb0b-11c11a8c92ca - Trace ID: 96439c9a-1fdc-4020-b6e6-2f35f50a0000
(node:4548) [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-03-28 02:40:54Z]: 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: db0b9931-9a84-4d55-a817-a0e915734700 Correlation ID: d39af72d-14f2-4e73-af89-2544b48622e4 Timestamp: 2026-03-28 02:40:54Z - Correlation ID: d39af72d-14f2-4e73-af89-2544b48622e4 - Trace ID: db0b9931-9a84-4d55-a817-a0e915734700
Error getting the secret: invalid_client: 7000222 - [2026-03-28 02:40:54Z]: 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: 96439c9a-1fdc-4020-b6e6-2f35020b0000 Correlation ID: 3c20568f-8675-4e3f-8542-c1695b8be492 Timestamp: 2026-03-28 02:40:54Z - Correlation ID: 3c20568f-8675-4e3f-8542-c1695b8be492 - Trace ID: 96439c9a-1fdc-4020-b6e6-2f35020b0000
Error getting the secret: invalid_client: 7000222 - [2026-03-28 02:40:55Z]: 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: 74ce03e5-45ca-455d-a319-ad4ff52e1500 Correlation ID: dd7fde35-1c1b-43fa-b97a-ed514f8ade94 Timestamp: 2026-03-28 02:40:55Z - Correlation ID: dd7fde35-1c1b-43fa-b97a-ed514f8ade94 - Trace ID: 74ce03e5-45ca-455d-a319-ad4ff52e1500
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)