-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend service principal migration to create storage credentials for …
…access connectors created for each storage account (#1426) ## Changes Extend service principal migration to create storage credentials for access connectors created for each storage account ### Linked issues Resolves #1384 Resolves #875 ### To do - [x] Update docs on creating access connectors. - [x] First prompt for creating credentials for access connectors, then for service princpals - [x] Use the storage credentials in [external locations](https://github.com/databrickslabs/ucx/blob/main/src/databricks/labs/ucx/azure/locations.py#L65) ### Functionality - [ ] added relevant user documentation - [ ] added new CLI command - [x] modified existing command: `databricks labs ucx ...` - [ ] added a new workflow - [ ] modified existing workflow: `...` - [ ] added a new table - [ ] modified existing table: `...` ### Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] manually tested - [x] added unit tests - [x] added integration tests - [ ] verified on staging environment (screenshot attached) --------- Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com> Co-authored-by: vuong-nguyen <44292934+nkvuong@users.noreply.github.com>
- Loading branch information
1 parent
c344dae
commit 93fb559
Showing
13 changed files
with
634 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import pytest | ||
|
||
|
||
def delete_ucx_created_resources(api_client): | ||
"""Delete UCX created resources""" | ||
for resource in api_client.list(): | ||
if resource.name is not None and resource.comment is not None and resource.comment == "Created by UCX": | ||
api_client.delete(resource.name, force=True) | ||
|
||
|
||
@pytest.fixture | ||
def clean_storage_credentials(az_cli_ctx): | ||
"""Clean test generated storage credentials.""" | ||
delete_ucx_created_resources(az_cli_ctx.workspace_client.storage_credentials) | ||
yield | ||
delete_ucx_created_resources(az_cli_ctx.workspace_client.storage_credentials) | ||
|
||
|
||
@pytest.fixture | ||
def clean_external_locations(az_cli_ctx): | ||
"""Clean test generated external locations.""" | ||
delete_ucx_created_resources(az_cli_ctx.workspace_client.external_locations) | ||
yield | ||
delete_ucx_created_resources(az_cli_ctx.workspace_client.external_locations) |
Oops, something went wrong.