private async Task AssignParticipantToGroupWithRetry(string username, string userId, string userRoleName, Guid hearingId)
 {
     await _pollyRetryService.WaitAndRetryAsync <Exception, Task>
     (
         4, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)),
         retryAttempt => _logger.LogDebug($"{nameof(AssignParticipantToCorrectGroups)} - Failed to add username: {username} userId {userId} to role: {userRoleName} on AAD for hearingId: {hearingId}. Retrying attempt {retryAttempt}"),
         result => result.IsFaulted,
         async() =>
     {
         _logger.LogDebug($"{nameof(AssignParticipantToCorrectGroups)} - Adding username: {username} userId {userId} to role: {userRoleName} on AAD for hearingId: {hearingId}");
         await _userAccountService.AssignParticipantToGroup(userId, userRoleName);
         _logger.LogDebug($"{nameof(AssignParticipantToCorrectGroups)} - Added username: {username} userId {userId} to role: {userRoleName} on AAD for hearingId: {hearingId}");
         return(Task.CompletedTask);
     }
     );
 }