Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Role definitions during deployment #136

Merged
merged 10 commits into from
Oct 25, 2018
Merged

Conversation

hansenms
Copy link
Contributor

  • Moved PowerShell functions from FhirServerRelease module to FhirServer
  • Standardized interfaces on the functions to use AppIds throughout
  • Updated FhirServerRelease module to use new shared functions in FhirServer module
  • Added role creation and assignment instructions to documentation
  • Added default role definitions (admin role) to default deployment template

Closes #135
Closes #128

@johnstairs
Copy link
Member

Since we are "promoting" this to the public scripts:

try {
    New-AzureADServiceAppRoleAssignment -ObjectId $ObjectId -PrincipalId $ObjectId -ResourceId $apiApplication.ObjectId -Id $role | Out-Null
}
catch {
    Write-Host "Powershell reported failure adding app role assignment for service principal."
}

Maybe we could check in the catch block that the assignment went though, and not log anything if it has.

@hansenms
Copy link
Contributor Author

@johnstairs added a check to see if role is in fact assigned when role assignment throws error.

Copy link
Contributor

@brandonpollett brandonpollett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few cleanup items, but overall looks good.

.PARAMETER FhirServiceName
Name of the FHIR service instance.
.PARAMETER FhirServiceAudience
Full URL of the FHIR service.
.PARAMETER WebAppSuffix
Will be appended to FHIR service name to form the FhirServiceAudience if one is not supplied,
e.g., azurewebsites.net or azurewebsites.us (for US Government cloud)
.PARAMETER AppRole
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be AppRoles

@@ -16,6 +16,8 @@ function New-FhirServerClientApplicationRegistration {
Identifier URI for the client AAD Application registration
.PARAMETER PublicClient
Switch to indicate if the client application should be a public client (desktop/mobile applications)
.PARAMETER Roles
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a parameter on this script.

.PARAMETER ApiAppId
The objectId of the API application that has roles that need to be assigned
.PARAMETER AppRoles
The collection of roles from the testauthenvironment.json for the client application
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer just from testauthenvironment.json

.EXAMPLE
Set-FhirServerUserAppRoleAssignments -UserPrincipalName <User Principal Name> -ApiAppId <Resource Api Id> -AppRoles admin,nurse
.PARAMETER Upn
The AppId of the of the client application
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mismatch on the description and parameter

.PARAMETER Upn
The AppId of the of the client application
.PARAMETER ApiAppId
The objectId of the API application that has roles that need to be assigned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mismatch on the description and parameter

Set AppRoles for a given user. Requires Azure AD admin privileges.
.EXAMPLE
Set-FhirServerUserAppRoleAssignments -UserPrincipalName <User Principal Name> -ApiAppId <Resource Api Id> -AppRoles admin,nurse
.PARAMETER Upn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameter name doesn't match between documentation and actual parameter

@hansenms hansenms merged commit 0c46787 into master Oct 25, 2018
@hansenms hansenms deleted the personal/mihansen/aad-roles-doc branch November 15, 2018 12:34
@hansenms hansenms restored the personal/mihansen/aad-roles-doc branch November 15, 2018 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants