Give clearer errors when Microsoft.dotnet-msidentity is not installed - #3799
Open
haileymck wants to merge 1 commit into
Open
Give clearer errors when Microsoft.dotnet-msidentity is not installed#3799haileymck wants to merge 1 commit into
haileymck wants to merge 1 commit into
Conversation
Extract msidentity install/detection into a shared MsIdentityToolHelper with an actionable NotInstalledMessage, wire RegisterAppStep (which previously had no install check) and AddClientSecretStep to it, and surface the guidance on CLI failures. Add MsIdentityToolHelperTests covering the message and constants. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
When the
Microsoft.dotnet-msidentitytool was missing, Entra ID scaffolding failed with cryptic errors.RegisterAppStepinvokeddotnet msidentitydirectly with no install/detection check, so a missing tool surfaced as a raw dotnet "command not found" error.AddClientSecretStephad its own duplicated install logic but no user-facing guidance on how to fix a failure.This PR centralizes the detection/install logic and makes every failure path emit clear, actionable guidance.
Changes
Helpers/MsIdentityToolHelper.cs— shared helper exposing:IsMsIdentityInstalled/EnsureMsIdentityIsInstalled(lifted fromAddClientSecretStep, now reusable).NotInstalledMessage— a single actionable message telling the user exactly how to install the tool:RegisterAppStep.cs— now callsEnsureMsIdentityIsInstalledup front (it previously had no check at all) and appendsNotInstalledMessageon register/update CLI failures.AddClientSecretStep.cs— removed the duplicatedEnsureMsIdentityIsInstalled/IsMsIdentityAlreadyInstalledmethods in favor of the shared helper, and surfacesNotInstalledMessageon CLI failure.Tests
MsIdentityToolHelperTests(7 tests) verifying the tool name/command constants and thatNotInstalledMessageincludes the install command, prerelease guidance, and Entra ID context. All pass.RegisterAppStep/AddClientSecretSteptests still compile and build cleanly.Notes
The repo pins an SDK (
11.0.100-preview.6) that isn't installed on the build machine, so builds/tests were verified against the installedpreview.5via a temporaryglobal.jsonswap (reverted afterward —global.jsonis unchanged in this PR).