Fix: Resolve multiple bugs in setup WorkloadZone in ADO causing silent failures#1011
Open
nnoaman wants to merge 3 commits intoAzure:release/january-2026from
Open
Fix: Resolve multiple bugs in setup WorkloadZone in ADO causing silent failures#1011nnoaman wants to merge 3 commits intoAzure:release/january-2026from
nnoaman wants to merge 3 commits intoAzure:release/january-2026from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses critical bugs in the New-SDAFADOWorkloadZone function that caused silent failures when setting up Azure DevOps workload zones. The changes fix service connection authentication issues and add error handling to prevent false success reporting.
Changes:
- Added Azure DevOps configuration defaults to ensure operations target the correct organization and project
- Fixed Managed Identity property query to use
clientIdinstead ofidfor service connection authentication - Added error handling for service connection creation commands to detect and report failures
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| New-SDAFADOWorkloadZone.ps1 | Added az devops configure defaults, fixed managed identity client ID query, and added error handling for service connection creation |
| New-SDAFADOProject.ps1 | Added error handling for service connection creation to match the pattern in New-SDAFADOWorkloadZone |
| SDAFUtilities.psm1 | Compiled module containing the same changes as the source files above |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
deploy/scripts/pwsh/SDAFUtilities/Public/New-SDAFADOWorkloadZone.ps1
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Fixes multiple bugs in
New-SDAFADOWorkloadZonethat caused false success reporting and resources created in wrong projects.Issues Addressed
Changes
1. Add Azure DevOps configuration
Files:
New-SDAFADOWorkloadZone.ps1,SDAFUtilities.psm1The function now calls
az devops configure --defaultsat the beginning to ensure all operations target the correct organization and project. This matches the pattern used inNew-SDAFADOProject.2. Fix Managed Identity Client ID query
Changed
.idto.clientIdin the az identity list query:The previous code returned the full ARM resource ID instead of the client ID required for service connection authentication.
3. Add error handling for service connection creation
Added $LASTEXITCODE checks after all az devops service-endpoint commands. The function now properly reports failures instead of displaying false success messages.