TMatthews
TMatthews

Reputation: 3

Why do I get a 401 calling a logic app from APIM

I have a requirement to have a Logic App the reads a file out of blob storage and return it. The goal will be to put this behind APIM. I created 2 stateless Logic Apps (standard and consumption models). They both read the json file and return it with no authentication. I can call them from any browser/workstation and they return the file with no credentials required.

I created an APIM and tried using the Logic App I can see (the consumption model) and also created one manually for the other logic app. When I test the APIM call I get a 401 error.

I have the API calls set to not require a subscription but that didn't do anything. I can call the get method no problem on the ECHO api call so I copied it and just swapped its endpoint with my Logic Apps and get a 401 again.

Any ideas as to why I can call the logic app directly unauthenticated and its fine, but the APIM gets a 401?

I've tried to dummy this down as much as possible. I created a Standard model Logic App with a samp workflow that returns success in the body. I can call it from any browser: Simply returns the word Success

In my APIM I created a new API of type HTTP (manual) and just added the endpoint. I try and test it and get a 401. I can assign it a product and uncheck require subscription and it still gives 401

Adding the endpoint to HTTP

Upvotes: 0

Views: 136

Answers (1)

RithwikBojja
RithwikBojja

Reputation: 11383

Firstly, I have created api calling as below:

Add API:

enter image description here

Created :

enter image description here

I just added Logic App, names , not added any API URL suffix and created.

Then when subscription is enabled :

enter image description here

when called:

enter image description here

When subscription is not enabled :

enter image description here

when called:

enter image description here

In APIM Instance:

enter image description here

If you still get 401, I would suggest you to raise a support request as this is abnormal behavior.

Upvotes: 0

Related Questions