cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Changing flow connection from a user account to a service account

I have many flows that trigger from a submission to a Microsoft Form.  All of the flows I created were using my user account, however with the implementation of MFA, and best practice, I would like to change these to a service account. 

  • Do I make the service account another owner to the flow?
  • How do I change the existing connections from my user account to the service account?
  • If the flow is triggered when a response is submitted to a form, does the service account need access to the form?
  • If the flow needs to write to a SharePoint list, does the service account need to have permission to the SP list?
1 ACCEPTED SOLUTION

Accepted Solutions
yashkamdar
Solution Sage
Solution Sage

Hello Team,

 

Putting in a detailed answer for you that should clear out all your existing queries.

 

Question no 1 - Do I make the service account another owner to the flow

 

Yes, you need to do this because currently there is no option in Power Automate wherein you can just change original owner of the Power Automate.


I would request you to please upvote the idea below to cater the above requirement-

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/allow-the-owner-to-change-the-ownership-of-...

 

 

Question no 2 - How do I change the existing connections from my user account to the service account?

 

Well there are 2 ways to do this-

1. Change individual connections of all the actions (which is too lengthy)

2. Take an export your Power Automate as a Package and then import the package with different user i.e Power Automate account.

How to export and import Flows is given below -

Export and import your flows across environments with packaging

 

I would highly recommend you to go ahead with option no 2.

 

Question no 3 - If the flow is triggered when a response is submitted to a form, does the service account need access to the form?

 

Yes, absolutely you will need access for the account the Power Automate is running under on the form whether this is a SharePoint form or a Microsoft form.

 

Question no 4 - If the flow needs to write to a SharePoint list, does the service account need to have permission to the SP list?

 

Again the answer is YES, if access is not there your Flow solution will not be able to write the file to the SP list and give you an UnAuthorized error.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

13 REPLIES 13
yashkamdar
Solution Sage
Solution Sage

Hello Team,

 

Putting in a detailed answer for you that should clear out all your existing queries.

 

Question no 1 - Do I make the service account another owner to the flow

 

Yes, you need to do this because currently there is no option in Power Automate wherein you can just change original owner of the Power Automate.


I would request you to please upvote the idea below to cater the above requirement-

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/allow-the-owner-to-change-the-ownership-of-...

 

 

Question no 2 - How do I change the existing connections from my user account to the service account?

 

Well there are 2 ways to do this-

1. Change individual connections of all the actions (which is too lengthy)

2. Take an export your Power Automate as a Package and then import the package with different user i.e Power Automate account.

How to export and import Flows is given below -

Export and import your flows across environments with packaging

 

I would highly recommend you to go ahead with option no 2.

 

Question no 3 - If the flow is triggered when a response is submitted to a form, does the service account need access to the form?

 

Yes, absolutely you will need access for the account the Power Automate is running under on the form whether this is a SharePoint form or a Microsoft form.

 

Question no 4 - If the flow needs to write to a SharePoint list, does the service account need to have permission to the SP list?

 

Again the answer is YES, if access is not there your Flow solution will not be able to write the file to the SP list and give you an UnAuthorized error.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

The workaround for this question 2 is such a nightmare...

 

You have to create a "fake" service account only for the purpose of PowerApps, make sure it has owner permissions to the related Forms and Sharepoint lists, share its credentials to other persons, export your flow, import it under the fake account and only them your Flow may run without hiccups even if you leave.

 

But in a large organisation there is no-way this can be done.

 

So now I end-up with a Group-owned Flow, running on a Group-owned Form and a Group-owned Sharepoint list, but if I lose my job tomorrow and my account is closed, then the Flow becomes immediately out-of-service because it has my personal connections and I cannot assign Group-owned connections...

Hi

 

What about Service Principals for SharePoint connectors ?

 

Regards

 

Nigel

Hi @yashkamdar thank you for your detailed reply.

I was wondering thought, when I got to export one of the fields is Environment and there is no reference on the article you sent on what that should be, do you know by any chance what do i need to write there or where can i find the name or what my environment is? thank you

 

It might be a bit late for the OP but this might do the job for someone else, thus I am sharing it here.

 

Based on the original information by yashkamdar, these are the steps that can be followed in order to change the connection from one personal account to a service one. Tested and working at the time of writing.

 

There are two options to start with:

  1. You want the flow to be created/owned/managed/configured and executed in the security context of a service account. This means that you need to know the password for the service account in order to make any changes to the flow, as you will need to logon to flow.microsoft.com using its credentials. You can always make another/your account an additional owner of the flow afterwards, of course.
  2. You want the flow to be created/owned/managed/configured by you, but executed in the security context of a service account. This means that you will only need the credentials of the service account once, when you set up the data connection (see below). You can always make another account an additional owner of the flow.

 

In either case, these are the steps to follow:

  1. If you already have some flows you want to be run in the context of the service account, login as your account and export them as ZIP files.
  2. Depending on your selection of the options above you either log on to Flow using the service account (for opt. 1) or using your account (opt. 2).
  3. Create a new data connection (flow.microsoft.com > Data > Connections > New connection > SharePoint > Connect directly > type in username and password of the services account.
  4. If you chose opt. 1, when logged in as the service account, import the flows from the ZIP file.
  5. If you chose opt. 2, when logged in as yourself, import the flows from the ZIP file.
  6. No matter which option you chose, during the import process, for the connection select the new one you created (the service account one).
  7. If you are using your own account for managing, during the import make sure you don't update the existing flow, rather create a new one.

At the end you will get a new flow that is using the new connection. And anytime you create a new flow, just make sure you select the correct connection (the service account one):

mioiox_0-1645198247305.png

 

That should be it 🙂

 

N.B. Something useful about the service account:

  • Can be an account without any license assigned
  • Should have the necessary (read/modify) access to the SharePoint site/list/library and other resources. If there is no license assigned, granting permissions to the site itself might not be allowed. However, in the case of a Group-connected site (the modern Team site, that is), you can go to SharePoint admin center and make the service account an Additional admin. This will grant him permissions to the site and allow the flows to run.

Best regards and good luck!

hi @mioiox 

Hi All,

 

I have created a flow to update the certain fields based on Onchange of a field.  I have changed the owner to 'service account' from me by adding the flow in existing solution as owner change is not supported for non-solution flow. 

Now, the problem is whenever I or anyone making changes to trigger the flow, it is working as expected but the update event is showing my name but it should (show)be updated by  the Service Account in Audit history as this is the current owner. We need to show the event is updated by service account beacuse other flow shd not run when chnages is made by service account which is not happening as the event is still showing my name

I do not how to change the connetion and connection references against the service account as it is a general account and to make connection we need to sign with that account.So, the connection reference is still using my id.I am not sure if this the reason and if it is then I am afraid of solution as i cannot login with service account to create the connection references

Hi @PCF_USer,

When you say "I cannot login with service account", does this mean you don't have the service account's credentials (i.e., its password)? If you have them, did you try to follow my proposed solution above? And if yes, which option did you choose (as I am not sure I got it completely right from your description)?

Hi @mioiox 

Yes I do not have service account to create flow and connection . 

I was told to change workflow in power automate and that workflow has owner as Service account but the problem is I have created the power automate from my account so I would be the owner.

Can you please help for above question

Also, though i have added it to solution to change the owner I need to create independed automate and distribute it.One way is to select the connection during import but for that also we need service account credential to create connection. Any idea? we can do it?

 

 

I am not a Flow expert at all, but I am pretty sure that if you have the connection setup to use the service account, it doesn't really matter who the owner is - it will display in SharePoint that the changes were made by the service account.

 

Look on these screens. This flow is being created and owned by me, not by the automation.bot service account; this service account is only used for the connection, as explained above:

  1. Flow connection configuration: mioiox_0-1663094019087.png
  2. List items being modified by this flow: mioiox_1-1663094391435.png

     

You need to know your service account's password in order to configure the connection using its security context. Without its password you cannot achieve this and the flow will execute in your security context.

 

I hope I managed to clarify enough. Please take your time to read and understand my previous post.

Good luck!

 

Anonymous
Not applicable

We are also having these issues. It is preventing us from deploying between environments in DevOps for our phased releases between dev, sit, uat, pre-prod, and prod. All of which we would like to be on different release schedules for adequate Power App Lifecycle Management to be in place for our Apps.

 

When we deploy to the next environment from unmanaged to managed it breaks all the connections for flows that were created in our dev environment because they are using the developers user account when they are created. I have tried to explain this problem to our IT Department and get Support for this issue, as I am in Engineering, but they have not resolved it for us as of this date.

I’m also looking for a way to deploy user created flows to other environments and ensuring that the connectors all use the service account.

would love if there was a send or copy to option so users send the flow to staging env then from there once approved click send to prod and svc account is added as the owner and connections all updated to service account. 
just can’t see how I can get a clear deployment process with all the intervention required … would welcome any ideas 🙂

 

 

Anonymous
Not applicable

I, too, had the same problem. Needing to switch the Approval and Outlook / 365 connections from my account to a Service Account. I stumbled upon a solution below.

 

Share the flow with an existing Service Account(SA).

Log in as SA. All steps after this is under SA account.

In PowerAutomate, you should see the flow in question under 'Shared with Me' tab. 

Perform a 'Save As' action on the flow you want changed. the flow, enter your new name as Flow name. Next dialog box will ask to create 'new' connections. Just click continue. The environment detected that the existing connections is not SA, so it wants to create connections with SA user.

Enter your new flow name. Then that's it. Test your flow.

 

Hope this helps / works.

smharrod
Frequent Visitor

Make the account you want the flows to run as a Co-owner and log in using that account. If you have followed best practice and used connection references in all your flows, just create a new connection for the existing connection references, then click on each relevant flow in the Default solution and make sure the associated connections references are active with a green check. If they are not, you will need to create another new connection. You sometimes end up with a long list of multiple connections that don't work, so don't assume choosing an existing connection under that account will work.

 

smharrod_0-1712606300588.png

 

If you are not using connection references, you will need to edit each flow and create and use a new connection for each action that needs one, which is not ideal, as you're making significant changes to a live flow, so will end up with an unmanaged layer if it is a managed solution. You can also try the Save As and create a new flow with new connections as suggested above, which is not ideal either as you'll lose all your existing flow run history.

 

Ideally this all needs thinking about as part of the deployment.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (2,072)