Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.
Merged
Changes from 1 commit
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
17 changes: 16 additions & 1 deletion src/deployment/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,22 @@ def setup_rbac(self) -> None:
service_principal_type="Application",
app_id=app.app_id,
)
client.service_principals.create(service_principal_params)
try:
client.service_principals.create(service_principal_params)
except GraphErrorException as err:
# work around timing issue when creating service principal
# https://github.com/Azure/azure-cli/issues/14767
if (
"service principal being created must in the local tenant"
not in str(err)
):
raise err
logging.warning(
"creating service principal failed with an error that occurs "
"due to AAD race conditions. retrying after delay"
)
time.sleep(60)
client.service_principals.create(service_principal_params)
else:
app = existing[0]
existing_role_values = [app_role.value for app_role in app.app_roles]
Expand Down