This is what I was getting when I used Connect-AzAccount
Connect-AzAccount : Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from…