m365 flow list throws error "x-ms-client-scope header must not be null or empty"

See original GitHub issue

Hello, I am trying to monitor my Power automate flows through a scheduled powershell script + m365 CLI. I use the following command which works perfectly with my user account: m365 flow list --environment $environment --output json

Now I would like to use it through an app ID authentication (m365 login --secret). I made an app registration with access to Flow Service (Flow.Read.All as API permission). I login succesfully but when I run the same command, I get the following error: x-ms-client-scope header must not be null or empty

Behing the scene I guess the power automate API use delegated permissions. Is there a way to execute the m365 flow command without a user account ? I think of using a service account but if you have another thoughts, please help 😃. Or maybe there is something specific to configure within the app registration to make it work with m365 CLI ? I saw @VelinGeorgiev had the same issue a couple of years ago : https://github.com/pnp/cli-microsoft365/issues/1048 David

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
appieschotcommented, Nov 9, 2022

@milanholemans yeah we should catch this scenario and provide better feedback

1reaction
milanholemanscommented, Nov 8, 2022

Hi @David74000

Just checked, the API we are calling only supports delegated authentication. The error you are getting back is quite weird indeed, but I can confirm that you cannot send a request with application permissions. We need Azure Service Management permissions which only support delegated authentication.

Maybe it’s a good idea that we just throw an error when someone tries to run the command with application permissions like we do for Planner commands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

o365 flow list throws error "x-ms-client-scope header must not ...
Description: o365 flow list throws error "x-ms-client-scope header must not be null or empty". Steps to reproduce (office 365 cli - BETA):.
Read more >
Solved: Parameter 'To' cannot be null or empty. (but it's
The error message is saying that the Hiring Manager UPN field does not contain any data; it is empty. Please check that SharePoint...
Read more >
Working with Nulls and Empty Lists in SharePoint - YouTube
In this video follow Jonathon as he builds a flow with Microsoft Power Automate with a manual trigger that adds an item on...
Read more >
Add & Update Excel Data to SharePoint List using ... - YouTube
This video is a step-by-step tutorial on how to add and update your SharePoint list items from Excel Table data using Power Automate...
Read more >
Different ways of getting Excel data using Power Automate
Then we will loop through each of the columns/headings,. filter the rows for which the current column is not empty and; then select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found