I’ve experienced a strange behavior using On-Premise Data Gateway to access an on-premise API through Azure Logic Apps. I kept getting the following error message:
- status: 401
- message: No matching shared key found
- source: gatewayconnector-fc.azconn-fc.p.azurewebsites.net
Using a Logic App Custom Connector
Here is my need: I have two on-premise resources to access :
From a Logic App, the way to access these is by building a Logic App Custom Connector. But, in both cases, I got the same error
Fix the “No matching shared key found” error
It looks like this error happens because my resources aren’t deployed in the same Azure region. Creating the Custom Connector in the same region of my On-Premise Data Gateway fixed the error. However, Logic Apps can only use Custom Connectors in the same region they are. So, I deployed my Logic App in the same region of the On-Premise Data Gateway. But, when you using a hybrid Custom Connector inside a Logic App, you then have to select the On-Premise Data Gateway instance to access the resource. There you can choose any instance, even if it is deployed in another region of your Logic App.
So Why “No matching shared key found” error happens?
At the time I’m writing this post I’m not sure if :
- it’s an unwanted behavior (a bug) on the Custom Connector side
- it’s an unsupported behavior, so you can’t use a Custom Connector to make a hybrid request through a Gateway installed in another region
My guess is this is a bug on the Custom Connector side that needs to be fixed. In the same context, I tried to use managed connectors (access to an on-premise file system or an on-premise database): it doesn’t matter if the Logic App and the On-Premise Data Gateway are in the same region. That works always. Using a Custom Connector, I had to create them both in the same region.