The connect-azuread cmdlet connects an authenticated account for use in azure active directory cmdlet requests.
You can use this authenticated account only with azure active directory cmdlets.
Reading: How to connect azure ad powershell
example 1: connect a powershell session to a tenant
This command connects the current powershell session to an azure active directory tenant. the command prompts you for a username and password for the tenant you want to connect to. the commit parameter prompts you for confirmation.
If multi-factor authentication is enabled for your credentials, you must log in using the interactive option or use the service’s primary authentication.
example 2: connect a session using a variable
The first command gets the user’s credentials and then stores them in the variable $credential.
See also: HTML Styles CSS
The second command connects the current powershell session using the credentials in $credential.
This account authenticates with Azure Active Directory using your organization’s identification credentials. you cannot use multi-factor authentication or microsoft account credentials to run azure active directory cmdlets with this account.
example 3: connect a session as a service principal
This command authenticates the user to the azure active directory as a service principal.