Commit c1a5cf64 by Oleksandr Barabash

ManagedIdentityCredential changed to DefaultAzureCredential

parent 61a1df2a
...@@ -7,7 +7,7 @@ from typing import Any, Dict, Optional, Union, List ...@@ -7,7 +7,7 @@ from typing import Any, Dict, Optional, Union, 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 ManagedIdentityCredential from azure.identity import ManagedIdentityCredential, 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
...@@ -50,7 +50,7 @@ class CosmosClient: ...@@ -50,7 +50,7 @@ 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()
mgmt_credentials = ManagedIdentityCredential() mgmt_credentials = DefaultAzureCredential()
self.client = cosmos_client.CosmosClient(host, mgmt_credentials) self.client = cosmos_client.CosmosClient(host, mgmt_credentials)
# self.client = cosmos_client.CosmosClient(host, # self.client = cosmos_client.CosmosClient(host,
# dict(masterKey=master_key)) # 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