cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnnetteM
Helper IV
Helper IV

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

12 REPLIES 12
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!

 

 

Nicolas07
Advocate I
Advocate I

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

AgainOpen
Helper II
Helper II

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!

 

onewabash
Frequent Visitor

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 🙂

 

 

derrickplusev
Regular Visitor

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.

Helpful resources

Announcements

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Unlocking Community Achievements and Earning Badges

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!     THIS WEEK'S TIP: Unlocking Achievements and Earning BadgesAcross the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. These badges each signify a different achievement--and all of those achievements are available to any Community member! If you're a seasoned pro or just getting started, you too can earn badges for the great work you do. Check out some details on Community badges below--and find out more in the detailed link at the end of the article!       A Diverse Range of Badges to Collect The badges you can earn in the Community cover a wide array of activities, including: Kudos Received: Acknowledges the number of times a user’s post has been appreciated with a “Kudo.”Kudos Given: Highlights the user’s generosity in recognizing others’ contributions.Topics Created: Tracks the number of discussions initiated by a user.Solutions Provided: Celebrates the instances where a user’s response is marked as the correct solution.Reply: Counts the number of times a user has engaged with community discussions.Blog Contributor: Honors those who contribute valuable content and are invited to write for the community blog.       A Community Evolving Together Badges are not only a great way to recognize outstanding contributions of our amazing Community members--they are also a way to continue fostering a collaborative and supportive environment. As you continue to share your knowledge and assist each other these badges serve as a visual representation of your valuable contributions.   Find out more about badges in these Community Support pages in each Community: All About Community Badges - Power Apps CommunityAll About Community Badges - Power Automate CommunityAll About Community Badges - Copilot Studio CommunityAll About Community Badges - Power Pages Community

Tuesday Tips: Powering Up Your Community Profile

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Tip: Power Up Your Profile!  🚀 It's where every Community member gets their start, and it's essential that you keep it updated! Your Community User Profile is how you're able to get messages, post solutions, ask questions--and as you rank up, it's where your badges will appear and how you'll be known when you start blogging in the Community Blog. Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile.     Password Puzzles? No Problem! Find out how to sync your Azure AD password with your community account, ensuring a seamless sign-in. No separate passwords to remember! Job Jumps & Email Swaps Changed jobs? Got a new email? Fear not! You'll find out how to link your shiny new email to your existing community account, keeping your contributions and connections intact. Username Uncertainties Unraveled Picking the perfect username is crucial--and sometimes the original choice you signed up with doesn't fit as well as you may have thought. There's a quick way to request an update here--but remember, your username is your community identity, so choose wisely. "Need Admin Approval" Warning Window? If you see this error message while using the community, don't worry. A simple process will help you get where you need to go. If you still need assistance, find out how to contact your Community Support team. Whatever you're looking for, when it comes to your profile, the Community Account Support Knowledge Base article is your treasure trove of tips as you navigate the nuances of your Community Profile. It’s the ultimate resource for keeping your digital identity in tip-top shape while engaging with the Power Platform Community. So, dive in and power up your profile today!  💪🚀   Community Account Support | Power Apps Community Account Support | Power AutomateCommunity Account Support | Copilot Studio  Community Account Support | Power Pages

Super User of the Month | Chris Piasecki

In our 2nd installment of this new ongoing feature in the Community, we're thrilled to announce that Chris Piasecki is our Super User of the Month for March 2024. If you've been in the Community for a while, we're sure you've seen a comment or marked one of Chris' helpful tips as a solution--he's been a Super User for SEVEN consecutive seasons!   Since authoring his first reply in April 2020 to his most recent achievement organizing the Canadian Power Platform Summit this month, Chris has helped countless Community members with his insights and expertise. In addition to being a Super User, Chris is also a User Group leader, Microsoft MVP, and a featured speaker at the Microsoft Power Platform Conference. His contributions to the new SUIT program, along with his joyous personality and willingness to jump in and help so many members has made Chris a fixture in the Power Platform Community.   When Chris isn't authoring solutions or organizing events, he's actively leading Piasecki Consulting, specializing in solution architecture, integration, DevOps, and more--helping clients discover how to strategize and implement Microsoft's technology platforms. We are grateful for Chris' insightful help in the Community and look forward to even more amazing milestones as he continues to assist so many with his great tips, solutions--always with a smile and a great sense of humor.You can find Chris in the Community and on LinkedIn. Thanks for being such a SUPER user, Chris! 💪 🌠  

Find Out What Makes Super Users So Super

We know many of you visit the Power Platform Communities to ask questions and receive answers. But do you know that many of our best answers and solutions come from Community members who are super active, helping anyone who needs a little help getting unstuck with Business Applications products? We call these dedicated Community members Super Users because they are the real heroes in the Community, willing to jump in whenever they can to help! Maybe you've encountered them yourself and they've solved some of your biggest questions. Have you ever wondered, "Why?"We interviewed several of our Super Users to understand what drives them to help in the Community--and discover the difference it has made in their lives as well! Take a look in our gallery today: What Motivates a Super User? - Power Platform Community (microsoft.com)

March User Group Update: New Groups and Upcoming Events!

  Welcome to this month’s celebration of our Community User Groups and exciting User Group events. We’re thrilled to introduce some brand-new user groups that have recently joined our vibrant community. Plus, we’ve got a lineup of engaging events you won’t want to miss. Let’s jump right in: New User Groups   Sacramento Power Platform GroupANZ Power Platform COE User GroupPower Platform MongoliaPower Platform User Group OmanPower Platform User Group Delta StateMid Michigan Power Platform Upcoming Events  DUG4MFG - Quarterly Meetup - Microsoft Demand PlanningDate: 19 Mar 2024 | 10:30 AM to 12:30 PM Central America Standard TimeDescription: Dive into the world of manufacturing with a focus on Demand Planning. Learn from industry experts and share your insights. Dynamics User Group HoustonDate: 07 Mar 2024 | 11:00 AM to 01:00 PM Central America Standard TimeDescription: Houston, get ready for an immersive session on Dynamics 365 and the Power Platform. Connect with fellow professionals and expand your knowledge. Reading Dynamics 365 & Power Platform User Group (Q1)Date: 05 Mar 2024 | 06:00 PM to 09:00 PM GMT Standard TimeDescription: Join our virtual meetup for insightful discussions, demos, and community updates. Let’s kick off Q1 with a bang! Leaders, Create Your Events!  Leaders of existing User Groups, don’t forget to create your events within the Community platform. By doing so, you’ll enable us to share them in future posts and newsletters. Let’s spread the word and make these gatherings even more impactful! Stay tuned for more updates, inspiring stories, and collaborative opportunities from and for our Community User Groups.   P.S. Have an event or success story to share? Reach out to us – we’d love to feature you!

Top Solution Authors
Users online (6,401)