cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
johnthen
Level: Power Up

How to invoke CRUD REST API with user credential by MS Flow

Hi,

 

I have implemented Azure Application Proxy to access on-premises custom MVC REST web application.
The web application works like a middle layer to manage on-prem data (from on-prem DB) and responds the result into JSON format.
The web application is deployed to the on-prem IIS server with Windows Authentication enabled.

 

The Azure Application Proxy is working perfectly with SharePoint Framework (SPFx) web part. On-prem data can be retrieved/updated/deleted without any issue.

We are planning to implement the Azure Application Proxy with Microsoft Flow. Example, after the user click on the PowerApp button, trigger Flow to invoke Update API to update on-prem data.

 

With the example above, I am having an issue to pass the user credentials while MS Flow invokes the Update API.
Below is the error message return by MS Flow:

401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.

 

Hope someone expert here can give me advice.

 

Thanks,

John

5 REPLIES 5
Super User
Super User

Re: How to invoke CRUD REST API with user credential by MS Flow

As the error message states, the account you are trying to utilize does not have the required permissions to perform the action.

If you could provide an expanded screenshot of your Flow and steps, and of any detailed error messages you're receiving we could likely better assist you.

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!

johnthen
Level: Power Up

Re: How to invoke CRUD REST API with user credential by MS Flow

Hi,

 

The flow as simple as this:

  1. Manualy trigger the flow
  2. Invoke REST API to return "Hello World" string from on-prem DB.

Untitled.png

 

Error message:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;} 
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;} 
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>401 - Unauthorized: Access is denied due to invalid credentials.</h2>
  <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>
 </fieldset></div>
</div>
</body>
</html>
v-lin-msft
Level 10

Re: How to invoke CRUD REST API with user credential by MS Flow

Hi @johnthen,

 

According to your error message:

You do not have permission to view this directory or page using the credentials that you supplied.

Could you please check if the configured credentials have sufficient permission.

 

Here are two links that might help you create your request API:

About Azure REST API Reference:

https://docs.microsoft.com/en-us/rest/api/azure/

About Azure AD Application Proxy connector you can refer to this doc:

https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/application-proxy-connectors

 

Best Regards,

Community Support Team _ Lin Tu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnthen
Level: Power Up

Re: How to invoke CRUD REST API with user credential by MS Flow

Hi @v-lin-msft ,

 

Thanks for the references. I will give it a try and keep you updated.

 

Regards,

John

Super User
Super User

Re: How to invoke CRUD REST API with user credential by MS Flow

Hi @johnthen , did the guidance provided by @v-lin-msft prove useful to resolving the issue? If so could you please accept the solution so that others can benefit from the same guidance?





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

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: 369 members 6,482 guests
Please welcome our newest community members: