Scope and Coverage
Community Microsoft 365 Provider (This Provider)
This project aims to cover all aspects of Microsoft 365 workloads including:Microsoft Graph API
Full coverage of Microsoft Graph resources for device management, identity, and more
Microsoft Teams
Teams configuration and management via teams.microsoft.com
Exchange Online
Exchange configuration via exchange.microsoft.com
SharePoint Online
SharePoint management via sharepointonline.com
Microsoft Defender
Security configuration via security.microsoft.com
Utility Resources
Helper data sources for metadata and lifecycle management
- Entra ID resources (managed by the azureAD provider)
- Secondary service operations (e.g., Defender for Endpoint security when Intune handles it)
Microsoft terraform-provider-msgraph
The official Microsoft provider focuses exclusively on:- Microsoft Graph API resources
- Generic resource types that map to HTTP operations
- Thin wrapper around the Graph API
The Community Microsoft 365 Provider has broader scope, covering multiple Microsoft 365 services beyond just Microsoft Graph.
Fundamental Design Philosophy
The key difference between these providers lies in their approach to API interactions and the level of abstraction provided.Understanding Microsoft Graph API Complexity
Before comparing providers, it’s important to understand the inherent complexity both must handle: API Characteristics:- Multi-step Operations: Many business operations require multiple sequential API calls
- Eventual Consistency: Writes may not be immediately visible in reads
- Complex Request Bodies: Nested JSON structures with specific OData type annotations
- State Dependencies: Resource creation often requires reading state from multiple related endpoints
- Error Handling Complexity: Different endpoints have different retry requirements
- Assignment Management: Device management resources require separate assignment API calls
- POST to
/deviceManagement/deviceConfigurations(create policy) - POST to
/deviceManagement/deviceConfigurations/{id}/assign(assign to groups) - GET with
$expand=assignments(verify complete state) - Handle eventual consistency between configuration and assignment APIs
- Manage complex assignment target structures with filter relationships
Approach Comparison
terraform-provider-msgraph: Direct API Exposure
The Microsoft provider is a thin wrapper that directly exposes the API’s complexity to users.Resource Architecture
Four generic resource types that map to HTTP operations:msgraph_resource- Generic resource for any Graph API endpoint (POST/GET/PATCH/DELETE)msgraph_resource_action- For performing actions (POST actions like assign, send)msgraph_resource_collection- For managing reference collections ($ref endpoints)msgraph_update_resource- For updating subset of properties (PATCH operations)
Developer Requirements
Graph API Expertise Required:- Deep understanding of Graph API URL structures
- OData query parameter mastery (
$expand,$select,$filter,$top) - Knowledge of complex JSON schema including OData type annotations
- HTTP method mapping (POST vs PATCH vs GET)
- JMESPath queries for extracting data from responses
- Coordinating multiple Terraform resources for complex operations
- Manual
depends_ondeclarations for operation sequencing - Separate data sources needed to read complete resource state
- No built-in retry logic for Graph API-specific issues
- Manual handling of create/update/delete operation differences
Community Microsoft 365 Provider: Business-Focused Abstraction
This provider provides significant abstraction that shields users from API complexity.Resource Architecture
Purpose-built resources that represent complete business operations:- Domain-Specific Resources: Each resource type represents a complete business workflow
- Strongly-Typed Schemas: Intuitive field names and validation rather than raw JSON
- Embedded Relationships: Related operations managed within single resources
- Business Logic Integration: Resources understand context and handle complex workflows automatically
Developer Experience Benefits
Business Domain Focus:- Declarative configuration describing desired end-state
- Intuitive field names (
allow_windows11_upgradevs API’sallowWindows11Upgrade) - Built-in validation catches configuration errors before API calls
- Contextual documentation for each field
- IDE support with autocomplete and validation
- Single resource operations automatically trigger multiple coordinated API calls
- Built-in retry logic handles eventual consistency across all related endpoints
- Raw Graph API errors translated into actionable business context
- Lifecycle optimization uses the most efficient API patterns automatically
- Dependency resolution handles prerequisite operations and timing
Detailed Comparison Examples
Example 1: Group License Assignment
- POST /groups//assignLicense with complex request body construction
- GET /groups/?$select=assignedLicenses for state management
- Differential license assignment logic for updates
- Proper cleanup of managed licenses on deletion
- Built-in retry for throttling and consistency issues
- Knowledge of exact Graph API endpoint structure
- Understanding of assignLicense API’s request body format
- Manual state reading with separate data sources
- Implementation of differential update logic
- Manual cleanup logic
Example 2: Windows Update Ring with Assignments
- POST
/deviceManagement/deviceConfigurations(create policy) - POST
/deviceManagement/deviceConfigurations/{id}/assign(assign to groups) - GET with
$expand=assignments(read complete state) - Built-in retry logic for eventual consistency
- Differential assignment management
- Proper cleanup on deletion
- Understanding of complex OData types
- Knowledge of exact API schema including nested structures
- Manual orchestration across 2-3 different resources
- Assignment construction with proper target types
- Understanding dependency chain between policy and assignment
- Error handling and retry logic across multiple resources
- Separate data sources to read complete state
- Manual lifecycle management for updates
Key Differentiators
| Aspect | Community Provider | MSGraph Provider |
|---|---|---|
| Abstraction Level | High-level business operations | Low-level Graph API wrapper |
| API Knowledge Required | Minimal - focused on business intent | Extensive - must understand Graph API |
| Configuration Complexity | Simple, declarative | Complex, API-centric |
| Multi-API Operations | Automatic chaining | Manual orchestration |
| State Management | Built-in with retries | Manual implementation |
| Error Handling | Comprehensive, contextual | Basic Graph API errors |
| Resource Lifecycle | Complete CRUD automation | Manual CRUD construction |
| Type Safety | Strongly typed schemas | Dynamic JSON bodies |
| Learning Curve | Terraform + business domain | Terraform + Graph API + OData |
When to Choose Which
Choose Community Microsoft 365 Provider When:
- You want Infrastructure-as-Code for M365 without deep Graph API knowledge
- You need complex multi-step operations handled automatically
- You prioritize developer productivity and declarative configuration
- You want built-in best practices for error handling and retries
- Your team focuses on business outcomes, not API intricacies
- You need coverage beyond Microsoft Graph (Teams, Exchange, SharePoint)
Choose Microsoft terraform-provider-msgraph When:
- You need Microsoft’s official support
- You already have strong familiarity with Graph API
- You need maximum flexibility to construct custom API calls
- You prefer thin abstractions over opinionated frameworks
- You’re building simple, single-API-call resources
Support Considerations
The terraform-provider-msgraph is officially supported by Microsoft.The Community Microsoft 365 Provider is community-supported and not officially supported by Microsoft.
Related Resources
- Development Guide - How to build resources
- Provider Schema - Configuration options
- Examples - Example configurations
