I have an Azure app named myApp. This app is a website on which you have to sign in with your Microsoft account. I created a scope in this app named myscope.

What I want to do is make a web request (in powershell) to this website.

I managed to do it with the method here by "manually" getting the code first and then the token and finally calling

Invoke-RestMethod -Uri "myurl" -Headers  @{"authorization" = "Bearer $token"}

What I want to do now is exactly the same thing but in a fully non-interactive way. I mean without the need to log in manually. without It can be with credentials, client secret or other ideas ...

Could someone explain to me the steps to do this? Thanks !