Skip to content

fix(safeoutputs): resolve FileContainer service URL via resource areas to fix 405 on upload-pipeline-artifact#424

Open
Copilot wants to merge 1 commit intomainfrom
copilot/fix-upload-pipeline-artifact-issue
Open

fix(safeoutputs): resolve FileContainer service URL via resource areas to fix 405 on upload-pipeline-artifact#424
Copilot wants to merge 1 commit intomainfrom
copilot/fix-upload-pipeline-artifact-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

Summary

upload-pipeline-artifact was failing with HTTP 405 on the container creation step because POST /_apis/resources/containers is served by ADO's FileContainer/distributedtask service (vstmr.dev.azure.com/{org}), not the main org URL (dev.azure.com/{org}). Hardcoding org_url as the base hit the wrong routing proxy, which has no POST handler for that path.

Fix: Before Steps 1 & 2 (container create + file upload), the executor now resolves the correct service base URL via the resource areas API — the same mechanism the azure-devops-node-api uses internally:

GET {org_url}/_apis/resourceAreas/e4f45d1e-c5e5-4112-a594-9d59a8f6c707?api-version=7.1
→ { "locationUrl": "https://vstmr.dev.azure.com/{org}/" }
  • All _apis/resources/containers calls (Steps 1 & 2) use the resolved locationUrl
  • Step 3 (_apis/build/builds/{id}/artifacts) is unaffected — it routes correctly via the main org URL
  • Graceful fallback to org_url if the resource area lookup fails (on-premises ADO Server compatibility)

Test plan

  • Existing 20 unit tests pass unchanged
  • New test_resolve_file_container_base_url_falls_back_on_error test verifies the fallback path (connection refused → returns original org_url)

…s to fix 405 on upload-pipeline-artifact

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/317ff8e0-db0e-4179-a799-29b975b5aedd

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review May 6, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants