Skip to content

Commit d2ba4e9

Browse files
sellakumaranclaude
andauthored
cleanup: remove internal service references from docs and code (#317)
Remove all references to the internal MOS (Microsoft Online Services) Titles service that were left over after PR #315 stripped the upload logic from the publish command. - Rewrite DEVELOPER.md publish section to reflect zip-only workflow - Update README.md, design.md, and subdirectory READMEs accordingly - Remove dead MOS error codes from ErrorCodes.cs and ErrorMessages.cs - Update deprecation messages in CreateInstanceCommand and A365CreateInstanceRunner - Fix comment in PermissionsSubcommand referencing "MOS Power Platform API" - Remove stale MosConstants, MosTokenService, AgentPublishService, PublishHelpers entries from README docs (those files no longer exist) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 44f3eb9 commit d2ba4e9

16 files changed

Lines changed: 41 additions & 217 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The Microsoft Agent 365 DevTools CLI can be used through the developer journey o
1919
- **develop**: Manage MCP tool servers for agent development
2020
- **develop-mcp**: Manage MCP servers in Dataverse environments
2121
- **setup**: Set up your Agent 365 environment by creating Azure resources, configuring permissions, and registering your agent blueprint for deployment
22-
- **publish**: Update agent manifest and publish package to MOS (Microsoft Online Services); configure federated identity and app role assignments. After publishing, hire your agent through Teams to complete onboarding.
22+
- **publish**: Update agent manifest IDs and package the manifest for upload to the Microsoft 365 Admin Center. After uploading, hire your agent through Teams to complete onboarding.
2323
- **deploy**: Deploy Agent 365 application binaries to the configured Azure App Service and update Agent 365 Tool permissions
2424
- **config**: Configure Azure subscription, resource settings, and deployment options for Agent 365 CLI commands
2525
- **query-entra**: Query Microsoft Entra ID for agent information (scopes, permissions, consent status)

docs/ai-workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ AI workflows are structured markdown documents that guide AI agents (like GitHub
2424
- Setup commands (infrastructure, blueprint, permissions)
2525
- Development commands (MCP management, Dataverse integration)
2626
- Deployment to Azure (multi-platform support)
27-
- Publishing to MOS (Microsoft Online Services)
27+
- Publishing agent manifests for upload to Microsoft 365 Admin Center
2828
- Query operations (Entra ID scopes and permissions)
2929
- Cleanup operations (blueprint, instance, Azure resources)
3030
- Error handling and edge cases

docs/ai-workflows/integration-test-workflow.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ a365 deploy mcp
638638
---
639639

640640
### Section 9: Publish Command
641-
**Objective**: Test manifest publication to MOS
641+
**Objective**: Test manifest packaging and upload preparation
642642

643643
#### Test 9.1: Create Manifest File
644644
```bash
@@ -679,15 +679,13 @@ a365 publish --dry-run
679679

680680
#### Test 9.3: Publish Manifest (Actual)
681681
```bash
682-
# Publish to MOS
682+
# Package manifest for upload
683683
a365 publish
684684

685685
# Expected:
686686
# - Manifest updated with blueprint IDs
687-
# - Package created
688-
# - Published to MOS (Microsoft Online Services)
689-
# - Federated identity configured
690-
# - App role assignments updated
687+
# - Package created (manifest.zip)
688+
# - Upload package to Microsoft 365 Admin Center manually
691689

692690
# Record: Publish succeeded (Yes/No)
693691
# Note: After publish, hire agent through Teams to complete onboarding

docs/ai-workflows/quick-reference.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ a365 deploy mcp # Update MCP only
174174

175175
### Publish
176176
```bash
177-
a365 publish # Publish to MOS
177+
a365 publish # Package manifest for upload to Microsoft 365 Admin Center
178178
a365 publish --dry-run # Show publish plan
179179
```
180180

@@ -472,7 +472,6 @@ $env:AGENT365_TEST_MANAGER_EMAIL
472472
473473
# CLI configuration (optional)
474474
$env:AGENT365_CONFIG_PATH # Override default config location
475-
$env:MOS_TITLES_URL # Override MOS endpoint (testing)
476475
```
477476

478477
---

docs/design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ flowchart TB
5151
Azure["Azure Resource Manager<br/>(App Service, Web Apps)"]
5252
Graph["Microsoft Graph API<br/>(Entra ID, Permissions)"]
5353
Bot["Azure Bot Service<br/>(Messaging Endpoints)"]
54-
MOS["MOS Titles Service<br/>(Agent Publishing)"]
54+
M365["Microsoft 365 Admin Center<br/>(Agent Upload)"]
5555
Dataverse["Dataverse<br/>(MCP Server Management)"]
5656
end
5757
@@ -65,7 +65,7 @@ flowchart TB
6565
Services --> Azure
6666
Services --> Graph
6767
Services --> Bot
68-
Services --> MOS
68+
Services --> M365
6969
Services --> Dataverse
7070
Services --> Config
7171
```

src/DEVELOPER.md

Lines changed: 23 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -148,32 +148,26 @@ a365 develop-mcp list-servers -e "myenv" --verbose
148148

149149
### Publish Command
150150

151-
The `publish` command packages and publishes your agent manifest to the MOS (Microsoft Online Services) Titles service. It uses **embedded templates** for complete portability - no external file dependencies required.
151+
The `publish` command updates manifest IDs from your agent blueprint and packages the manifest files into a zip ready for upload to the Microsoft 365 Admin Center. It uses **embedded templates** for complete portability no external file dependencies required.
152152

153153
**Key Features:**
154154
- **Embedded Templates**: Manifest templates (JSON + PNG) are embedded in the CLI binary
155-
- **Fully Portable**: No external file dependencies - works from any directory
156-
- **Automatic ID Updates**: Updates both `manifest.json` and `agenticUserTemplateManifest.json` with agent blueprint ID
157-
- **Interactive Customization**: Prompts for manifest customization before upload
158-
- **Graceful Degradation**: Falls back to manual upload if permissions are insufficient
159-
- **Graph API Integration**: Configures federated identity credentials and role assignments
155+
- **Fully Portable**: No external file dependencies — works from any directory
156+
- **Automatic ID Updates**: Updates both `manifest.json` and `agenticUserTemplateManifest.json` with the agent blueprint ID
160157

161158
**Command Options:**
162-
- `a365 publish` — Publish agent manifest with embedded templates
163-
- `a365 publish --dry-run` — Preview changes without uploading
164-
- `a365 publish --skip-graph` — Skip Graph API operations (federated identity, role assignments)
165-
- `a365 publish --mos-env <env>` — Target specific MOS environment (default: prod)
166-
- `a365 publish --mos-token <token>` — Override MOS authentication token
159+
- `a365 publish` — Update manifest IDs and create the manifest zip package
160+
- `a365 publish --dry-run` — Preview changes without writing files or creating the zip
167161

168162
**Manifest Structure:**
169163

170164
The publish command works with two manifest files:
171165

172166
1. **`manifest.json`** - Teams app manifest with agent metadata
173-
- Updated fields: `id`, `name.short`, `name.full`, `bots[0].botId`
174-
167+
- Updated fields: `id`, `copilotAgents.customEngineAgents[0].id`, `bots[0].botId`
168+
175169
2. **`agenticUserTemplateManifest.json`** - Agent identity blueprint configuration
176-
- Updated fields: `agentIdentityBlueprintId` (replaces old `webApplicationInfo.id`)
170+
- Updated field: `agentIdentityBlueprintId`
177171

178172
**Workflow:**
179173

@@ -184,26 +178,11 @@ a365 config display
184178
# 2. Run setup to create agent blueprint (if not already done)
185179
a365 setup all
186180

187-
# 3. Publish the manifest
181+
# 3. Package the manifest
188182
a365 publish
189-
```
190-
191-
**Interactive Customization Prompt:**
192-
193-
Before uploading, you'll be prompted to customize:
194-
- **Version**: Must increment for republishing (e.g., 1.0.0 → 1.0.1)
195-
- **Agent Name**: Short (≤30 chars) and full display names
196-
- **Descriptions**: Short (1-2 sentences) and full capabilities
197-
- **Developer Info**: Name, website URL, privacy URL
198-
- **Icons**: Custom branding (color.png, outline.png)
199-
200-
**Manual Upload Fallback:**
201183

202-
If you receive an authorization error (401/403), the CLI will:
203-
1. Create the manifest package locally in a temporary directory
204-
2. Display the package location
205-
3. Provide instructions for manual upload to MOS Titles portal
206-
4. Reference documentation for detailed steps
184+
# 4. Upload the generated manifest.zip to the Microsoft 365 Admin Center
185+
```
207186

208187
**Example:**
209188

@@ -213,90 +192,32 @@ a365 publish
213192

214193
# Dry run to preview changes
215194
a365 publish --dry-run
216-
217-
# Skip Graph API operations
218-
a365 publish --skip-graph
219-
220-
# Use custom MOS environment
221-
$env:MOS_TITLES_URL = "https://titles.dev.mos.microsoft.com"
222-
a365 publish
223195
```
224196

225197
**Manual Upload Instructions:**
226198

227-
If automated upload fails due to insufficient privileges:
228-
229-
1. Locate the generated `manifest.zip` file (path shown in error message)
230-
2. Navigate to MOS Titles portal: `https://titles.prod.mos.microsoft.com`
231-
3. Go to Packages section
232-
4. Upload the manifest.zip file
233-
5. Follow the portal workflow to complete publishing
234-
235-
For detailed MOS upload instructions, see the [MOS Titles Documentation](https://aka.ms/mos-titles-docs).
236-
237-
**MOS Token Authentication:**
238-
239-
The publish command uses **custom client app** authentication to acquire MOS (Microsoft Office Store) tokens:
240-
241-
- **MosTokenService**: Native C# service using MSAL.NET for interactive authentication
242-
- **Custom Client App**: Uses the client app ID configured during `a365 config init` (not hardcoded Microsoft IDs)
243-
- **Tenant-Specific Authorities**: Uses `https://login.microsoftonline.com/{tenantId}` for single-tenant app support (not `/common` endpoint)
244-
- **Token Caching**: Caches tokens locally in `.mos-token-cache.json` to reduce auth prompts
245-
- **MOS Environments**: Supports prod, sdf, test, gccm, gcch, and dod environments
246-
- **Redirect URI**: Uses `http://localhost:8400/` for OAuth callback (aligns with custom client app configuration)
247-
248-
**Important:** Single-tenant apps (created after October 15, 2018) cannot use the `/common` endpoint due to Azure policy. The CLI automatically uses tenant-specific authority URLs built from the `TenantId` in your configuration to ensure compatibility.
249-
250-
**MOS Prerequisites (Auto-Configured):**
251-
252-
On first run, `a365 publish` automatically configures MOS API access:
253-
254-
1. **Service Principal Creation**: Creates service principals for MOS resource apps in your tenant:
255-
- `6ec511af-06dc-4fe2-b493-63a37bc397b1` (TPS AppServices 3p App - MOS publishing)
256-
- `8578e004-a5c6-46e7-913e-12f58912df43` (Power Platform API - MOS token acquisition)
257-
- `e8be65d6-d430-4289-a665-51bf2a194bda` (MOS Titles API - titles.prod.mos.microsoft.com access)
258-
259-
2. **Idempotency Check**: Skips setup if MOS permissions already exist in custom client app
260-
261-
3. **Admin Consent Detection**: Checks OAuth2 permission grants and prompts user to grant admin consent if missing
199+
After `a365 publish` completes:
262200

263-
4. **Fail-Fast on Privilege Errors**: If you lack Application Administrator/Cloud Application Administrator/Global Administrator role, the CLI shows manual service principal creation commands:
264-
```bash
265-
az ad sp create --id 6ec511af-06dc-4fe2-b493-63a37bc397b1
266-
az ad sp create --id 8578e004-a5c6-46e7-913e-12f58912df43
267-
az ad sp create --id e8be65d6-d430-4289-a665-51bf2a194bda
268-
```
201+
1. Locate the generated `manifest.zip` file (path shown in output)
202+
2. Go to [Microsoft 365 Admin Center](https://admin.microsoft.com) > Settings > Integrated apps
203+
3. Upload the `manifest.zip` file
204+
4. Follow the portal workflow to complete publishing
269205

270206
**Architecture Details:**
271207

272-
- **MosConstants.cs**: Centralized constants for MOS resource app IDs, environment scopes, authorities, redirect URI
273-
- **MosTokenService.cs**: Handles token acquisition using MSAL.NET PublicClientApplication with tenant-specific authorities:
274-
- Validates both `ClientAppId` and `TenantId` from configuration
275-
- Builds authority URL dynamically: `https://login.microsoftonline.com/{tenantId}`
276-
- Government cloud: `https://login.microsoftonline.us/{tenantId}`
277-
- Returns null if TenantId is missing (fail-fast validation)
278-
- **PublishHelpers.EnsureMosPrerequisitesAsync**: Just-in-time provisioning of MOS prerequisites with idempotency and error handling
279-
- **ManifestTemplateService**: Handles embedded resource extraction and manifest customization
208+
- **ManifestTemplateService**: Handles embedded resource extraction and manifest ID updates
280209
- **Embedded Resources**: 4 files embedded at build time:
281-
- `manifest.json` - Base Teams app manifest
282-
- `agenticUserTemplateManifest.json` - Agent identity blueprint manifest
283-
- `color.png` - Color icon (192x192)
284-
- `outline.png` - Outline icon (32x32)
285-
- **Temporary Working Directory**: Templates extracted to temp directory, customized, then zipped
286-
- **Automatic Cleanup**: Temp directory removed after successful publish
210+
- `manifest.json` Base Teams app manifest
211+
- `agenticUserTemplateManifest.json` Agent identity blueprint manifest
212+
- `color.png` Color icon (192x192)
213+
- `outline.png` Outline icon (32x32)
214+
- **Temporary Working Directory**: Templates extracted to temp directory, IDs updated, then zipped
215+
- **Automatic Cleanup**: Temp directory removed after successful packaging
287216

288217
**Error Handling:**
289218

290-
- **AADSTS650052 (Missing Service Principal/Admin Consent)**: Shows Portal URL for admin consent or prompts interactive consent
291-
- **AADSTS50194 (Single-Tenant App / Multi-Tenant Endpoint)**: Fixed by using tenant-specific authority URLs instead of `/common` endpoint
292-
- **MOS Prerequisites Failure**: Displays manual `az ad sp create` commands for all three MOS resource apps if automatic creation fails
293-
- **401 Unauthorized / 403 Forbidden**: Graceful fallback with manual upload instructions
294219
- **Missing Blueprint ID**: Clear error message directing user to run `a365 setup`
295-
- **Missing TenantId**: MosTokenService returns null if TenantId is not configured (fail-fast validation)
296220
- **Invalid Manifest**: JSON validation errors with specific field information
297-
- **Network Errors**: Detailed HTTP status codes and response bodies for troubleshooting
298-
- **Consistent Error Codes**: Uses `ErrorCodes.MosTokenAcquisitionFailed`, `ErrorCodes.MosPrerequisitesFailed`, `ErrorCodes.MosAdminConsentRequired`
299-
- **Centralized Messages**: Error guidance from `ErrorMessages.GetMosServicePrincipalMitigation()` and `ErrorMessages.GetMosAdminConsentMitigation()`
300221

301222
## Permissions Architecture
302223

src/Microsoft.Agents.A365.DevTools.Cli/Commands/CreateInstanceCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,11 @@ private static void LogDeprecationError(ILogger logger, string commandName)
520520
{
521521
logger.LogError("ERROR: Command '{Command}' has been deprecated.", commandName);
522522
logger.LogError("");
523-
logger.LogError("This command bypasses the Microsoft Online Services (MOS) workflow,");
523+
logger.LogError("This command bypasses the standard agent registration workflow,");
524524
logger.LogError("which prevents proper agent registration and event propagation.");
525525
logger.LogError("");
526526
logger.LogError("Use the recommended workflow instead:");
527-
logger.LogError(" 1. Run 'a365 publish' to publish your agent to MOS");
527+
logger.LogError(" 1. Run 'a365 publish' to package and upload your agent manifest");
528528
logger.LogError(" 2. Run 'a365 deploy' to deploy your application (if Azure-hosted)");
529529
logger.LogError(" 3. Create an agent instance through Microsoft Teams");
530530
logger.LogError("");

src/Microsoft.Agents.A365.DevTools.Cli/Commands/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This folder contains CLI command implementations. Each command inherits from `As
1515
| **create-instance** | `CreateInstanceCommand.cs` | Agent identity, licenses, and notifications setup |
1616
| **deploy** | `DeployCommand.cs` | Multiplatform deployment to Azure App Service |
1717
| **cleanup** | `CleanupCommand.cs` | Delete agent resources (blueprint, instance, Azure) |
18-
| **publish** | `PublishCommand.cs` | Publish agent manifest to MOS Titles service |
18+
| **publish** | `PublishCommand.cs` | Package agent manifest for upload to Microsoft 365 Admin Center |
1919
| **query-entra** | `QueryEntraCommand.cs` | Query Entra ID scopes for blueprints and instances |
2020
| **develop** | `DevelopCommand.cs` | Development utilities (tokens, permissions, mock server) |
2121
| **develop-mcp** | `DevelopMcpCommand.cs` | MCP server management in Dataverse environments |

src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/PermissionsSubcommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ await SetupHelpers.EnsureResourcePermissionsAsync(
453453
cancellationToken);
454454

455455
// Configure Power Platform API permissions using unified method
456-
// Note: Using the MOS Power Platform API (8578e004-a5c6-46e7-913e-12f58912df43) which is
456+
// Note: Using the Power Platform API (8578e004-a5c6-46e7-913e-12f58912df43) which is
457457
// the Power Platform API for agent operations. This API exposes Connectivity.Connections.Read
458458
// for reading Power Platform connections.
459459
// Similar to Messaging Bot API, we skip addToRequiredResourceAccess because the scopes

src/Microsoft.Agents.A365.DevTools.Cli/Constants/ErrorCodes.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ public static class ErrorCodes
2222
public const string RetryExhausted = "RETRY_EXHAUSTED";
2323
public const string SetupValidationFailed = "SETUP_VALIDATION_FAILED";
2424
public const string ClientAppValidationFailed = "CLIENT_APP_VALIDATION_FAILED";
25-
public const string MosTokenAcquisitionFailed = "MOS_TOKEN_ACQUISITION_FAILED";
26-
public const string MosPrerequisitesFailed = "MOS_PREREQUISITES_FAILED";
27-
public const string MosAdminConsentRequired = "MOS_ADMIN_CONSENT_REQUIRED";
28-
public const string MosServicePrincipalCreationFailed = "MOS_SERVICE_PRINCIPAL_CREATION_FAILED";
29-
public const string MosInsufficientPrivileges = "MOS_INSUFFICIENT_PRIVILEGES";
30-
public const string MosPermissionUpdateFailed = "MOS_PERMISSION_UPDATE_FAILED";
3125
public const string DotNetSdkVersionMismatch = "DOTNET_SDK_VERSION_MISMATCH";
3226
}
3327
}

0 commit comments

Comments
 (0)