From 26dc092bfc648fe70c7b1d7262d08afac2be2d73 Mon Sep 17 00:00:00 2001 From: Manish Kumar Gupta Date: Wed, 2 Oct 2024 21:54:36 -0700 Subject: [PATCH] ensuring cosmos client has valid url --- pctasks/core/pctasks/core/cosmos/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pctasks/core/pctasks/core/cosmos/settings.py b/pctasks/core/pctasks/core/cosmos/settings.py index 66fa4212..4aa9a795 100644 --- a/pctasks/core/pctasks/core/cosmos/settings.py +++ b/pctasks/core/pctasks/core/cosmos/settings.py @@ -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 @@ -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