Exception: Could not find any valid connection for connection reference name ‘shared_office365users’ in APIM tokens header.

I am back with another blog on Power Apps and this time it’s about a strange error that I received while invoking a Power Automate flow from the Power Apps.

I had simple Power Automate flow that I was invoking from the Power Apps. And it was working fine.

However the requirement came to get the current user details. So I used the Office 365 Connector to get the user information.

Could not find any valid connection for connection reference in APIM token headers

I saved the flow. Pretty harmless right. After all I have just used the “Get my profile (v2)” connector and nothing complex.

But this time when invoke the Power Automate flow from Power Apps, I get the error – “Exception: Could not find any valid connection for connection reference name ‘shared_office365users’ in APIM tokens header”

Well, this was pretty surprising. I had no clue of the issue. All this was working fine before I introduced the seemingly harmless connector. So must be issue with that.

Banged my head around and finally with no resort, I deleted the Power Automate connection reference and then added it back. And it worked like a charm.

So the trick is to delete the power automate connection reference -> add it back.

Hope this helped!

You will also like the below posts.

Debajit Dutta
Business Solutions MVP

2 thoughts on “Exception: Could not find any valid connection for connection reference name ‘shared_office365users’ in APIM tokens header.”

  1. Microsoft has to do a lot of improvements for sorting such connector errors. This is a deployment nightmare at the moment.

    1. Debajit Dutta (Business Solutions MVP)

      Agreed. And more so the resolution. It took few hours for me to find out the cause and when I could not find any, I deleted and added and it just worked fine.

      -Debajit

Comments are closed.