An Azure service that provides an event-driven serverless compute platform.
@Zehou Zhang As per the error, it looks like the socket exception and the reason for this error is that you reached the limit of the maximum available socket at your function app and sandbox disabled access for new sockets.
As per your code, I am not sure if you are calling executeCmnd method on every invocation. If this is the case then the suggestion is not to create a new connection to the Cosmo DB for every request coming to your function. You should only create the connection once and reuse it.
I will suggest you to review managing cosmo DB clients as mentioned in this document and define the static client object while creating the connection.
You can define the below line of code as static and outside your function app invocation but within the class.
var gremlinServer = new GremlinServer(_dbConfig.HostName, _dbConfig.Port, enableSsl: true, username: "/dbs/" + _dbConfig.Database + "/colls/" + _dbConfig.Collection, password: _dbConfig.AuthKey);
Feel free to get back to me if you need any assistance.