web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate Connect...
Power Automate
Unanswered

Power Automate Connections - Monitor / alert when expired or broken

(6) ShareShare
ReportReport
Posted on by 29
Hello,

I've seen this question asked in various ways - but it's still not clear to me.
 
Power automate connections. In our environment we have multiple power automate connections that do various things in flows. These connections need renewing every 90D. This is (as far as I can tell) a limitation set by Microsoft and cannot be amended in any way. Sources I could find on that information are here, here, here and here.
 
Now of course in an idea world - you'd have created your connections at the same time and/or they'd be nicely collated to have as few as possible, and they'd all expire at the same time. In reality this is different as we all know.
 
The result is that we have multiple connections which all expire at different intervals. When they expire - they need re-authing in the WebUI. 
 
The only issue is that there is no pro-active alerting to this (be it monitoring the expiry date, or just an email when ones breaks). When you login to the account in PA it of course prompts you to re-auth but that's still very manual.
 
We have external error handling on our critical flows and that's often how we are alerted to this happening as a flow will fail to run due to the expired connection, then we can go and check manually to rectify. Sadly by this time - a few flows could have failed that share the broken connection and a bit of a clean-up exercise has to happen.
 
I'd like a way to either report on connections that are going to expire soon (which I believe isn't possible as that date isn't extractable from anywhere), or a daily report of connections that have expired/broken as of the time it was checked.

I found this article and have made a few iterations of it - and sort of got what I need, but not really:
 

The flow to do this finds flows with error connections, then cycles through the Connector API's from an array variable to find which one matches, gets the relevant information and puts the URL together which, when used, brings you straight to the broken connection (assuming you're logged in with the right account). All seems well. It also does a buttload of other stuff and parses JSON - but that's the high level.
 
The only issue is that as well as taking a while to run as it's a very nested flow - is that if the flow is shared with more than one person / co-owner (in our case a lot of flows are co-owned with a group for resilience) - it picks it up as having an error connection. When I check the flow itself - it has no broken connections.
 
I assume this is because each person that has access within the group can potentially have a connection within the flow and it's one I can't see but is technically broken....I don't know - my brain is mush at this point. When you get into the 4th foreach loop it all starts to melt together in a blur!
 
Needless to say this is kind of making the result a bit useless because the links goto the connection (most of the time - again it depends on you using the right account to access which is another issue as I can't seem to output the owner/creator of the connection) but a lot of the time - the connection isn't broken, it's fine...so....yeah - and the only recurring theme I can find is that this happens in flows that are co-owned by more than one party (be it a group, or just multiple individuals)
 
I don't really know what my question is at this point. Probably a combination of:
 
  • why does the above happen?
  • how do I fix it/exclude this behaviour? (as the output is massively tainted because of it)
  • Is there a better way of reporting on expired connections, or their expiry date? It doesn't have to be in PA.
  • If there isn't - why on earth isn't there and who do I have to sell my soul to in order to make it happen?
  • Will I retain my sanity if I keep trying to do this?
 
Any advice (or sympathy) is very, very welcome...
 
A
Categories:
I have the same question (0)
  • AB_Automate Profile Picture
    29 on at
    Anyone have any ideas?
  • CB-13081250-0 Profile Picture
    6 on at
    I definitely symapthise. We have ~100 flows each with multiple connections in use and this issue has caused some painful despair. You have articulated the situation perfectly, and you are closer to a proper solution than I am.
     
    You can have multiple instances of a connection, which I exploit has a bit of a workaround. Periodically, I go through my flows, click the options and switch the connection to another instance for each step that uses one, then resave the flow. That acts like a connection renewal so that I'm not just waiting for the inevetible flow failures. With the volume of flows I'm talking about, this is a slow and miserable task.
     
    Surely someone at Microsoft can add a simple dashboard thing or notification to tell us when a connection will expire. It is crazy that this is even an issue :(
  • Vicki-White Profile Picture
    14 on at
    I am having the same issue and the work its creating for me is insane. 
    Its particularly tricky when it disconnects on a flow that has multiple approvals as it means having to resubmit and then they go back to the start which is frustrating and adding in delays to the process.
     
    Did you find a workaround at all?.
  • AB_Automate Profile Picture
    29 on at
    @Vicki-White & @CB-13081250-0 - I'm still testing this but I think I may have found a solution (and it was sort of there the whole time - as it's the Parent article of the one I linked in the OP - Get an alert before connections expire and flows fail
     
    Testing this it works as intended - example of environment connections (noting the broken one for Microsoft Bookings) :
     
     
    Script:
     
    $targetEnvironment = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    $targetAccountName = "xxx-xxx@xxxxx.onmicrosoft.com"
    
    (Get-AdminPowerAppConnection).Internal.properties |
        Where-Object {
            $_.environment.name -eq $targetEnvironment -and
            $_.accountName -eq $targetAccountName -and
            $_.statuses.status -ne "Connected"
        }
    Result:
     
     
    Going to edit this further to include all of our environments we want to monitor (and service accounts) then try chucking this into an Azure Runbook or something to run periodically (maybe once an hour), Then if it returns anything, I'll get it to trigger some form of notification somewhere.
     
    I won't mark this as a suggested answer yet but I'll report back with my findings. 


    The Power Automate method I linked to in the OP probably works but this is way simpler.
     
    I will also note before someone says it that the solution to the larger issue is to use proper "Solutions" and connection references, then you can have one connection connected to multiple references. That way, although they still expire, you won't have 30 of them expiring all at different times and you can collate them into a single, or a few (depending on your throughput) which is what I am working towards with an environment redesign to clean up legacy poor design. This will still be useful for this situation - arguably more so as it does mean more single points of failure/connection.

    I have also created a custom connector for our Error Reporting service which isn't reliant on any connections as the credentials are baked into the connector itself. This means that we will always know if connections fail if it's using that as the "Catch" for if the previous run scope error's - BUT needs a flow to attempt to run and fail to alert. Totally reactive rather than proactive and that failed run could cause pain - using this method above and setting it to check once an hour means that the maximum time a connection will be in an error state without us knowing is 59 minutes. Hopefully the increased reaction time and proactive monitoring would mean that failed runs become much less of an occurance.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard