@@ -404,15 +404,20 @@ impl Executor for UploadPipelineArtifactResult {
404404 . unwrap_or ( & self . staged_file ) ;
405405
406406 // ── Step 1: Create container ─────────────────────────────────────
407+ // The `scopeIdentifier` query parameter (project GUID) is required for
408+ // the POST to route correctly in ADO. Omitting it causes a 405 because
409+ // the unscoped `_apis/resources/containers` collection does not support
410+ // POST. The body only needs the container name; the project scope must
411+ // be in the query string.
407412 let container_url = format ! (
408- "{}/_apis/resources/containers?api-version=7.1-preview.4" ,
413+ "{}/_apis/resources/containers?scopeIdentifier={}& api-version=7.1-preview.4" ,
409414 org_url. trim_end_matches( '/' ) ,
415+ utf8_percent_encode( project_id, PATH_SEGMENT ) ,
410416 ) ;
411417 debug ! ( "Creating container for artifact '{}': {}" , final_name, container_url) ;
412418
413419 let container_body = serde_json:: json!( {
414420 "name" : final_name,
415- "scope" : project_id,
416421 } ) ;
417422 let container_resp = client
418423 . post ( & container_url)
@@ -445,8 +450,9 @@ impl Executor for UploadPipelineArtifactResult {
445450 debug ! ( "Container created: id={}" , container_id) ;
446451
447452 // ── Step 2: Upload file to container ─────────────────────────────
453+ // Use `scopeIdentifier` (not `scope`) to match the ADO containers API.
448454 let upload_url = format ! (
449- "{}/_apis/resources/containers/{}?itemPath={}/{}&scope ={}&api-version=7.1-preview.4" ,
455+ "{}/_apis/resources/containers/{}?itemPath={}/{}&scopeIdentifier ={}&api-version=7.1-preview.4" ,
450456 org_url. trim_end_matches( '/' ) ,
451457 container_id,
452458 utf8_percent_encode( & final_name, PATH_SEGMENT ) ,
0 commit comments