use the cached Azure Identity instance for storage operations
@@ -9,12 +9,11 @@ import random
from enum import Enum
from typing import List, Tuple, cast
-from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
from memoization import cached
from msrestazure.tools import parse_resource_id
-from .creds import get_base_resource_group, get_subscription
+from .creds import get_base_resource_group, get_identity, get_subscription
class StorageType(Enum):
@@ -25,7 +24,7 @@ class StorageType(Enum):
@cached
def get_mgmt_client() -> StorageManagementClient:
return StorageManagementClient(
- credential=DefaultAzureCredential(), subscription_id=get_subscription()
+ credential=get_identity(), subscription_id=get_subscription()
)
