Is there an existing issue for this?
Problem statement
Let AzureResourcePermissions._get_storage_accounts return databricks.labs.ucx.azure.resources.StorageAccount instead of str. Now, we have code repetition every where _get_storage_accounts is used, the following loop is applied to get the StorageAccount object:
storage_accounts = []
for storage in self._azurerm.storage_accounts():
if storage.name in used_storage_accounts:
storage_accounts.append(storage)
Proposed Solution
To reduce code repetition, move the above loop into _get_storage_accounts and adjust the code to use the StorageAccount object instead of the str.
Additional Context
No response
Is there an existing issue for this?
Problem statement
Let
AzureResourcePermissions._get_storage_accountsreturndatabricks.labs.ucx.azure.resources.StorageAccountinstead ofstr. Now, we have code repetition every where_get_storage_accountsis used, the following loop is applied to get theStorageAccountobject:Proposed Solution
To reduce code repetition, move the above loop into
_get_storage_accountsand adjust the code to use theStorageAccountobject instead of thestr.Additional Context
No response