Commit 92062af7 by Oleksandr Barabash

client_id added

parent 59e3c40c
......@@ -23,6 +23,7 @@ class TaskModuleConfig:
class AppConfig:
""" Bot Configuration """
CLIENT_ID = os.environ.get("CLIENT_ID", None)
PORT = os.environ.get("HOST_PORT", 8000)
TENANT_ID = os.environ.get("TENANT_ID",
"5df91ebc-64fa-4aa1-862c-bdc0cba3c656")
......
......@@ -12,6 +12,7 @@ from botbuilder.core import TurnContext
from botbuilder.schema import ChannelAccount
from marshmallow import EXCLUDE
from config import AppConfig
from entities.json.acknowledge import Acknowledge
from entities.json.acknowledge_schema import AcknowledgeSchema
from entities.json.camel_case_mixin import timestamp_factory
......@@ -50,7 +51,9 @@ class CosmosClient:
""" Cosmos Client class """
def __init__(self, host: str, master_key: str):
self.executor = futures.ThreadPoolExecutor()
mgmt_credentials = ManagedIdentityCredential()
mgmt_credentials = ManagedIdentityCredential(
client_id=AppConfig.CLIENT_ID
)
self.client = cosmos_client.CosmosClient(host, mgmt_credentials)
# self.client = cosmos_client.CosmosClient(host,
# dict(masterKey=master_key))
......
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