Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
183de997
Commit
183de997
authored
Aug 26, 2022
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CosmosClient init changed to client_id
parent
92062af7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
config.py
config.py
+1
-1
cosmos_client.py
utils/cosmos_client.py
+2
-5
No files found.
config.py
View file @
183de997
...
@@ -71,4 +71,4 @@ class CosmosDBConfig:
...
@@ -71,4 +71,4 @@ class CosmosDBConfig:
PARTITION_KEY
=
PartitionKey
(
path
=
"/notificationId"
)
PARTITION_KEY
=
PartitionKey
(
path
=
"/notificationId"
)
COSMOS_CLIENT
=
CosmosClient
(
CosmosDBConfig
.
HOST
,
CosmosDBConfig
.
KEY
)
COSMOS_CLIENT
=
CosmosClient
(
CosmosDBConfig
.
HOST
,
AppConfig
.
CLIENT_ID
)
utils/cosmos_client.py
View file @
183de997
...
@@ -12,7 +12,6 @@ from botbuilder.core import TurnContext
...
@@ -12,7 +12,6 @@ from botbuilder.core import TurnContext
from
botbuilder.schema
import
ChannelAccount
from
botbuilder.schema
import
ChannelAccount
from
marshmallow
import
EXCLUDE
from
marshmallow
import
EXCLUDE
from
config
import
AppConfig
from
entities.json.acknowledge
import
Acknowledge
from
entities.json.acknowledge
import
Acknowledge
from
entities.json.acknowledge_schema
import
AcknowledgeSchema
from
entities.json.acknowledge_schema
import
AcknowledgeSchema
from
entities.json.camel_case_mixin
import
timestamp_factory
from
entities.json.camel_case_mixin
import
timestamp_factory
...
@@ -49,11 +48,9 @@ class ItemNotFound(CosmosClientException):
...
@@ -49,11 +48,9 @@ class ItemNotFound(CosmosClientException):
class
CosmosClient
:
class
CosmosClient
:
""" Cosmos Client class """
""" Cosmos Client class """
def
__init__
(
self
,
host
:
str
,
master_key
:
str
):
def
__init__
(
self
,
host
:
str
,
client_id
:
str
):
self
.
executor
=
futures
.
ThreadPoolExecutor
()
self
.
executor
=
futures
.
ThreadPoolExecutor
()
mgmt_credentials
=
ManagedIdentityCredential
(
mgmt_credentials
=
ManagedIdentityCredential
(
client_id
=
client_id
)
client_id
=
AppConfig
.
CLIENT_ID
)
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))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment