Export a single flow to a Logic App
Summary
Want to upgrade one of your Power Automate flows to a Logic App? Missing the option in the UI? Or just looking at an easy way to do it programmatically?
By combining the CLI for Microsoft 365 and PowerShell we can make this task easy and repeatable.
This script will export the Power Automate flow Your sample test flow, make sure to pass the correct name in the script, and your flow will be exported right away.
Write-Output "Getting environment info..."
$environmentId = $(m365 flow environment list --query "[?displayName == '(default)']" -o json | ConvertFrom-Json).Name
$flowId = $(m365 flow list --environment $environmentId --query "[?displayName == 'Your sample test flow']" -o json | ConvertFrom-Json)[0].Name
Write-Output "Getting Flow info..."
m365 flow export --environment $environmentId --id $flowId -f 'json'
Write-Output "Complete"
Check out the CLI for Microsoft 365 to learn more at: https://aka.ms/cli-m365
Source Credit
Sample first appeared on Export a single flow to a Logic App | CLI for Microsoft 365
Contributors
Author(s) |
---|
Albert-Jan Schot |
Luise Freese |
Disclaimer
THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.