mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 20:08:09 +00:00
use the cached Azure Identity instance for storage operations (#526)
This commit is contained in:
@ -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()
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user