Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Udpate adal error handling during deployment #947

Merged
merged 5 commits into from
Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/deployment/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import adal # type: ignore
import requests
from azure.cli.core.azclierror import AuthenticationError
from azure.common.client_factory import get_client_from_cli_profile
from azure.common.credentials import get_cli_profile
from azure.graphrbac import GraphRbacManagementClient
Expand Down Expand Up @@ -318,7 +319,7 @@ def add_application_password_impl(
body=password_request,
)
return (str(key), password["secretText"])
except adal.AdalError:
except AuthenticationError:
return add_application_password_legacy(app_object_id, subscription_id)


Expand Down Expand Up @@ -376,7 +377,7 @@ def authorize_application(
}
},
)
except adal.AdalError:
except AuthenticationError:
logger.warning("*** Browse to: %s", FIX_URL % onefuzz_app_id)
logger.warning("*** Then add the client application %s", registration_app_id)

Expand Down Expand Up @@ -543,7 +544,7 @@ def assign_app_role(
"appRoleId": managed_node_role["id"],
},
)
except adal.AdalError:
except AuthenticationError:
assign_app_role_manually(
onefuzz_instance_name, application_name, subscription_id, app_role
)
Expand Down