diff --git a/pctasks/core/pctasks/core/cosmos/settings.py b/pctasks/core/pctasks/core/cosmos/settings.py index 4aa9a795..313d533c 100644 --- a/pctasks/core/pctasks/core/cosmos/settings.py +++ b/pctasks/core/pctasks/core/cosmos/settings.py @@ -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 ) @@ -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 )