|
15 | 15 |
|
16 | 16 | from application_sdk.clients import ClientInterface |
17 | 17 | from application_sdk.clients.azure.azure_auth import AzureAuthProvider |
18 | | -from application_sdk.common.credential_utils import resolve_credentials |
19 | 18 | from application_sdk.common.error_codes import ClientError |
20 | 19 | from application_sdk.observability.logger_adaptor import get_logger |
21 | 20 |
|
@@ -82,8 +81,22 @@ async def load(self, credentials: Optional[Dict[str, Any]] = None) -> None: |
82 | 81 | try: |
83 | 82 | logger.info("Loading Azure client...") |
84 | 83 |
|
85 | | - # Resolve credentials using framework's credential resolution |
86 | | - self.resolved_credentials = await resolve_credentials(self.credentials) |
| 84 | + # Handle credential resolution |
| 85 | + if "credential_guid" in self.credentials: |
| 86 | + # If we have a credential_guid, use the async get_credentials function |
| 87 | + from application_sdk.common.credential_utils import get_credentials |
| 88 | + self.resolved_credentials = await get_credentials(self.credentials["credential_guid"]) |
| 89 | + else: |
| 90 | + # If credentials are already resolved (direct format), use them as-is |
| 91 | + # For direct credentials, we need to check if they need resolution |
| 92 | + if "secret-path" in self.credentials or "credentialSource" in self.credentials: |
| 93 | + # Credentials need resolution - this is a complex case |
| 94 | + # For now, assume credentials are already resolved if no credential_guid |
| 95 | + logger.warning("Credentials appear to need resolution but no credential_guid provided. Using as-is.") |
| 96 | + self.resolved_credentials = self.credentials |
| 97 | + else: |
| 98 | + # Credentials are already in the correct format |
| 99 | + self.resolved_credentials = self.credentials |
87 | 100 |
|
88 | 101 | # Create Azure credential using Service Principal authentication |
89 | 102 | self.credential = await self.auth_provider.create_credential( |
|
0 commit comments