Skip to content

Bug report: Got "The host name 'api.bap.microsoft.com' is not allowed for provider 'Microsoft.ProcessSimple'" error when export a Power Automate flow using m365 flow export #2398

@frankchen76

Description

@frankchen76

Description

when use m365 flow export --id $flowId --environment $environment --format json command, I got the following error message:

node.exe : Error: The host name 'api.bap.microsoft.com' is not allowed for provider 'Microsoft.ProcessSimple'
At C:\Program Files\nodejs\m365.ps1:12 char:3
+   & "$basedir/node$exe"  "$basedir/node_modules/@pnp/cli-microsoft365 ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error: The host....ProcessSimple':String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Steps to reproduce

used the below code:

m365 login
$environment = m365 flow environment list --query '[?contains(displayName,`default`)] .name'
$flowId = $(m365 flow list --environment $environment --asAdmin --query "[?displayName == '[my-flow-name]']" -o json | ConvertFrom-Json)[0].Name
# try below
m365 flow export --environment $environment --id $flowId -f 'json'
# and below
m365 flow export --id $flowId --environment $environment --format json --path "$exportPath.json"

Expected result

the Flow should be exported

Actual result

got the following error message

node.exe : Error: The host name 'api.bap.microsoft.com' is not allowed for provider 'Microsoft.ProcessSimple'
At C:\Program Files\nodejs\m365.ps1:12 char:3
+   & "$basedir/node$exe"  "$basedir/node_modules/@pnp/cli-microsoft365 ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error: The host....ProcessSimple':String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Environment

Windows 10 with @pnp/[email protected]

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions