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

Commit 74c0e0a

Browse files
authored
Udpate adal error handling during deployment (#947)
1 parent 134c947 commit 74c0e0a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/deployment/registration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import adal # type: ignore
1616
import requests
17+
from azure.cli.core.azclierror import AuthenticationError
1718
from azure.common.client_factory import get_client_from_cli_profile
1819
from azure.common.credentials import get_cli_profile
1920
from azure.graphrbac import GraphRbacManagementClient
@@ -318,7 +319,7 @@ def add_application_password_impl(
318319
body=password_request,
319320
)
320321
return (str(key), password["secretText"])
321-
except adal.AdalError:
322+
except AuthenticationError:
322323
return add_application_password_legacy(app_object_id, subscription_id)
323324

324325

@@ -376,7 +377,7 @@ def authorize_application(
376377
}
377378
},
378379
)
379-
except adal.AdalError:
380+
except AuthenticationError:
380381
logger.warning("*** Browse to: %s", FIX_URL % onefuzz_app_id)
381382
logger.warning("*** Then add the client application %s", registration_app_id)
382383

@@ -543,7 +544,7 @@ def assign_app_role(
543544
"appRoleId": managed_node_role["id"],
544545
},
545546
)
546-
except adal.AdalError:
547+
except AuthenticationError:
547548
assign_app_role_manually(
548549
onefuzz_instance_name, application_name, subscription_id, app_role
549550
)

0 commit comments

Comments
 (0)