Skip to content

Commit

Permalink
ensuring cosmos client has valid url
Browse files Browse the repository at this point in the history
  • Loading branch information
srijan55 committed Oct 3, 2024
1 parent f4a9ae7 commit 26dc092
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pctasks/core/pctasks/core/cosmos/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def get_client(self) -> CosmosClient:
else:
# If the connection string is not set, the credetials are
# automatically picked up from the environment/managed identity
assert self.url
credential = DefaultAzureCredential()
return CosmosClient(
self.url, credential=credential, connection_verify=connection_verify
Expand All @@ -145,6 +146,7 @@ def get_async_client(self) -> AsyncCosmosClient:
else:
# 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()
return AsyncCosmosClient(
self.url, credential=credential, connection_verify=connection_verify
Expand Down

0 comments on commit 26dc092

Please sign in to comment.