Commit b62b6fea by Oleksandr Barabash

DB credentials changed to AAD default creds

parent a168a012
...@@ -8,6 +8,7 @@ from typing import Any, Dict, Optional, Union, Iterable, List ...@@ -8,6 +8,7 @@ from typing import Any, Dict, Optional, Union, Iterable, List
import azure.cosmos.cosmos_client as cosmos_client import azure.cosmos.cosmos_client as cosmos_client
import azure.cosmos.exceptions as exceptions import azure.cosmos.exceptions as exceptions
from azure.cosmos import DatabaseProxy, ContainerProxy from azure.cosmos import DatabaseProxy, ContainerProxy
from azure.identity import DefaultAzureCredential
from botbuilder.core import TurnContext from botbuilder.core import TurnContext
from botbuilder.schema import ChannelAccount from botbuilder.schema import ChannelAccount
from marshmallow import EXCLUDE from marshmallow import EXCLUDE
...@@ -52,8 +53,10 @@ class CosmosClient: ...@@ -52,8 +53,10 @@ class CosmosClient:
""" Cosmos Client class """ """ Cosmos Client class """
def __init__(self, host: str, master_key: str): def __init__(self, host: str, master_key: str):
self.executor = futures.ThreadPoolExecutor() self.executor = futures.ThreadPoolExecutor()
self.client = cosmos_client.CosmosClient(host, aad_credentials = DefaultAzureCredential()
dict(masterKey=master_key)) self.client = cosmos_client.CosmosClient(host, aad_credentials)
# self.client = cosmos_client.CosmosClient(host,
# dict(masterKey=master_key))
async def execute_blocking(self, bl, *args): async def execute_blocking(self, bl, *args):
""" Execute blocking code """ """ Execute blocking code """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment