cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Programatically create a flow (and connection) on behalf of a user

I would like to know if it is possible to "create a flow on behalf of a user" and even "create a connection on behalf of a user".
My scenario is I want a set of users to each have their own flow that "could" use a connection to their own office 365 mailbox. The connection "could" be used as the flow trigger, or I'll create the flow to run on a scheduled basis and use the connection to look at the user's mailbox.
I want to fully automate the process of creating all the individual flows and connections.
I "think" I can create the flows on behalf of the user but I am not sure about creating the connections
(If I cannot create the connections on behalf of the user I will come up with another solution to interrogate the mailbox, probably using the Graph with delegated permissions)
In terms of reference for creating the flow I am looking at:
https://docs.microsoft.com/en-us/flow/web-api
This API lets me create a flow programatically, the next step is "can I do this on behalf of a user".
I can see that this next article suggests I can also execute operations against the CDS REST API on behalf of a user:
https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/impersonate-another-...
But what i don't know is if I can use the impersonate capability to create a flow?
Are there any other powershell commandlets that could help me?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Without the user's ID and password you cannot impersonate them and create a Flow or Connection using their context.  Its simply not designed to work that way.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User III
Dual Super User III

Without the user's ID and password you cannot impersonate them and create a Flow or Connection using their context.  Its simply not designed to work that way.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted

Thanks for the response, I'll look elsewhere for a solution to my particular requirement.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (9,418)