-
Notifications
You must be signed in to change notification settings - Fork 228
[BUG] Azure DevOps authentication via 'az login' does not always work #1671
Copy link
Copy link
Open
Labels
area/docs-sitedocs/src/content (Starlight), README, doc generation.docs/src/content (Starlight), README, doc generation.area/enterpriseAir-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.Air-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/shepherdingActively being driven by an APM shepherd runActively being driven by an APM shepherd runstatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.Something does not work as documented.
Metadata
Metadata
Assignees
Labels
area/docs-sitedocs/src/content (Starlight), README, doc generation.docs/src/content (Starlight), README, doc generation.area/enterpriseAir-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.Air-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/shepherdingActively being driven by an APM shepherd runActively being driven by an APM shepherd runstatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.Something does not work as documented.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
In Progress
Describe the bug
When installing a custom agent, the installed md file is an html from ADO saying I am not logged in.
To Reproduce
logged in via 'az login'
using an apm.yml like this:
then run:
set APM_DEBUG=1
apm update --verbose
output:
result:
File some-agent.agent.md will contain some html indicating that call was not authenticated:
Expected behavior
I expect that the correct md file is installed, or that I get an error that I need to login.
Environment (please complete the following information):
Additional context
If I try to install an individual skill, it does work. But it seems downloading goes through a different path.
The output contains lines like this:
Partial clone (--filter=blob:none) failed ...
[DEBUG] _clone_with_fallback: ...
I have tried adding some logging to the code to see what is happening.
It is not clear to me yet, but this is what I have seen with version 0.16.1:
apm gets into function 'download_ado_file' without fetching a bearer token via 'az'
since there there are not credentials attached to the request, ado is giving back the html file which is then saved in apm_modules
note that ado does not give a 401 for these situations
apm does go through azure_cli.get_bearer_token, and succesfully gets a token
the file is download again and saved again in apm_modules, still contains html, so apparently the bearer token is not attached?
it seems the token is only used as a fallback, but somehow I don't get into that path.
Additionally I had to fix an error with 'az login' itself.
While trying to find out what was happening, I found out that 'az login' was giving an error like this
SubError: basic_action V2Error: invalid_grant AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrator
APM did not report this in it's output (bug?)
Had to do this to fix it:
az logout
az login --tenant --scope "499b84ac-1321-427f-aa17-267ca6975798/.default"
After this fix, download the custom agent still failed.