Skip to content

Commit

Permalink
Modify deployment scripts to make tenancy service available to other …
Browse files Browse the repository at this point in the history
…services
  • Loading branch information
idg10 committed Feb 18, 2020
1 parent c22e8bb commit 52b98fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Solutions/Marain.Tenancy.Deployment/Marain-ArmDeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ script. It is our opportunity to create Azure resources.
# Marain.Instance expects us to define just this one function.
Function MarainDeployment([MarainServiceDeploymentContext] $ServiceDeploymentContext) {

$TenancyAuthAppId = $ServiceDeploymentContext.GetAppId()
$TemplateParameters = @{
appName="tenancy"
functionEasyAuthAadClientId=$ServiceDeploymentContext.Variables["TenancyAppId"]
functionEasyAuthAadClientId=$TenancyAuthAppId
appInsightsInstrumentationKey=$ServiceDeploymentContext.InstanceContext.ApplicationInsightsInstrumentationKey
}
$InstanceResourceGroupName = $InstanceDeploymentContext.MakeResourceGroupName("tenancy")
Expand All @@ -18,6 +19,6 @@ Function MarainDeployment([MarainServiceDeploymentContext] $ServiceDeploymentCon
$TemplateParameters,
$InstanceResourceGroupName)

$ServiceDeploymentContext.Variables["KeyVaultName"] = $DeploymentResult.Outputs.keyVaultName.Value
$ServiceDeploymentContext.Variables["FunctionServicePrincipalId"] = $DeploymentResult.Outputs.functionServicePrincipalId.Value
#$ServiceDeploymentContext.Variables["KeyVaultName"] = $DeploymentResult.Outputs.keyVaultName.Value
$ServiceDeploymentContext.SetAppServiceDetails($DeploymentResult.Outputs.functionServicePrincipalId.Value)
}
2 changes: 2 additions & 0 deletions Solutions/Marain.Tenancy.Deployment/Marain-PostDeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ have been deployed.
# Marain.Instance expects us to define just this one function.
Function MarainDeployment([MarainServiceDeploymentContext] $ServiceDeploymentContext) {

$ServiceDeploymentContext.MakeAppServiceCommonService("Marain.Tenancy")

$ServiceDeploymentContext.UploadReleaseAssetAsAppServiceSitePackage(
"Marain.Tenancy.Host.Functions.zip",
$ServiceDeploymentContext.AppName
Expand Down
14 changes: 10 additions & 4 deletions Solutions/Marain.Tenancy.Deployment/Marain-PreDeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ use it directly.)
# Marain.Instance expects us to define just this one function.
Function MarainDeployment([MarainServiceDeploymentContext] $ServiceDeploymentContext) {

$app = $ServiceDeploymentContext.DefineAzureAdAppForAppService(
"",
"TenancyAppId")
$app = $ServiceDeploymentContext.DefineAzureAdAppForAppService()

$AdminAppRoleId = "7619c293-764c-437b-9a8e-698a26250efd"
$app.EnsureAppRolesContain(
$AdminAppRoleId,
"Tenancy administrator",
"Full control over definition of claim permissions and rule sets",
"Ability to create, modify, read, and remove tenants",
"TenancyAdministrator",
("User", "Application"))

$ReaderAppRoleId = "60743a6a-63b6-42e5-a464-a08698a0e9ed"
$app.EnsureAppRolesContain(
$ReaderAppRoleId,
"Tenancy reader",
"Ability to read information about tenants",
"TenancyReader",
("User", "Application"))
}

0 comments on commit 52b98fa

Please sign in to comment.