cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NigelP
Super User
Super User

Can I copy PowerAutomate flows between environments using PowerShell ?

Hi

 

I want to copy a PowerAutomate flow out of the Default environment and add it into a specific environment.

 

IS their a way of doing that ?

 

I have tried using PowerAutomate, but the "Create Flow" in an environment that I am the environment Owner generates a "Forbidden" 403 error.

 

Regards

 

Nigel

 

6 REPLIES 6
jinivthakkar
Super User
Super User

@NigelP can't you export and import ?

jinivthakkar_0-1620315407110.png

Check this : 

 

https://carldesouza.com/deploying-microsoft-power-automate-flows-from-one-environment-to-another/

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

jinivthakkar
Super User
Super User

@NigelP I found this script but I am not sure if this works and is in pnp, you can give a try:

 

https://pnp.github.io/cli-microsoft365/sample-scripts/flow/export-all-flows-in-environment/

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

NigelP
Super User
Super User

His is the error I get - The caller with object id '10c7b84e-2848-475e-a417-2e20fb097a94' does not have permission for connection '/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/shared-sharepointonl-a71cee62-17b7-4b89-b401-417c3c939eba' under Api 'shared_sharepointonline'.

Hi @jinivthakkar 

 

This exports the flows, but then I need to import the flow into another environment.

 

Regards

 

Nigel

jinivthakkar
Super User
Super User

@NigelP looks like a permission issue, why don't you try your script first on a trial tenant ?

Just checked with @garrytrinder and @appieschot and you cannot import flows using the cli yet as there are issues updating connections.

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,228)