Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Answered

fixing connection on a schedule

(0) ShareShare
ReportReport
Posted on by 6

Hi,

I have many flows that connect to various 365 resources (outlook, onedrive, excel and etc...).

All those are working under my credentials, and everything's working great!

 

The problem is, that once every while, the connections is broken and I have to manually connect to the portal and fix it.

image.png

The question is - is there way that I can do it programatically on a schedule? instead of having to connect and fix each and every (there are a lot) connections manually.

  • Verified answer
    Pstork1 Profile Picture
    66,864 Most Valuable Professional on at
    Re: fixing connection on a schedule

    For a flow that needs access to your information you would definitely need to give the service account access to that information. 

     

    But in general MFA alone shouldn't require re-authentication of the connection just because the MFA has expired.  The MFA is used at the point where you establish the OAUth connection.  But wouldn't be needed again until the OAuth comes up for renewal, not the MFA. I believe the OAuth refresh token, which is used in place of the user ID and password, timesout at 90 days by default.  There are settings in Azure AD that can shorten this.  Your MFA implementation may have done that, but its not a requirement of MFA.

  • yuryk Profile Picture
    6 on at
    Re: fixing connection on a schedule

    So in my case the flow needs to access my personal data on my mailbox and others like OneDrive. In that case that service account will need to have full access rights to those features... so that means that organization that work with MFA for all their users, will need to have duplicate accounts (private and a dedicated service account) for each employee...

     

    am I missing anything?

  • Pstork1 Profile Picture
    66,864 Most Valuable Professional on at
    Re: fixing connection on a schedule

    Yes, you can do it with a service account.  The easiest way to do that is to log in as the service account, edit the connections, and publish the flow.  The service account will then be the maker and the connections will run in its context.  This will require assigning a license to the service account since it will be running the flows.

  • RobElliott Profile Picture
    10,153 Super User 2025 Season 1 on at
    Re: fixing connection on a schedule

    @yuryk just over a year ago I had the same problem. In my case the connection to SharePoint was breaking every 1 hour and others would occasionally need fixing too. The fix I found (to Microsoft's surprise as they didn't suggest it) was to go into PowerApps and have a look at the Connections screen there. At the time I didn't normally go there because that screen is exactly the same as you get with Flow as they share the connections. Just for curiosity I did a "switch account" a couple of times there (I had already done it in Flow with no change in behaviour) and selected my account. An hour later I noticed back in Flow (as it then was) that the connection had refreshed after 1 hour and I was still connected successfully. I have had no problems since.

    So give it a go and see if it also works for you.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • yuryk Profile Picture
    6 on at
    Re: fixing connection on a schedule

    Thx for the quick response.

    The problem is that my user has MFA enforcement, which expires.

     

    lets try another angle.

    Any way I can use flows such as 'When and email is flagged' (or any other O365 action) with a service account that is not set for MFA?

    right now i'm working on a flow that will create a To-Do task on flagged emails (there's a template, i know).

  • Pstork1 Profile Picture
    66,864 Most Valuable Professional on at
    Re: fixing connection on a schedule

    I am not aware of any way to do this using an automated API.  Its also not a good idea since you would be embedding your user ID and password in any process that does that.  Connections will automatically refresh the OAuth connection on a timed basis.  Normally this works fine.  But some things can interfere, for example when you change your password or when the underlying connection API changes.  These are the kinds of events that make you re-authenticate manually.  Since there isn't one specific cause its hard to even predict when it will happen much less figure out a way to handle it automatically.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492

Featured topics