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.
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.
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.
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.
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 🙂
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 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:
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!
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?
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
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
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:
In either case, these are the steps to follow:
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):
That should be it 🙂
N.B. Something useful about the service account:
Best regards and good luck!
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