pac auth
Manage how you authenticate to various services
Commands
Command | Description |
---|---|
pac auth clear | Clear all authentication profiles stored on this computer |
pac auth create | Create and store authentication profiles on this computer |
pac auth delete | Delete a particular authentication profile |
pac auth list | List the authentication profiles stored on this computer |
pac auth name | Name or rename an existing authentication profile |
pac auth select | Select which authentication profile should be active |
pac auth update | Update name or target environment of an existing authentication profile |
pac auth clear
Clear all authentication profiles stored on this computer
pac auth create
Create and store authentication profiles on this computer
Examples
The following examples show the use of the pac auth create
command.
Basic Create
This example authenticates with the https://myorg.crm.dynamics.com
org.
pac auth create --url https://myorg.crm.dynamics.com
Named Create
This example authenticates with the https://myorg.crm.dynamics.com
org and gives it the name MyOrg
.
pac auth create --url https://myorg.crm.dynamics.com --name MyOrg
Named Create with Service Principal
This example authenticates with the https://myorg.crm.dynamics.com
org, gives it the name MyOrg-SPN
and uses a service principal to do so. Don't forget to add the service principal to your environment.
pac auth create --url https://myorg.crm.dynamics.com --name MyOrg-SPN --applicationId 00000000-0000-0000-0000-000000000000 --clientSecret $clientSecret --tenant 00000000-0000-0000-0000-000000000000
Optional Parameters
--applicationId
-id
Optional: The application id to authenticate with
--certificateDiskPath
-cdp
Optional: The certificate disk path to authenticate with
--certificatePassword
-cp
Optional: The certificate password to authenticate with
--clientSecret
-cs
Optional: The client secret to authenticate with
--cloud
-ci
Optional: The cloud instance to authenticate with
Use one of these values:
Public
UsGov
UsGovHigh
UsGovDod
Mooncake
--deviceCode
-dc
Use the AAD DeviceCode flow for interactive login.
This parameter requires no value. It is a switch.
--environment
-env
Default environment (id, url, unique name or partial name)
--kind
-k
Deprecated: This parameter will be ignored.
--managedIdentity
-mi
Use Azure Managed Identity.
This parameter requires no value. It is a switch.
--name
-n
The name you want to give to this authentication profile (maximum 30 characters)
Note: The length of the name should be between 1 and 30
--password
-p
Optional: The password to authenticate with
--tenant
-t
Tenant id if using application id/client secret or application id/client certificate.
--url
-u
The resource URL to connect to
--username
-un
Optional: The username to authenticate with; shows AAD dialog if not specified
pac auth delete
Delete a particular authentication profile
Example
pac auth delete --index 2
Optional Parameters
--index
-i
The index of the profile to be deleted
Note: The value must be a positive integer
--name
-n
The name of the profile to be active
Note: The length of the name should be between 1 and 30
pac auth list
List the authentication profiles stored on this computer
pac auth name
Name or rename an existing authentication profile
Example
The following example shows how to rename an auth profile. In this case, the profile with index 1 will be renamed to 'Contoso Dev'.
pac auth name --index 1 --name "Contoso Dev"
Required Parameters
--index
-i
The index of the profile to be named/renamed
Note: The value must be a positive integer
--name
-n
The name you want to give to this authentication profile (maximum 30 characters)
Note: The length of the name should be between 1 and 30
pac auth select
Select which authentication profile should be active
Example
pac auth select --index 2
Optional Parameters
--index
-i
The index of the profile to be active
Note: The value must be a positive integer
--name
-n
The name of the profile to be active
Note: The length of the name should be between 1 and 30
pac auth update
Update name or target environment of an existing authentication profile
Examples
The following examples show the use of the pac auth update command.
Update auth profile with environment URL
This example shows how to update the auth profile with index 1 with the name Contoso Dev
and the environment URL https://contosodev.crm.dynamics.com
.
pac auth update --index 1 --name "Contoso Dev" --environment "https://contosodev.crm.dynamics.com"
Update auth profile with environment ID
This example shows how to update the auth profile with index 1 with the environment ID 00000000-0000-0000-0000-000000000000
.
pac auth update --index 1 --environment 00000000-0000-0000-0000-000000000000
Required Parameters
--index
-i
The index of the profile to be named/renamed
Note: The value must be a positive integer
Optional Parameters
--environment
-env
Default environment (id, url, unique name or partial name)
--name
-n
The name you want to give to this authentication profile (maximum 30 characters)
See also
Microsoft Power Platform CLI Command Groups
Microsoft Power Platform CLI overview
Feedback
Submit and view feedback for