Repository navigation
Conversation
This was referenced Dec 5, 2026
odgrim
force-pushed
the
track-a/azure-select-rollback
branch
from
December 6, 2026 07:03
6eeb512 to
26cf530
Compare
odgrim
force-pushed
the
track-a/azure-select-rollback
branch
from
December 6, 2026 07:48
26cf530 to
828e23a
Compare
select made the new account az's default before checking the required roles, so a select the roles refused kept the old choice while a bare az used the refused account. The role query now names its account with --subscription, and the default moves only once the roles hold. az's role client takes the subscription from --scope only when a slash follows it, so without --subscription it asks through the default.
odgrim
force-pushed
the
track-a/azure-select-rollback
branch
from
December 6, 2026 16:03
36cd0ad to
cb7cb06
Compare
odgrim
marked this pull request as ready for review
December 6, 2026 16:14
This branch has not been deployed
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.
Change
A
selectrefused by a missing role leaves az's default where it was. Before this, the session kept its old choice andenvgave the old subscription's IDs, but a bareazinAZURE_CONFIG_DIRused the refused account.commitnow checks the required roles first, with the role query naming its account (az role assignment list ... --subscription <account>). Only once the roles hold does it make that account the default.Decisions
--subscriptionon the role query, not a rollback of the default. The bad state never arises, so no secondaz account setcan fail and leave it behind.Az::role_namestakes the account asOption<&SubscriptionId>. With none (the signed-in tenant with no account), az asks through its default, as before.Gaps
/subscriptions/scopes, so no test has that shape;az account setfailing inselect. Only thesignInTotests setset_error.Evidence
a_refused_select_leaves_the_choice_and_az_default_as_they_werefailed before the fix:left: Some("aaaaaaaa-0000-4000-8000-000000000001") right: Some("aaaaaaaa-0000-4000-8000-000000000002")(az's default had moved to Prod).180 passed, 1 failed): the test above;177 passed, 4 failed):a_tenant_level_choice_holds_no_subscription_role,detect_reports_a_login_that_lacks_a_required_role,detect_passes_over_a_failed_source_and_a_missing_role,each_service_principal_a_source_holds_is_tried_in_turn.mise run checkat 828e23a:503 tests run: 503 passed, 0 skipped, lint clean, semverno publishable crates.mise.tomlpins:role/_client_factory.py:13takes the subscription from--scopeonly byre.match('/subscriptions/(?P<subscription>[^/]*)/', scope), which/subscriptions/<id>doesn't match;core/commands/arm.py:430adds--subscriptionto every command;core/commands/__init__.py:663puts it incli_ctx.data['subscription_id'];core/commands/client_factory.py:69-70gives that to the client.Audit dependenciesis red, as on main, until the pin-project-lite 0.2.19 lock update.git patch-id --stable(405256d321bd) and the same changed lines, tree unchanged.