13 lines
332 B
Python
13 lines
332 B
Python
|
|
import azure.cosmos.cosmos_client as cosmos_client
|
||
|
|
|
||
|
|
from anaxi.config import CosmosDBDatabaseConfig
|
||
|
|
|
||
|
|
|
||
|
|
def create_cosmos_client_from_config(
|
||
|
|
config: CosmosDBDatabaseConfig,
|
||
|
|
) -> cosmos_client.CosmosClient:
|
||
|
|
return cosmos_client.CosmosClient(
|
||
|
|
url=config.host,
|
||
|
|
credential={"masterKey": config.master_key},
|
||
|
|
)
|