Search code examples
azureazure-cli

Powershell Command to store Azure credentials in Microsoft Graph


I have a graph application and I am trying to install azure active directory for that and I am entering connecting commands every time is there any option where I can store commands so that I can use it in future.


Solution

  • is there any option where I can store commands so that I can use it in future.

    Yes there is a command where you can store the credentials and use the credentials to connect to the services.

    $AzureAdCred = Get-Credential
    Connect-AzureAD -Credential $AzureAdCred
    
    • The first command will store the credentials in $azureadcred

    • The next command will be connecting to the services in advance.

    enter image description here

    You can go through this Microsoft Document if you want further clarification.