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

Custom Connector - Unauthorized (401) - Power BI

I have followed a post from the Microsoft Power BI community for creating a custom connector for Power BI in Flow.

 

All was fine until I tested the connector in the final screen of the custom connector setup in Flow. The operation would fail with a (401) unauthorized.

 

1.png401 response when testing the connector

The error is:

 

{
  "strict-transport-security": "max-age=31536000; includeSubDomains",
  "x-content-type-options": "nosniff",
  "date": "Fri, 17 May 2019 12:07:54 GMT",
  "requestid": "47ede081-3570-486c-a1ae-149ee435c273",
  "x-frame-options": "deny",
  "content-type": "application/octet-stream",
  "cache-control": "no-store, must-revalidate, no-cache",
  "transfer-encoding": "chunked"
}

 

I double checked my connection in Flow and it has a status of Connected.

 

2.pngFlow connection - valid connection

 

The only differences between my connector and the post are:

 

[1] I am testing it with a call to the Datasets - Get Refresh History In Group end point. I know this works as I have validated it using the Try It feature in documentation. I have set the App in AD with the correct scopes.

 

3.png

 

[2] The automatically generated Redirect URL. The app automatically created a Redirect URL of https://global.consent.azure-apim.net/redirect yet the requests are going to https://europe-001.azure-apim.net/redirect. I added the europe address to the Redirect URIs for the app in Azure AD but I cannot change it in the custom connector. Adding the europe address in Azure AD made no difference.

 

6.pngAutomatically generated and uneditable Redirect URL

 

5.pngRequest header calling europe

 

4.pngEurope and global redirects in AD

This has left me puzzled as to what has gone wrong. I have deleted and recreated the connector and that made no difference. For completeness below are each screen for the connector.

 

7.pngGeneral configuration8.pngSecurity configuration9.pngDefinition configuration - General10.pngDefinition configuration - Request11.pngDefinition configuration - Validation12.pngTest configuration

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
buildbod
Level: Powered On

Re: Custom Connector - Unauthorized (401) - Power BI

Problem solved after a support call with Microsoft. It appears that behind the scenes the Custom Connector may not establish correctly the first time of creation. Create a second connector and it works fine. Then remove the first one.

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Custom Connector - Unauthorized (401) - Power BI

First, thank you so much for providing a detailed overview of your issue. It greatly helps those trying to support you!

With that said, insure that your PowerApp resides in a PowerApps Environment that has access to the Flow (so in the same Office 365 tenant). You select your PowerApps environment from the top bar of the PowerApps portal (documentation), example: 

EnvironmentPickter

I've made this mistake many, many times. I was using an environment that didn't have access to the same Flow tenant. Also, you may want to verify that each step of your Flow is using the right credentials under the My connections popup, example:Credentials.png

If you still have 401 errors, you should reach out to your Office 365 administrators, and have them verify your environment permissions (documentation). 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

buildbod
Level: Powered On

Re: Custom Connector - Unauthorized (401) - Power BI

Thanks @Brad_Groux  . I've double checked the environments and it is not that.

buildbod
Level: Powered On

Re: Custom Connector - Unauthorized (401) - Power BI




I've also tried limiting the reply uri's suggested by this post in the Power BI community. 

buildbod
Level: Powered On

Re: Custom Connector - Unauthorized (401) - Power BI

Super User
Super User

Re: Custom Connector - Unauthorized (401) - Power BI

You may want to submit a support request to the Flow team. Unfortunately, for authorization errors we can't really be of assistance. There is obviously a permissions error someplace in your account and/or environment. 

To submit a support request visit https://flow.microsoft.com/support/ and click the Contact Support link in the bottom right hand corner of the page:ContactSupport.png

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

buildbod
Level: Powered On

Re: Custom Connector - Unauthorized (401) - Power BI

Problem solved after a support call with Microsoft. It appears that behind the scenes the Custom Connector may not establish correctly the first time of creation. Create a second connector and it works fine. Then remove the first one.

View solution in original post

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

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!

Users online (4,524)