Skip to content

Commit 488ce2e

Browse files
committed
Merge branch 'main' into users/joratz/graphscope
2 parents 57a27e6 + 720b576 commit 488ce2e

41 files changed

Lines changed: 3224 additions & 165 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ This project is currently in active development. The CLI is being actively devel
3131

3232
## Installation
3333

34+
### Prerequisites
35+
36+
Before using the Agent365 CLI, you must create a custom Entra ID app registration with specific Microsoft Graph API permissions:
37+
38+
1. **Custom Client App Registration**: Create an app in your Entra ID tenant
39+
2. **Required Permissions**: Configure **delegated** permissions (NOT Application) as defined in `AuthenticationConstants.RequiredClientAppPermissions` in the codebase
40+
3. **Admin Consent**: Grant admin consent for all permissions
41+
42+
⚠️ **Important**: Use **Delegated** permissions (you sign in, CLI acts on your behalf), NOT Application permissions (for background services).
43+
44+
📖 **Detailed Setup Guide**: [docs/guides/custom-client-app-registration.md](docs/guides/custom-client-app-registration.md)
45+
46+
> **Why is this required?** The CLI needs elevated permissions to create and manage Agent Identity Blueprints in your tenant. You maintain control over which permissions are granted, and the app stays within your tenant's security boundaries.
47+
3448
### Install the CLI
3549

3650
From NuGet (Production):

docs/commands/config-init.md

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,66 @@ Agent name [agent1114]: myagent
6161

6262
**Smart Defaults**: If no existing config, defaults to `agent` + current date (e.g., `agent1114`)
6363

64-
### Step 3: Deployment Project Path
64+
### Step 3: Client App ID
65+
66+
Provide the Application (client) ID of your custom Entra ID app registration:
67+
68+
```
69+
=================================================================
70+
IMPORTANT: Custom Client App Required
71+
=================================================================
72+
The Agent365 CLI requires a custom client app registration in your
73+
Entra ID tenant with specific Microsoft Graph API permissions.
74+
75+
Required Delegated Permissions:
76+
See AuthenticationConstants.RequiredClientAppPermissions in the codebase
77+
for the complete list of required permissions.
78+
79+
If you haven't created this app yet, see:
80+
https://learn.microsoft.com/en-us/microsoft-agent-365/developer/agent-365-cli
81+
82+
=================================================================
83+
84+
Client App ID (Application ID from Entra ID): a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6
85+
86+
Validating client app...
87+
✓ Client app found in tenant
88+
✓ Required permissions configured
89+
✓ Admin consent granted
90+
```
91+
92+
**Validation**: The CLI performs comprehensive validation:
93+
- ✅ GUID format check
94+
- ✅ App exists in your tenant
95+
- ✅ All required permissions are configured (see AuthenticationConstants.RequiredClientAppPermissions)
96+
- ✅ Admin consent has been granted
97+
98+
**If Validation Fails**: You'll see specific error messages and have up to 3 attempts:
99+
```
100+
✗ Validation failed:
101+
- Missing permission: Application.ReadWrite.All
102+
- Admin consent not granted for: DelegatedPermissionGrant.ReadWrite.All
103+
104+
Common issues:
105+
• Not all required permissions have been added to the app
106+
• Admin consent has not been granted (click "Grant admin consent" in Azure Portal)
107+
• Using the wrong GUID (use Application ID, not Object ID)
108+
109+
See troubleshooting guide:
110+
https://learn.microsoft.com/en-us/microsoft-agent-365/developer/agent-365-cli
111+
112+
Retry (2 attempts remaining)? (Y/n):
113+
```
114+
115+
**Prerequisites**: Before running config init, create your custom client app:
116+
1. Follow the guide: [Custom Client App Registration](../guides/custom-client-app-registration.md)
117+
2. Copy the **Application (client) ID** from Azure Portal
118+
3. Ensure admin consent is granted for all permissions
119+
4. Enter the ID when prompted during config init
120+
121+
**Security Note**: This app stays within your tenant's security boundaries and you control which permissions are granted.
122+
123+
### Step 4: Deployment Project Path
65124

66125
Specify the path to your agent project:
67126

@@ -76,7 +135,7 @@ Detected DotNet project
76135
- Detects project platform (.NET, Node.js, Python)
77136
- Warns if no supported project type detected
78137

79-
### Step 4: Resource Group Selection
138+
### Step 5: Resource Group Selection
80139

81140
Choose from existing resource groups or create a new one:
82141

@@ -94,7 +153,7 @@ Select resource group (1-3) [1]: 1
94153
- Option to create new resource group
95154
- Defaults to existing config value if available
96155

97-
### Step 5: App Service Plan Selection
156+
### Step 6: App Service Plan Selection
98157

99158
Choose from existing app service plans in the selected resource group:
100159

@@ -111,7 +170,7 @@ Select app service plan (1-2) [1]: 1
111170
- Option to create new plan
112171
- Defaults to existing config value
113172

114-
### Step 6: Manager Email
173+
### Step 7: Manager Email
115174

116175
Provide the email address of the agent's manager:
117176

@@ -121,7 +180,7 @@ Manager email [agent365demo.manager1@a365preview001.onmicrosoft.com]:
121180

122181
**Validation**: Ensures valid email format
123182

124-
### Step 7: Azure Location
183+
### Step 8: Azure Location
125184

126185
Choose the Azure region for deployment:
127186

@@ -131,7 +190,7 @@ Azure location [westus]:
131190

132191
**Smart Defaults**: Uses location from existing config or Azure account
133192

134-
### Step 8: Configuration Summary
193+
### Step 9: Configuration Summary
135194

136195
Review all settings before saving:
137196

@@ -140,6 +199,7 @@ Review all settings before saving:
140199
Configuration Summary
141200
=================================================================
142201
Agent Name : myagent
202+
Client App ID : a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6
143203
Web App Name : myagent-webapp-11140916
144204
Agent Identity Name : myagent Identity
145205
Agent Blueprint Name : myagent Blueprint
@@ -156,7 +216,7 @@ Tenant : adfa4542-3e1e-46f5-9c70-3df0b15b3f6c
156216
Do you want to customize any derived names? (y/N):
157217
```
158218

159-
### Step 9: Name Customization (Optional)
219+
### Step 10: Name Customization (Optional)
160220

161221
Optionally customize generated names:
162222

@@ -170,7 +230,7 @@ Agent User Principal Name [agent.myagent.11140916@yourdomain.onmicrosoft.com]:
170230
Agent User Display Name [myagent Agent User]:
171231
```
172232

173-
### Step 10: Confirmation
233+
### Step 11: Confirmation
174234

175235
Final confirmation to save:
176236

@@ -188,6 +248,14 @@ You can now run:
188248

189249
The wizard automatically populates these fields:
190250

251+
### Authentication (Required for Microsoft Graph API)
252+
253+
| Field | Description | Source | Example |
254+
|-------|-------------|--------|---------|
255+
| **clientAppId** | Custom Entra ID app registration Application (client) ID | User provides after creating app | `a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6` |
256+
257+
**Important**: This must be configured before setup. See [Custom Client App Registration Guide](../guides/custom-client-app-registration.md) for detailed setup instructions.
258+
191259
### Azure Infrastructure (Auto-detected from Azure CLI)
192260

193261
| Field | Description | Source | Example |
@@ -240,6 +308,7 @@ After completing the wizard, `a365.config.json` is created:
240308
```json
241309
{
242310
"tenantId": "adfa4542-3e1e-46f5-9c70-3df0b15b3f6c",
311+
"clientAppId": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
243312
"subscriptionId": "e09e22f2-9193-4f54-a335-01f59575eefd",
244313
"resourceGroup": "a365demorg",
245314
"location": "westus",

0 commit comments

Comments
 (0)