Skip to content

Commit

Permalink
For integration tests, we still define key. Code uses key if defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
srijan55 committed Oct 6, 2024
1 parent 9691aa3 commit 6560ae0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pctasks/core/pctasks/core/cosmos/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_client(self) -> CosmosClient:
# If the connection string is not set, the credetials are
# automatically picked up from the environment/managed identity
assert self.url
credential = DefaultAzureCredential()
credential = self.key or DefaultAzureCredential()
return CosmosClient(
self.url, credential=credential, connection_verify=connection_verify
)
Expand All @@ -147,7 +147,7 @@ def get_async_client(self) -> AsyncCosmosClient:
# If the connection string is not set, the credetials are
# automatically picked up from the environment/managed identity
assert self.url
credential = azure.identity.aio.DefaultAzureCredential()
credential = self.key or azure.identity.aio.DefaultAzureCredential()
return AsyncCosmosClient(
self.url, credential=credential, connection_verify=connection_verify
)

0 comments on commit 6560ae0

Please sign in to comment.