Skip to content

Commit 19b38a5

Browse files
committed
fix: updated as per comments
1 parent 1d74080 commit 19b38a5

File tree

9 files changed

+47
-1059
lines changed

9 files changed

+47
-1059
lines changed
Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +0,0 @@
1-
"""
2-
Azure client module for the application-sdk framework.
3-
4-
This module provides a unified interface for connecting to and interacting
5-
with Azure Storage services including Blob Storage and Data Lake Storage Gen2.
6-
7-
The module includes:
8-
- AzureClient: Main client for unified Azure service access
9-
- AzureAuthProvider: Authentication provider for different Azure auth methods
10-
- AzureStorageClient: Storage service client for Blob and Data Lake Storage
11-
- Utilities: Common Azure helper functions
12-
"""
13-
14-
from .azure import AzureClient
15-
from .azure_auth import AzureAuthProvider
16-
from .azure_services import AzureStorageClient
17-
from .azure_utils import (
18-
build_azure_connection_string,
19-
extract_azure_resource_info,
20-
format_azure_error_message,
21-
get_azure_service_endpoint,
22-
parse_azure_url,
23-
validate_azure_credentials,
24-
validate_azure_permissions,
25-
)
26-
27-
__all__ = [
28-
# Main client
29-
"AzureClient",
30-
# Authentication
31-
"AzureAuthProvider",
32-
# Service-specific clients
33-
"AzureStorageClient",
34-
# Utilities
35-
"parse_azure_url",
36-
"validate_azure_credentials",
37-
"build_azure_connection_string",
38-
"extract_azure_resource_info",
39-
"validate_azure_permissions",
40-
"get_azure_service_endpoint",
41-
"format_azure_error_message",
42-
]
43-
44-
__version__ = "0.1.0"

application_sdk/clients/azure/azure.py

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
from application_sdk.clients import ClientInterface
1717
from application_sdk.clients.azure.azure_auth import AzureAuthProvider
18-
from application_sdk.clients.azure.azure_services import AzureStorageClient
1918
from application_sdk.common.credential_utils import resolve_credentials
2019
from application_sdk.common.error_codes import ClientError
2120
from application_sdk.observability.logger_adaptor import get_logger
@@ -28,7 +27,7 @@ class AzureClient(ClientInterface):
2827
Main Azure client for the application-sdk framework.
2928
3029
This client provides a unified interface for connecting to and interacting
31-
with Azure Storage services. It supports Service Principal authentication
30+
with Azure services. It supports Service Principal authentication
3231
and provides service-specific subclients for different Azure services.
3332
3433
Attributes:
@@ -136,38 +135,13 @@ async def close(self) -> None:
136135
except Exception as e:
137136
logger.error(f"Error closing Azure client: {str(e)}")
138137

139-
async def get_storage_client(self) -> AzureStorageClient:
140-
"""
141-
Get Azure Storage service client.
142-
143-
Returns:
144-
AzureStorageClient: Configured Azure Storage client.
145-
146-
Raises:
147-
ClientError: If client is not loaded or storage client creation fails.
148-
"""
149-
if not self._connection_health:
150-
raise ClientError(f"{ClientError.CLIENT_AUTH_ERROR}: Client not loaded")
151-
152-
if "storage" not in self._services:
153-
try:
154-
self._services["storage"] = AzureStorageClient(
155-
credential=self.credential, **self._kwargs
156-
)
157-
await self._services["storage"].load(self.resolved_credentials)
158-
except Exception as e:
159-
logger.error(f"Failed to create storage client: {str(e)}")
160-
raise ClientError(f"{ClientError.CLIENT_AUTH_ERROR}: {str(e)}")
161-
162-
return self._services["storage"]
163-
164138
async def get_service_client(self, service_type: str) -> Any:
165139
"""
166140
Get a service client by type.
167141
168142
Args:
169143
service_type (str): Type of service client to retrieve.
170-
Supported values: 'storage'.
144+
Currently no services are supported.
171145
172146
Returns:
173147
Any: The requested service client.
@@ -176,14 +150,7 @@ async def get_service_client(self, service_type: str) -> Any:
176150
ValueError: If service_type is not supported.
177151
ClientError: If client creation fails.
178152
"""
179-
service_mapping = {
180-
"storage": self.get_storage_client,
181-
}
182-
183-
if service_type not in service_mapping:
184-
raise ValueError(f"Unsupported service type: {service_type}")
185-
186-
return await service_mapping[service_type]()
153+
raise ValueError(f"Unsupported service type: {service_type}")
187154

188155
async def health_check(self) -> Dict[str, Any]:
189156
"""

application_sdk/clients/azure/azure_auth.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,3 @@ async def validate_credential(self, credential: TokenCredential) -> bool:
149149
except Exception as e:
150150
logger.error(f"Azure credential validation failed: {str(e)}")
151151
return False
152-
153-
def get_supported_auth_types(self) -> list[str]:
154-
"""
155-
Get list of supported authentication types.
156-
157-
Returns:
158-
list[str]: List of supported authentication types.
159-
"""
160-
return ["service_principal"]

application_sdk/clients/azure/azure_services/__init__.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)