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
92062af7
Commit
92062af7
authored
Aug 26, 2022
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client_id added
parent
59e3c40c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
config.py
config.py
+1
-0
cosmos_client.py
utils/cosmos_client.py
+4
-1
No files found.
config.py
View file @
92062af7
...
...
@@ -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"
)
...
...
utils/cosmos_client.py
View file @
92062af7
...
...
@@ -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))
...
...
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