Authenticate pac cli

This post is part of the PacCLI series.


In the first post we have installed the vscode extension, now we are going to use it for the first time.

Create your first profile

  1. Click on the button “Add Auth Profile” Add Auth Profile
  2. The Microsoft “Sign-in dialog” will open Microsoft Sign-in dialog
  3. Enter your credentials for your tenant, where you want to connect to and approve MFA (if enabled)
  4. Then your profile will be visible in the top area and all environments where your user has access to are visible in the lower area.

Add another profile

pac as well as Power Platform Tools are able to manage multiple Authentication profiles. You can easily add another profile for e.g. a different tenant by clicking on the small + icon in the top right of the Authentication profiles. The same Microsoft dialog as before will be opened, and once you entered your credentials the next profile is available and directly selected (marked by the star next to the profile) and the list of environmens will show the ones related to the selected profile.

Manage profiles

  • Hover over a profile and you can either select (star) or delete (recycle bin) a profile.
  • right click on a profile to “Copy User” or “Name/Rename Auth Profile” Manage profiles
  • If you need to clear all Auth Profiles at once, you can select the small list icon with the x at the top right next to add profile and refresh profiles. Profile Options

Use the Terminal

If you are interested, which commands you can use in the terminal, pac offers a great functionality. if you write e.g.,

pac

in the terminal, infromation about the installed version are displayed as well as a list of all available options that you can use together wwith pac. pac commands You will then see, that the third option is

pac auth

If you enter this, you will see the next input parameters that pac is requesting:

pac auth list

will provide you the list of profiles, that you have just created and which you can still see in the top right. The selected Profile is amrked with a star as well in the column “Active”

To change the Active profile you have to use

pac auth select -i 1

If you are unsure what is the next input for a specific command just enter what you know and pac will provide you additional information.

If you enter e.g.

pac auth who

you will get a lot more information than possible with the extension about the currently selected user:


All parts of this series (7)

  1. 1. pac cli Tools
  2. 2. pac canvas
  3. 3. pac cli admin
  4. 4. pac cli Service Principal
  5. 5. pac cli list environments
  6. 6. Authenticate pac cli
  7. 7. Introduction to pac cli