You create an Azure Function that must connect to a Cosmos DB. Cosmos DB is replicated to the following regions that support read and write:
West US 2
You need to use a singleton pattern to create a connection to the Cosmos DB.
How many connections to Cosmos DB should the Azure Function establish?
The singleton pattern is a widely used software design pattern that limits the instantiation of a class to one object. This is helpful when you need exactly one object to coordinate system actions. Because you want to use the singleton pattern to create connection to the Cosmos DB, you should establish a single connection.
You should not establish two, three or four connections to Cosmos DB, because in that case you would not follow the singleton pattern.