-
Notifications
You must be signed in to change notification settings - Fork 285
Update README with troubleshooting info #7070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardpark-msft , can we make the extension to return this as part of the error? or even make the extension to invoke azd init ?
Looking for a way to shift left this from happening to preventing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From talking with @bob-okeefe, it sounded like the steps he went through were:
So then he
azd init'd and it worked.Does azd init do something differently from azd login?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting.
It might make a difference if you were asked to pick a subscription - or if the
azd initinvoked theazd auth loginDo we have more details about the number 3? I what was trying to use the credential?
Any ideas @weikanglim ? -
But then, @richardpark-msft , there's not expectation from the extension around running
azd initfirst? If not, we should not add this note and instead make this an issue/bug to investigate (try to repro).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was always asked to pick a subscription when I ran azd coding-agent config. I would choose my subscription and my repo. However when I got to the MI step and said to create a new MI it always failed. I was only able to resolve this after running azd init.
See attached.

When using debug I got this:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I only figured out that I had to run azd init because when I was using Copilot to troubleshoot this it suggested running azd env set AZURE_SUBSCRIPTION_ID . When I did this I got this error:
ERROR: no project exists; to create a new project, run
azd initAfter the azure.yml file was created I was able to run azd coding-agent config successfully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently those errors are coming from when I call into the 'azd' PromptClient/PromptServiceClient:
I was wondering, at first, if perhaps I was messing up some subscription or passing in a bad credential, but this is within 'azd' itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't - I remember us talking about this. I don't use any azd logic to detect or use any project, so it should be safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you happen to have subscriptions across multiple tenants? I wonder if doing
azd auth login --tenant <tenant-id>would've helped in this case. It's odd you still got an expired token error right after runningazd auth login.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you ended up running
azd env set AZURE_SUBSCRIPTION_ID xxxxxx?If yes, that's how it was fixed.
You had to run
azd init ...but only to be able to runazd env set ...- to have an azd env where to set the sub-id.A similar approach is to set AZURE_SUBSCRIPTION_ID as system env var (not at azd's env) and that would also work.
The issue is that azd is trying to use a token for the wrong tenant. When you set the sub-id, azd resolves the right tenant where that sub belongs to.
Even thought the extension is asking for a subscription, azd is not using the response to use that sub/tenant for the following events - instead it is using the credential provider which resolves to use a different token.
We need to make the extension to use the subId selected to re-set the credential provider - I'll see if that can be done (time to chat to the AI ...) - I'll be back to you...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed the hypothesis — the extension uses
Subscription.TenantId(resource tenant) instead ofSubscription.UserTenantId(user access tenant) when creating theAzureDeveloperCLICredential. For multi-tenant/guest users these differ, causing "refresh token expired" errors.Filed #7077 with fix at #7078.