Skip to content

Enable portal-only admin consent for bulk onboarding - #502

Open
Walter Luna (walterluna) wants to merge 2 commits into
microsoft:mainfrom
walterluna:update-bulk-onboarding-app-creation
Open

Walter Luna (walterluna) wants to merge 2 commits into
microsoft:mainfrom
walterluna:update-bulk-onboarding-app-creation

Conversation

@walterluna

Copy link
Copy Markdown
Contributor

Declare application roles and delegated scopes with -SkipGrant so administrators can grant consent in Entra without running the script.

  • Preserve existing API permissions and avoid duplicate declarations
  • Report declared permissions, consent failures, and portal links
  • Add regression coverage for permission merging and idempotency

Declare application roles and delegated scopes with -SkipGrant so
administrators can grant consent in Entra without running the script.

- Preserve existing API permissions and avoid duplicate declarations
- Report declared permissions, consent failures, and portal links
- Add regression coverage for permission merging and idempotency
Copilot AI lite review requested due to automatic review settings September 23, 2026 15:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Resolve merge conflicts and add execution-level coverage for skip-grant behavior.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Enables portal-only admin consent for bulk onboarding by declaring permissions and reporting Entra consent links.

Changes:

  • Adds permission merging and idempotency handling.
  • Adds -SkipGrant behavior and consent reporting.
  • Adds regression coverage for permission declarations.
File Summary
scripts/​bulk-agent-registration/​New-A365AutomationApp.ps1 Implements permission declaration and consent reporting; unresolved merge conflicts prevent parsing.
scripts/​bulk-agent-registration/​tests/​PermissionDeclaration.Tests.ps1 Tests permission merging, but lacks execution-level coverage for -SkipGrant behavior.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/bulk-agent-registration/New-A365AutomationApp.ps1 Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 15:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved issues remain in WhatIf reporting, duplicate reconciliation, and consent-status accuracy.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity · 1 Low severity

Open (3)
Resolved since last review (1)

Comment on lines +268 to +270
$existingKeys = [System.Collections.Generic.HashSet[string]]::new([StringComparer]::OrdinalIgnoreCase)
foreach ($access in $graphAccess) {
[void]$existingKeys.Add(('{0}|{1}' -f $access.type, $access.id))
Comment on lines +1201 to +1205
if ($permissionMerge.Changed) {
$payload = @{ requiredResourceAccess = $permissionMerge.RequiredResourceAccess }
$changeDescription = "+$($permissionMerge.RolesAdded.Count) application permission(s), +$($permissionMerge.ScopesAdded.Count) delegated scope(s)"
if ($PSCmdlet.ShouldProcess($DisplayName, "PATCH requiredResourceAccess ($changeDescription)")) {
Invoke-Graph -Method PATCH -Uri "/applications/$applicationObjectId" -Body $payload | Out-Null
Comment thread scripts/bulk-agent-registration/New-A365AutomationApp.ps1
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.

2 participants