Update the registration logic to print manual steps when adal authentication fails (#447)

Mitigate the deployment issue related to the conditional access policy.
The registration logic is updated to use the old rbac python library when possible. 
The deployment will print some manual step for operations that cannot be automated
This commit is contained in:
Cheick Keita
2021-01-22 14:21:43 -08:00
committed by GitHub
parent 2f3139cda1
commit ec982c68c5
3 changed files with 206 additions and 106 deletions

View File

@ -67,7 +67,6 @@ from registration import (
add_application_password,
assign_scaleset_role,
authorize_application,
get_application,
register_application,
update_pool_registration,
)
@ -329,10 +328,11 @@ class Client:
(password_id, password) = self.create_password(app.object_id)
onefuzz_cli_app_uuid = uuid.UUID(ONEFUZZ_CLI_APP)
cli_app = get_application(onefuzz_cli_app_uuid)
cli_app = client.applications.list(filter="appId eq '%s'" % ONEFUZZ_CLI_APP)
if cli_app is None:
onefuzz_cli_app_uuid = uuid.UUID(ONEFUZZ_CLI_APP)
if not cli_app:
logger.info(
"Could not find the default CLI application under the current "
"subscription, creating a new one"