Stop passing --allow-no-subscriptions to non-login az commands - #143
Merged
Priyanshu Agrawal (priyanshu92) merged 3 commits intoMay 7, 2026
Merged
Conversation
The --allow-no-subscriptions flag is only valid on `az login`. Other az subcommands reject it as an unrecognized argument and exit non-zero, so `getAuthToken` and `az account show` were silently broken for every user — even those with a subscription. - scripts/lib/validation-helpers.js: drop the flag from the `az account get-access-token` invocation in `getAuthToken` so the shared auth helper actually works at runtime. - scripts/tests/validation-helpers.test.js: flip the assertion to verify the flag is NOT passed (the previous test masked the bug because execSync was mocked). - skills/activate-site/SKILL.md: drop the flag from the `az account show` login check. - plugins/power-pages/AGENTS.md: replace the misleading guidance with a clear rule — only `az login` accepts --allow-no-subscriptions; subsequent `az account get-access-token` calls still mint AAD-scoped tokens for subscription-less accounts. User-facing error messages that instruct `az login --allow-no-subscriptions` remain unchanged — that usage is correct. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Suggest plain `az login` when the user isn't logged in; recommend `az login --allow-no-subscriptions` only as a fallback for accounts without any associated Azure subscription. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Priyanshu Agrawal (priyanshu92)
enabled auto-merge (squash)
May 7, 2026 06:13
Copilot started reviewing on behalf of
Priyanshu Agrawal (priyanshu92)
May 7, 2026 06:14
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect Azure CLI usage in the Power Pages plugin by removing the unsupported --allow-no-subscriptions flag from non-az login commands, and aligning docs/tests with Azure CLI’s actual flag support.
Changes:
- Update
getAuthTokento stop passing--allow-no-subscriptionstoaz account get-access-token. - Update the corresponding unit test to assert the flag is not included.
- Fix the
activate-siteskill docs to useaz account showwithout the invalid flag. - Update
AGENTS.mdguidance to clarify the flag is only valid onaz login.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| plugins/power-pages/skills/activate-site/SKILL.md | Removes invalid Azure CLI flag from the login verification command. |
| plugins/power-pages/scripts/tests/validation-helpers.test.js | Updates test to ensure getAuthToken does not include the unsupported flag. |
| plugins/power-pages/scripts/lib/validation-helpers.js | Removes unsupported flag from az account get-access-token invocation and clarifies docstring behavior. |
| plugins/power-pages/AGENTS.md | Updates contributor guidance to reflect correct Azure CLI flag applicability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Priyanshu Agrawal (priyanshu92)
disabled auto-merge
May 7, 2026 06:21
Priyanshu Agrawal (priyanshu92)
enabled auto-merge (squash)
May 7, 2026 06:22
amitjoshi438
approved these changes
May 7, 2026
Priyanshu Agrawal (priyanshu92)
deleted the
users/priyanshuag/fix-az-allow-no-subscriptions
branch
May 7, 2026 06:32
8 tasks
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
The
--allow-no-subscriptionsflag is only valid onaz login. Otherazsubcommands reject it as an unrecognized argument and exit non-zero, so the sharedgetAuthTokenhelper inscripts/lib/validation-helpers.jsand theaz account showlogin check inactivate-site/SKILL.mdwere silently broken for every user — not just subscription-less accounts.Verified locally:
Changes
scripts/lib/validation-helpers.js— drop the flag from theaz account get-access-tokeninvocation ingetAuthTokenso the shared auth helper actually works at runtime, and update the JSDoc to explain the constraint.scripts/tests/validation-helpers.test.js— flip the assertion frommatch→doesNotMatch. The previous test passed only becauseexecSyncwas mocked; the real CLI invocation always failed.skills/activate-site/SKILL.md— drop the flag from theaz account showlogin check.plugins/power-pages/AGENTS.md— replace the misleading convention with a clear rule:--allow-no-subscriptionsis only valid onaz login.az loginfirst; suggestaz login --allow-no-subscriptionsonly as a fallback for accounts without any associated Azure subscription.User-facing error messages that instruct
az login --allow-no-subscriptionswere left intact — that's correct usage.Validation