Skip to content

[TECH DEBT]: Let AzureResourcePermissions._get_storage_accounts return databricks.labs.ucx.azure.resources.StorageAccount instead of str #2363

@JCZuurmond

Description

@JCZuurmond

Is there an existing issue for this?

  • I have searched the existing issues

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

Metadata

Metadata

Assignees

Labels

internalthis pull request won't appear in release notesneeds-triagetech debtchores and design flaws

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions