cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
colinrippeysqa
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
Pstork1
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
Pstork1
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

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

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (68,533)