External Api Microsoft Corporation Bidirectional
Rest Api
Connection
Bidirectional
Data Flow
8
Components
4
Dependencies

Description

Microsoft Dynamics 365 is HLF's CRM and member portal platform. The integration synchronises peer mentor certification status and membership data between the mobile app and HLF's Dynamics-based 'Min Side' portal, ensuring that expired certifications automatically suppress mentor profiles from HLF's public website. This is a MUST HAVE integration for HLF's Phase 3 requirements and is the most complex external system dependency.

Detailed Analysis

Microsoft Dynamics 365 is HLF's existing CRM backbone and the most strategically critical external dependency in Phase 3. This bidirectional integration ensures that peer mentor certification status is automatically propagated to HLF's public-facing 'Min Side' portal, so expired certifications suppress mentor profiles without manual intervention. This protects HLF's brand and compliance posture by preventing unqualified mentors from appearing as active. Because the integration runs within HLF's existing Dynamics 365 subscription, there are no additional licensing costs — only developer effort for schema mapping and ongoing maintenance when HLF updates their Dynamics configuration.

The principal business risk is dependency on HLF IT to complete Azure AD application registration and provide Dynamics schema documentation, both prerequisites outside the development team's control. Data security is tightly scoped: credentials are server-side only, OAuth token rotation is enforced via Azure AD lifetime policies, and sync permissions are limited to certification read and sync metadata write — minimising exposure of HLF's member data.

This is the highest-complexity external dependency in the project and the one most likely to cause Phase 3 delivery delays. Four prerequisites must be satisfied by HLF IT before development can begin: Azure AD application registration, provision of Client ID, Client Secret, and Tenant ID, Dynamics 365 API permission grants, and schema documentation for HLF's Dynamics data model. None of these are within the development team's control, making early engagement with HLF IT essential. The integration involves eight components — including the DynamicsPortalClient, HLFDynamicsSyncService, IntegrationConfigDashboard, and IntegrationHealthMonitor — requiring coordinated development and integration testing.

Testing requires a live or sandbox Dynamics 365 environment, which must be arranged with HLF. Ongoing maintenance overhead is non-trivial: any change HLF makes to their Dynamics schema or Azure AD configuration can break the sync and requires developer intervention. Monitoring includes consecutive-failure alerts, certification mismatch detection, and authentication expiry warnings surfaced in the admin dashboard. A manual CSV export fallback is available as a contingency if the automated sync cannot be delivered on time.

The integration uses Microsoft Dynamics 365 Web API v9.2 with OAuth 2.0 client credentials flow authenticated against HLF's Azure Active Directory tenant. Required environment variables — DYNAMICS_TENANT_ID, DYNAMICS_CLIENT_ID, DYNAMICS_CLIENT_SECRET, and DYNAMICS_INSTANCE_URL — must be provisioned server-side only; credentials are never exposed to the mobile client. The sync pattern is delta-based using timestamp conflict detection to minimise API load against Dynamics' 6,000-requests-per-5-minutes rate limit. Failed sync events are logged and retried on the next scheduled run; certification sync failures trigger coordinator notifications.

The IntegrationHealthMonitor component surfaces connectivity state and last-successful-sync timestamps to the admin dashboard. Eight components depend on this integration, including the AccountingExporterService and IntegrationConfigService, requiring careful field-mapping configuration. Fallbacks include a manual CSV export path and local caching of certification status with a staleness indicator. OAuth tokens are automatically rotated via Azure AD token lifetime policies.

Nightly batch sync is the baseline; real-time is explicitly not required for most data, keeping rate limit pressure low.

Dependencies (4)

HLF's Dynamics 365 instance accessible via API External
Azure AD application registration completed by HLF IT External
Dynamics data schema documentation from HLF External
HLF Dynamics portal redesign must not conflict with app's data model External

Authentication

TypeOauth
RequirementsAzure Active Directory application registration, Client ID, client secret, and tenant ID for HLF's Azure AD, Dynamics 365 API permission grants, Service account with appropriate Dynamics roles
ScopesDynamics CRM read/write for member entitiesExport posting permissions

Configuration

Required Settings

DYNAMICS_TENANT_ID Required
DYNAMICS_CLIENT_ID Required
DYNAMICS_CLIENT_SECRET Required
DYNAMICS_INSTANCE_URL Required
Field mapping configuration for sync Required

Optional Settings

Sync schedule (nightly vs real-time) Optional
Conflict resolution strategy Optional
Entity filter expressions Optional

Environment Variables

DYNAMICS_TENANT_ID
DYNAMICS_CLIENT_ID
DYNAMICS_CLIENT_SECRET
DYNAMICS_INSTANCE_URL

Error Handling

Delta sync with timestamp-based conflict detection
Failed sync events logged and retried on next scheduled run
Certification status sync failures trigger coordinator notification
Integration health monitor surfaces connectivity issues to admin dashboard

Monitoring

Health Checks

Dynamics API connectivity check on nightly sync scheduler
Integration health monitor in admin dashboard
Last successful sync timestamp tracking

Metrics

Records synced per run
Sync failure rate
Data divergence between systems

Alerts

Sync failure for 2 consecutive runs
Certification status mismatch detected
Dynamics API authentication expiry

Performance

LatencyNightly batch sync acceptable — real-time not required for most data
AvailabilityDaily sync minimum; certification status changes must propagate within 24 hours

Rate Limits

Microsoft Dynamics 365: 6,000 API requests per 5 minutes per organisation

Cost Implications

Pricing ModelIncluded in HLF's existing Dynamics 365 subscription

Cost Factors

Azure AD application registration (free)
Developer effort to map HLF's Dynamics schema
Ongoing maintenance when HLF updates Dynamics configuration

Security Considerations

Azure AD credentials stored server-side only — never in mobile app
Minimal required Dynamics permissions — read certification, write sync metadata only
Data sync scoped to HLF organisation only via credential isolation
OAuth token rotation enforced via Azure AD token lifetime policies

Fallback Mechanisms

Manual CSV export from app for HLF to import into Dynamics
Coordinator notified of sync failure to manually update portal
Certification status cached locally with staleness indicator