Managing Profiles
Managing Profiles
Authentication profiles store your configuration for connecting to Microsoft Entra ID. Learn how to create, view, edit, and delete profiles.
Quick Reference
| Task | Command |
|---|---|
| Create new profile | entratool config create |
| List all profiles | entratool config list |
| Edit existing profile | entratool config edit -p NAME |
| Delete profile | entratool config delete -p NAME |
| Export profile | entratool config export -p NAME |
| Import profile | entratool config import -f FILE |
Creating Profiles
Interactive Creation
The easiest way to create a profile:
| |
Prompts:
- Profile name: Unique identifier
- Client ID: From app registration
- Tenant ID: Your Azure AD tenant
- Authentication method: Secret or Certificate
- Scope: API permissions
- OAuth2 flow: (Optional) Default flow
Example session:
Profile name: my-graph-app
Client ID: 12345678-1234-1234-1234-123456789abc
Tenant ID: 87654321-4321-4321-4321-cba987654321
Authentication method:
1. Client Secret
2. Certificate
Select: 1
Client secret: ********************************
Scope: https://graph.microsoft.com/.default
Set default OAuth2 flow? (y/n): y
OAuth2 flow:
1. ClientCredentials
2. AuthorizationCode
3. DeviceCode
4. InteractiveBrowser
Select: 1
✓ Profile 'my-graph-app' created successfullyListing Profiles
View All Profiles
| |
Output:
Available profiles:
1. my-graph-app
Client ID: 12345678-1234-1234-1234-123456789abc
Tenant ID: 87654321-4321-4321-4321-cba987654321
Scope: https://graph.microsoft.com/.default
Flow: ClientCredentials
2. personal-graph
Client ID: abcdef12-3456-7890-abcd-ef1234567890
Tenant ID: common
Scope: https://graph.microsoft.com/User.Read
Flow: InteractiveBrowserJSON Output
| |
Output:
| |
Editing Profiles
Interactive Edit
| |
Select what to edit:
What would you like to edit?
1. Client ID
2. Tenant ID
3. Client Secret
4. Scope
5. OAuth2 Flow
6. Authority URL
q. Done
Select: 4
Current scope: https://graph.microsoft.com/.default
New scope: https://graph.microsoft.com/User.Read Mail.Read
✓ Profile 'my-graph-app' updatedCommon Edits
Rotate client secret:
| |
Change scope:
| |
Switch authentication method:
| |
Deleting Profiles
Delete Single Profile
| |
Confirmation prompt:
Are you sure you want to delete profile 'my-graph-app'? (y/n): y
✓ Profile deleted successfullyWhat gets deleted:
- Profile configuration from
profiles.json - Associated secrets from secure storage
Delete with Force
Skip confirmation:
| |
⚠️ Warning: This is permanent. Secrets cannot be recovered.
Exporting Profiles
Export for Backup
Export profile configuration (without secrets):
| |
Output file:
| |
Export All Profiles
| |
Security Note
Exported files do NOT include secrets or certificates.
You must manually transfer secrets to the new location using secure methods.
Importing Profiles
Import Single Profile
| |
Post-import:
✓ Profile 'my-graph-app' imported successfully
⚠ You must set the client secret:
entratool config edit -p my-graph-appImport with Merge
If a profile with the same name exists:
Profile 'my-graph-app' already exists.
1. Skip
2. Overwrite
3. Rename (import as 'my-graph-app-2')
Select:Batch Import
Import multiple profiles:
| |
team-profiles.json:
| |
Profile Storage
Storage Location
File: ~/.entratool/profiles.json
Platforms:
- Windows:
%USERPROFILE%\.entratool\profiles.json - macOS/Linux:
~/.entratool/profiles.json
What’s Stored
In profiles.json (plaintext):
- Profile name
- Client ID
- Tenant ID
- Scope
- OAuth2 flow preference
- Authority URL
- Certificate path
In secure storage (encrypted):
- Client secrets
- Certificate passwords
Manual Editing
You can manually edit profiles.json:
| |
Example:
| |
⚠️ Be careful: Invalid JSON will break profile loading.
Common Workflows
Scenario: Team Onboarding
Share profiles with new team members:
Export profiles (without secrets):
1entratool config export -o team-profiles.jsonShare
team-profiles.jsonvia secure channelTeam member imports:
1entratool config import -f team-profiles.jsonSecurely share secrets (use Azure Key Vault or password manager)
Team member adds secrets:
1 2entratool config edit -p profile1 # Add client secret
Scenario: Environment Migration
Move profiles from dev to prod machine:
Export from dev:
1entratool config export -p prod-profile -o prod.jsonTransfer file securely (SCP, encrypted USB, etc.)
Import on prod:
1entratool config import -f prod.jsonAdd production secret:
1entratool config edit -p prod-profile
Scenario: Secret Rotation
Rotate client secret after compromise:
- Generate new secret in Azure Portal
- Update profile:
1 2 3entratool config edit -p compromised-profile # Select: Client Secret # Enter: new-secret - Test:
1entratool get-token -p compromised-profile - Delete old secret from Azure Portal
Best Practices
✅ Naming Conventions
Use descriptive, hierarchical names:
| |
✅ Organize by Environment
| |
✅ Separate Concerns
Create profiles for different purposes:
| |
✅ Regular Maintenance
- Review profiles monthly
- Delete unused profiles
- Rotate secrets quarterly
- Update scopes as needed
❌ Avoid
- ❌ Sharing profiles via email
- ❌ Committing profiles to git
- ❌ Using the same profile for dev and prod
- ❌ Storing secrets in plaintext
- ❌ Reusing secrets across profiles
Troubleshooting
“Profile not found”
Cause: Profile name doesn’t exist
Fix:
| |
“Profile already exists”
Cause: Creating profile with duplicate name
Fix:
| |
“Invalid profile configuration”
Cause: Corrupted profiles.json
Fix:
| |
“Cannot access secure storage”
Cause: Platform secure storage unavailable
Fix:
- Windows: Ensure user profile is not corrupted
- macOS: Unlock Keychain
- Linux: Check file permissions on
~/.entratool/