I followed the Azure DevOps docs for how to create a Personal Access Token, convert the token to Base64 and GET repo branches, but I cannot successfully request.
What am I missing?
PowerAutomate Action: HTTP Request
- Where
myOrg, myProject and myRepoID
are actual values
Error: 302 Redirect
Error Text:
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://spsprodcus3.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2FmyOrg%2FmyProject%2F_apis%2Fgit%2Frepositories%2FmyRepoID%2Frefs%3Fapi-version%3D6.0&redirect=1&hid=<longGUID>&context=<longGUIDctx=<longGUID">here</a>.</h2>
</body></html>
EDIT 1:
- Tried adding the
Content-Type
header and adding the auth as a special header - Still same error
EDIT 2:
- Tried adding the PAT to Basic auth but the Username is required
EDIT 3:
I found that even though above action fails, the response
Location
header contains a URL that resolves correctly:https://spsprodcus3.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=https%3A%2F%2Fdev.azure.com%2FmyOrg%2FmyProject%2F_apis%2Fgit%2Frepositories%3Fapi-version%3D6.0&redirect=1&mkt=en-US&hid=LONG_GUID&context=LONG_GUIDctx=LONG_GUID
BUT when this URL is piped to a subsequent HTTP action, it results in a 203 response that does not include the REST response!
EDIT 4: THIS WORKED
- Added a
.
to theBasic
username Authentication - Regenerated the ADO Personal Access Token, saved the new value in Key Vault