error when setting up cosmos db in Enable automatic updates in a web application using Azure Functions and SignalR Service

Jan Boije 0 Reputation points
2023-08-07T10:05:52.4266667+00:00

Get the following error when running the azure function locally, anyone got any tips on how to solve this?

Executing 'Functions.getStocks' (Reason='This function was programmatically called via the host APIs.', Id=a4a0bd4a-d21e-45ff-9e28-5f84f6562468)

[2023-08-07T10:01:26.178Z] Error setting up database: Error: write EPROTO 181F0000:error:0A00014D:SSL routines:tls_process_key_exchange:legacy sigalg disallowed or unsupported:c:\ws\deps\openssl\openssl\ssl\statem\statem_clnt.c:2263:

[2023-08-07T10:01:26.181Z] at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)

[2023-08-07T10:01:26.182Z] at WriteWrap.callbackTrampoline (node:internal/async_hooks:130:17) {

[2023-08-07T10:01:26.184Z] errno: -4046,

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,070 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
146 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,657 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,336 Reputation points
    2023-08-09T17:48:41.85+00:00

    Jan Boije Thanks for posting your question in Microsoft Q&A. Based on your description, you followed training path: https://learn.microsoft.com/en-us/training/modules/automatic-update-of-a-webapp-using-azure-functions-and-signalr/ and got the above error. Is that correct?

    The full code snippet for the tutorial is available in https://github.com/MicrosoftDocs/mslearn-advocates.azure-functions-and-signalr/tree/master/end repo and found a similar discussion about this tls_process_key_exchange error pointing to https://github.com/MicrosoftDocs/mslearn-advocates.azure-functions-and-signalr/issues/41#issuecomment-1473677091 resolution.


    Solution:

    That can be solved by bumping the Cosmos DB client to the latest version like that in package.json:

    "@azure/cosmos": "^3.17.3",

    That would require small change in the db.js file:

    client = new CosmosClient({ endpoint, key: masterKey });


    Please try the suggestion and let me know if you face the issue.

    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.