Dave Lage
  • About
  • Art
  • Code
  • Everyday
  • Log
  • Photos
  • Playlists
  • Projects
  • Related
  • Videos
September 9, 2022 (updated November 30, 2022)

Azure DevOps Pipelines API, Object Moved error

Using curl you may find documentation to use Authorization: Basic $PAT to pass your personal access token (PAT).

Let’s say we want to trigger a pipeline run. This is the version you may see around. This does not work and causes a Object Moved page to be loaded with a tag. The link basically logs you into Azure DevOps.

curl --request POST --header "Content-Type: application/json" \
	--header "Authorization: Basic $AZURE_RELEASE_TRIGGER_TOKEN" \
	--data '{ resources: { repositories: { self: { refName: "refs/heads/master" } } } }' \
	"https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1"

The issue is it’s not logging you in properly through the PAT. This could be a PAT error or due to invalid authorization format. What works though is if you use the user option for curl, passing your PAT as a password (empty username).

curl --request POST \
	--header "Accept: application/json" \
	--header "Content-Type: application/json" \
  --user ":$AZURE_RELEASE_TRIGGER_TOKEN" \
	--data '{ resources: { repositories: { self: { refName: "refs/heads/master" } } } }' \
	"https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1"

If successful, you should see the proper response instead of the Object Moved error. Remember to add the : in the user part. This is the separation format due to the blank user. See curl --help to see more details.

Log

  • Finding the location of objects in a selection group for fabric.js
  • Tauri - Save Files
  • Neovim 0.8 release notes and highlights
  • Azure DevOps Pipelines API Object Moved Curl
  • nvim-dap — Getting Started
  • Boo Neovim Colorscheme
  • Overwatch 2— First Beta
  • Testing Fabricjs Mouse Events Using Testing Library
  • Using Systemd to Handle Restarts
  • Fabric active selection is a group
  • Using Firejail
  • Neovim laststatus 3
  • Setup playwright for dev and production e2e testing
  • OR Type in Gleam
  • Loading image using `fetch` and promises
  • Testing Library Mousetrap
  • Unmount Component Error with React and Jest with Testing Library
  • Deploy Feature Branches
  • Linode Wildcard Certificate DNS with lego
  • Cloudflare A Record DNS for Cloudflare Pages
  • Use Vale on Neovim
  • Glorious Mouse O/D/I/N Configure on Linux with Ratbag & Piper
  • Gitlab Runner Cache using Linode Object Storage
  • Simple SVG Icon Shadow Effect
  • Rebuild Font Cache on Linux
  • Use Lua files to configure Neovim
  • Map Capslock to Escape on Linux
  • Best of Last Week - Aug 07 2020
  • Neovim 0.5 LSP with ElixirLS
  • argument error, :erlang.byte_size
  • Zoom to Middle of fabric.js Canvas
  • TypeScript as a Solo Developer
  • 100vw Is Bait
  • IntrinsicAttributes Error for Invalid Props
  • Map/Reduce Tuples to Tuples in Typescript
  • UI Animation Speed
  • MIT's Browser Climate Change Simulation
  • Currying Order?
  • Storybook: Component Story Format
  • Jest ES Modules
  • Powershell Stopwatch
  • CSS: Text Decoration Thickness
  • Making custom highlighting styles in Hugo with Chroma
  • Permaculture Books
  • Favicons in Hugo
  • Error: Not Supported
  • Web Components: Spotify Embed
  • JavaScript Pipeline Operators (Proposal)
  • HTTP Headers for the Responsible Developer Stefan Judis
  • Hugo OpenGraph Twitter Cards
  • The Man Who Planted Trees
  • Github Star Showcase
  • New Design
Dave Lage
  • About
  • Art
  • Code
  • Everyday
  • Log
  • Photos
  • Playlists
  • Projects
  • Related
  • Videos