cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bkelley
Level: Powered On

Send an HTTP request to Azure DevOps returns Unauthorized

I've set up use of the Send an HTTP request to Azure DevOps action that seems to always return Unauthorized.  I know I've setup Azure DevOps authentication correctly because I'm also using the Azure DevOps Create a work item action and it works fine.

 

The unauthorized message gives me an object id of the user that is unauthorized, which is not me and does not seem to line up with any other Azure AD user we have.  Could it be defaulting to a system user?  Should it be working this way when it is using the same Data Connection as the Create a work item action?

 

Note:  I tested the same Azure DevOps call through Postman and it worked correctly.  So, I know for sure that I am authorized to access the api.

7 REPLIES 7
Community Support Team
Community Support Team

Re: Send an HTTP request to Azure DevOps returns Unauthorized

Hi @bkelley ,

 

Since the error message contains Unauthorized and the user mentioned in the message pointed to by Object id is not you.

Please try to update or reconfigure the connection of Send an HTTP request to Azure DevOps action to fix an authentication error.

 

In addition, you could consider clearing the credentials of Azure DevOps login in the browser.

 

When I test it on my side, I find that when I update the connection, it will automatically create a connection according to the credentials saved in the browser, and we cannot specify the connection name. So the account that currently creates the connection is not clear.

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bkelley
Level: Powered On

Re: Send an HTTP request to Azure DevOps returns Unauthorized

Thanks for the suggestions, @v-bacao-msft.  I gave them a shot and once I set my Internet Options to have a Security Zone of "Prompt for Username and Password" instead of "Automatic Logon only in Intranet Zone", I was able to delete my Azure DevOps connection and switch accounts.  I didn't see if it was connected to a different account, but rather just made sure I'm using the right one now.

 

I also cleared cache several times just to be certain.  But alas, I am still getting the same Unauthorized error for the same user.

 

It is probably worth noting that we recently switched to Azure DevOps from an on-prem Team Foundation Server setup.  So, I had an old login for MSDN that is separate from my current O365 credentials.  I have associated them now.  I'm just curious if it is somehow still pulling the old credentials instead of the new.  I'm not sure how I would check that.

Community Support Team
Community Support Team

Re: Send an HTTP request to Azure DevOps returns Unauthorized

Hi @bkelley ,

 

The point you mentioned may be the reason why Unauthorized is always displayed.

Basically, as long as the current username and password can be used to log in to Azure DevOps on the browser, then a connection can be created.

You could try using a different browser to configure a similar Flow, delete the existing connection and use the new connection.

However, as far as I know, the current Azure DevOps connector supported by MS Flow seems to be Online Service, not On-premise data source. I am curious whether you can create a connection with Azure DevOps from an On-premise Team Foundation Server.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bkelley
Level: Powered On

Re: Send an HTTP request to Azure DevOps returns Unauthorized

Hey @v-bacao-msft,

 

I tried using a different browser in in-cognito mode to have it force me to login.  I was able to switch accounts and try the old msdn one I had.  That one did not work either.  So, I was able then to switch back to my current account.

 

To update the connection I just went to Connections and did a Switch Account on the Azure DevOps connection.  That did the trick in toggling it between the users.

 

As far as on-premise goes, we've switched over to Azure DevOps, so I shouldn't need to connect that way anymore.  But, I'll admit I don't fully understand the account switch between the two.

 

The more I think about this issue, I feel that it is something specific with the Send an HTTP Request to Azure action.  Both this action and the Create a work item action use the same Azure DevOps connection and it correctly is able to create a work item with my account.  So, either the HTTP action is somehow fudging the authentication or my user account is able to create an item but not query an item.  Plus, I was able to query the item from postman, so it seems it should be able to do both.

 

Is there any way to troubleshoot this further?  Is there any Setting I may have to change for that HTTP action?

 

Thanks again for your response.

Frankkil
Level: Powered On

Re: Send an HTTP request to Azure DevOps returns Unauthorized

Any update on this issue?

 

I face the same problem:

  • Azure DevOps connection works fine
  • Built-in Azure Dev Ops actions leveraging the connection work fine
  • 'Send an HTTP request to Azure DevOps' always returns 'UnAuthorized' even though the same connection is being used
j-i
Level: Power Up

Re: Send an HTTP request to Azure DevOps returns Unauthorized

Same issue. Running into 'Unathorized' with this action. Was there a solution to this?

Frankkil
Level: Powered On

Re: Send an HTTP request to Azure DevOps returns Unauthorized

Radio silence I'm afraid!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 140 members 5,493 guests
Please welcome our newest community members: