Fix upload/download/list attachment 401s and job update 404 - #773
Open
v-elegacheva wants to merge 1 commit into
Open
v-elegacheva wants to merge 1 commit into
v-elegacheva wants to merge 1 commit into
Conversation
- upload_attachment, download_attachment, and list_attachments in base_job.py were reusing the unsigned container_uri returned by job creation instead of always fetching a fresh SAS-signed URI via workspace.get_container_uri(), causing 401 NoAuthenticationInformation errors. - build_services_jobs_update_request in the generated _operations.py used the wrong URL path segment 'jobUpdateOptions' (the request model type name) instead of 'jobs', causing workspace.update_job() to fail with 404 Not Found.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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.
Issue 1: Attachment methods use unsigned container_uri (401)
upload_attachment,download_attachment, andlist_attachmentsinbase_job.pypreferredself._details.container_uri(the plain, unsigned URL returned by the job creation/submit API response) over callingself.workspace.get_container_uri(job_id=self.id)(which returns a fresh SAS-signed URL). As a result, any attachment operation on an already-submitted job failed with a 401ClientAuthenticationError/NoAuthenticationInformation.Fix: always call
self.workspace.get_container_uri(job_id=self.id)for a fresh SAS-signed URI.Issue 2: Job update PATCH request uses the wrong URL path (404)
build_services_jobs_update_requestin_client/operations/_operations.pyconstructed the URL as.../workspaces/{workspaceName}/jobUpdateOptions/{jobId}, using the request model type name (JobUpdateOptions) as the path segment instead of the resource path used by every other job operation (jobs). As a result, every call toworkspace.update_job()failed with a 404 Not Found.Fix: use
.../workspaces/{workspaceName}/jobs/{jobId}to match the other job operations.Fixes ADO Bug 55206.