Skip to content

Commit

Permalink
Check to see if role already exists, not that roles exist. (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpollett authored Oct 24, 2018
1 parent 470fd0d commit 87030e2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ function Set-FhirServerApiApplicationRoles {
$desiredAppRoles = @()

foreach ($role in $RoleConfiguration) {
if($azureAdApplication.AppRoles) {
$id = ($azureAdApplication.AppRoles | Where-Object Value -eq $role.name).Id
$existingAppRole = $azureAdApplication.AppRoles | Where-Object Value -eq $role.name

if($existingAppRole) {
$id = $existingAppRole.Id
}
else {
$id = New-Guid
Expand Down

0 comments on commit 87030e2

Please sign in to comment.