Skip to content

Commit

Permalink
Fixed 595 and 581 (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
techlake authored May 2, 2024
1 parent 5499cc7 commit f7b9e06
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion Scripts/Helpers/Build-AssignmentDefinitionAtLeaf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ function Build-AssignmentDefinitionAtLeaf {

#region identity (location, user-assigned, additionalRoleAssignments)

$roleDefinitionIds = $null
$identityRequired = $false
$managedIdentityLocation = $null
$identitySpec = $null
Expand Down
14 changes: 2 additions & 12 deletions Scripts/Helpers/Build-ScopeTableForDeploymentRootScope.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@ function Build-ScopeTableForDeploymentRootScope {
#region process subscriptions and/or management groups
$scopeDetails = $null
if ($null -ne $deploymentRootScopeSubscriptionId) {
try {
$subscription = Get-AzSubscription -SubscriptionId $deploymentRootScopeSubscriptionId -TenantId $tenantId
}
catch {
Write-Error "You do not have sufficient permissions over the default context. Please set the 'defaultContext' parameter for this pacSelector in the globalSettings file. This is usually only an issue when a Lighthouse tenant is being deployed to."
}
$subscription = Get-AzSubscription -SubscriptionId $deploymentRootScopeSubscriptionId -TenantId $tenantId -ErrorAction Stop
$subscriptionId = $subscription.Id
$scopeDetails = Build-ScopeTableForSubscription `
-SubscriptionId $subscriptionId `
Expand All @@ -108,12 +103,7 @@ function Build-ScopeTableForDeploymentRootScope {
-ScopeTable $scopeTable
}
else {
try {
$managementGroup = Get-AzManagementGroup -GroupName $deploymentRootScopeManagementGroupName -Expand -Recurse
}
catch {
Write-Error "You do not have sufficient permissions over the default context. Please set the 'defaultContext' parameter for this pacSelector in the globalSettings file"
}
$managementGroup = Get-AzManagementGroup -GroupName $deploymentRootScopeManagementGroupName -Expand -Recurse -ErrorAction Stop
$scopeDetails = Build-ScopeTableForManagementGroup `
-ManagementGroup $managementGroup `
-ResourceGroupsBySubscriptionId $resourceGroupsBySubscriptionId `
Expand Down
3 changes: 1 addition & 2 deletions Scripts/Helpers/Merge-AssignmentParametersEx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function Merge-AssignmentParametersEx {
$effectAllowedValues = $perPolicySet.effectAllowedValues
$effectAllowedOverrides = $perPolicySet.effectAllowedOverrides
$effectDefault = $perPolicySet.effectDefault
$policyDefinitionReferenceId = $perPolicySet.policyDefinitionReferenceId
if ($isProcessed) {
#region the second and subsequent time this Policy is processed, the effect must be adjusted to audit
$planedEffect = switch ($requestedEffect) {
Expand Down Expand Up @@ -96,8 +97,6 @@ function Merge-AssignmentParametersEx {
if ($planedEffect -ne $effectDefault) {

#region effect parameters including overrides
$policyDefinitionReferenceId = $perPolicySet.policyDefinitionReferenceId

$useOverrides = $false
$confirmedEffect = $null
if ($perPolicySet.isEffectParameterized) {
Expand Down

0 comments on commit f7b9e06

Please sign in to comment.