fix: set CustomClientAppId in BlueprintSubcommand to fix inheritable permissions#272
Merged
sellakumaran merged 3 commits intomicrosoft:mainfrom Feb 18, 2026
Conversation
…permissions (microsoft#271) BlueprintSubcommand.SetHandler was missing the assignment of graphApiService.CustomClientAppId = setupConfig.ClientAppId, causing Connect-MgGraph to omit -ClientId and fall back to the default SDK client app (14d82eec) which lacks the required AgentIdentityBlueprint.UpdateAuthProperties.All permission. This always fails on macOS/Linux (no WAM broker) and intermittently fails on Windows when cached tokens expire. Every other command handler (AllSubcommand, PermissionsSubcommand, DeployCommand, CleanupCommand) already sets this property correctly. Fixes microsoft#271
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug where a365 setup blueprint fails to configure inheritable permissions because graphApiService.CustomClientAppId is never set in the command handler. Without this assignment, the Graph API authentication falls back to the default SDK client app which lacks the required AgentIdentityBlueprint.UpdateAuthProperties.All permission. This bug affects all platforms but manifests most consistently on macOS/Linux where WAM (Web Account Manager) is unavailable.
Changes:
- Added
graphApiService.CustomClientAppIdassignment inBlueprintSubcommand.SetHandlerafter loading configuration, matching the pattern used in all other command handlers (AllSubcommand,PermissionsSubcommand,DeployCommand,CleanupCommand)
src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/BlueprintSubcommand.cs
Outdated
Show resolved
Hide resolved
Remove issue reference from inline comment to match the pattern used in other command handlers (AllSubcommand, PermissionsSubcommand, etc.) The issue reference is already documented in git history and PR description, so the inline comment doesn't need to duplicate it. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…bcommand Add unit and integration tests to prevent regression of issue microsoft#271 where CustomClientAppId was not being set, causing inheritable permissions to fail. Unit Tests (BlueprintSubcommandTests.cs): - SetHandler_WithClientAppId_ShouldConfigureGraphApiService - SetHandler_WithoutClientAppId_ShouldNotConfigureGraphApiService - SetHandler_WithWhitespaceClientAppId_ShouldNotConfigureGraphApiService Integration Test (integration-test-workflow.md): - Test 4.1a: Verify CustomClientAppId configuration via trace logs - Validates Connect-MgGraph uses correct -ClientId parameter - Prevents regression where SDK default app is used instead These tests would have caught the bug fixed in PR microsoft#272 where the missing CustomClientAppId assignment caused authentication to fail on macOS/Linux. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
sellakumaran
approved these changes
Feb 18, 2026
ajmfehr
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BlueprintSubcommand.SetHandleris missing the assignment ofgraphApiService.CustomClientAppId, causinga365 setup blueprintto fail when setting inheritable permissions. Every other command handler (AllSubcommand,PermissionsSubcommand,DeployCommand,CleanupCommand) already sets this property correctly.Fixes #271
Root Cause
When
CustomClientAppIdis null,MicrosoftGraphTokenProvideromits the-ClientIdparameter from theConnect-MgGraphPowerShell command, causing it to fall back to the default SDK client app (14d82eec-204b-4c2f-b7e8-296a70dab67e). This default app lacks theAgentIdentityBlueprint.UpdateAuthProperties.Allpermission required bySetInheritablePermissionsAsync.Call chain
Platform impact
-ClientIdfor interactive browser authFix
One-line addition after config load, matching the exact pattern used in
AllSubcommand.cs(line 138):Testing
dotnet build -c Release— 0 warnings, 0 errorsCleanConsoleFormatterTestspass; no existing tests forBlueprintSubcommandSetHandler pathConnect-MgGraph -ClientId '<custom-app-id>'is emitted, matching behavior ofa365 setup allWorkaround (for users on current release)
Use
a365 setup all --skip-infrastructureinstead ofa365 setup blueprint, asAllSubcommandcorrectly sets the property.