A .NET 9 Blazor application that simplifies the creation of Microsoft Graph External Connections for Microsoft Copilot.
- Automatic App Registration: Creates Azure AD app registrations with required permissions
- Schema Generation: Automatically generates Graph connector schemas from JSON samples
- External Connection Setup: Creates and configures Microsoft Graph External Connections
- Secure Authentication: Uses Microsoft Identity Web for secure authentication
- Easy Credential Management: Provides easy copying of generated client IDs and secrets
- .NET 9 SDK
- Azure AD tenant with admin privileges
- Visual Studio 2022 or VS Code
The user running this application must have the following permissions in Azure AD:
- Application Developer or Application Administrator role
- Ability to grant admin consent to applications
- Go to Azure Portal > Azure Active Directory > App registrations
- Click "New registration"
- Name: "Copilot Connector GUI"
- Supported account types: "Accounts in this organizational directory only"
- Redirect URI: Web -
https://localhost:5001/signin-oidc
- Click "Register"
- In your app registration, go to "API permissions"
- Click "Add a permission"
- Select "Microsoft Graph"
- Choose "Application permissions"
- Add the following permissions:
Application.ReadWrite.All
ExternalConnection.ReadWrite.OwnedBy
ExternalItem.ReadWrite.OwnedBy
- Click "Grant admin consent"
- Go to "Certificates & secrets"
- Click "New client secret"
- Add description and select expiration
- Copy the secret value
Update appsettings.json
with your app registration details:
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "yourdomain.onmicrosoft.com",
"TenantId": "your-tenant-id",
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"CallbackPath": "/signin-oidc"
}
}
-
Start the application:
dotnet run
-
Access the application: Navigate to
https://localhost:5001
-
Sign in: Use your Azure AD credentials
-
Provide Configuration:
- Enter your tenant ID
- Paste a sample JSON object representing your data structure
-
Submit: The application will:
- Create a new app registration
- Generate a client secret
- Grant required permissions
- Create a Graph schema based on your JSON
- Set up the external connection
-
Copy Credentials: Save the generated client ID and secret for your connector implementation
Provide a JSON object that represents the structure of data you want to index. For example:
{
"title": "Sample Document",
"content": "This is the document content",
"category": "Documentation",
"tags": ["sample", "test"],
"createdDate": "2025-01-01",
"author": "John Doe",
"priority": 1
}
- Client Secrets: Store generated client secrets securely
- Permissions: Only grant necessary permissions
- Access Control: Restrict application access to authorized users
- Audit: Monitor app registration and permission usage
- Permission Denied: Ensure you have admin privileges in Azure AD
- Authentication Failed: Verify app registration configuration
- Schema Creation Failed: Check JSON format and Graph API permissions
- Connection Issues: Verify network connectivity and firewall settings
Invalid JSON format
: Check your JSON sample for syntax errorsFailed to create app registration
: Verify admin permissionsSchema registration timeout
: Large schemas may take longer to process
Permission | Type | Description |
---|---|---|
Application.ReadWrite.All |
Application | Create and manage app registrations |
ExternalConnection.ReadWrite.OwnedBy |
Application | Create and manage external connections |
ExternalItem.ReadWrite.OwnedBy |
Application | Manage external items in owned connections |
CopilotConnectorGui/
├── Models/
│ └── TenantConfiguration.cs
├── Services/
│ ├── GraphService.cs
│ ├── AppRegistrationService.cs
│ └── SchemaService.cs
├── Pages/
│ ├── Index.razor
│ └── Shared/
└── wwwroot/
- GraphService: Handles Microsoft Graph authentication and client creation
- AppRegistrationService: Manages app registration creation and permission assignment
- SchemaService: Creates schemas and external connections from JSON samples
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
For issues and questions:
- Check the troubleshooting section
- Review Azure AD logs
- Enable detailed logging in the application
- Create an issue in the repository