Contact Us

How to Integrate HubSpot with Microsoft Dynamics: Step-by-Step Guide

21 May 2025 Nikita Smits-Jørgensen

Integrating HubSpot with Microsoft Dynamics 365 empowers businesses to align marketing and sales data, streamline workflows, and enhance customer experience. This comprehensive guide will walk you through every step, from setting up basic syncs to creating advanced workflows using webhooks and middleware.

Whether you’re syncing contacts, leads, or campaign activity, understanding how these two platforms interact will save your team hours of manual work and eliminate data silos.

Why Sync HubSpot with Microsoft Dynamics?

Integrating HubSpot with Microsoft Dynamics 365 offers a multitude of advantages that significantly enhance business operations. One of the primary benefits is the unification of customer data across both marketing and sales departments. This integration ensures that all teams have access to the same up-to-date information, fostering better collaboration and more informed decision-making. Additionally, the automation of lifecycle updates and lead qualification syncs streamlines processes, reducing manual effort and minimizing the risk of errors. This automation allows teams to focus on strategic activities rather than administrative tasks. Furthermore, the integration improves reporting and forecasting capabilities by utilizing shared data models. This leads to more accurate insights and predictions, enabling businesses to plan more effectively and respond swiftly to market changes.

Common Integration Scenarios

There are several typical scenarios where integrating HubSpot with Microsoft Dynamics proves beneficial. One common scenario is syncing HubSpot contacts as leads in Dynamics. This ensures that potential customers identified in marketing efforts are seamlessly transitioned into the sales pipeline, enhancing lead management efficiency. Another scenario involves breaking syncs based on qualification status. This means that once a lead reaches a certain qualification level, the sync can be adjusted to reflect their new status, ensuring that only relevant data is shared between systems. Additionally, the integration facilitates the creation of new leads from the same contact upon lifecycle advancement. As contacts progress through different stages of the customer journey, new leads can be automatically generated, ensuring that sales teams have the most current and actionable information to work with.

 

Understanding CRM Objects: Leads vs Contacts

HubSpot Contacts vs Dynamics Leads

In HubSpot, you primarily deal with Contacts. Microsoft Dynamics, however, distinguishes between Leads and Contacts.

  • A Lead in Dynamics is a potential client or deal in early stages.

  • A Contact is an individual tied to an Account (Company).

Sync Conflicts and Challenges

Although you can natively sync both a lead and a contact, issues often arise because HubSpot treats each contact as a single email address within the system. In contrast, MS Dynamics allows the creation of 'duplicate' leads for various interactions, which can result in different opportunities. While these aren't considered duplicates within MS Dynamics, they are perceived as such during integration. If your business operates this way, you'll need to devise a workaround to manage this situation.


Initial Setup for HubSpot–Dynamics Integration

Connecting HubSpot and Microsoft Dynamics

  1. Navigate to Settings > Integrations in HubSpot.

  2. Use the Microsoft Dynamics 365 connector.

  3. Authenticate with admin credentials from Dynamics.

One-Way vs Two-Way Sync Options

  • One-way sync: Data flows from one system to the other.

  • Two-way sync: Bi-directional updates for contacts, companies, and deals.

Keep in mind that you can only set the sync direction per object, not per field. So if you have sensitive fields that you need to sync into HubSpot but cannot overwrite, make sure you create a workaround through a workflow for example so you do not risk overwriting the field in CRM. 

Start with email-based matching; later, shift to CRM record ID matching for more accuracy.


Managing Duplicate Leads and Contacts

Using Custom Properties to Manage Sync Behaviour

Create the following custom properties in HubSpot:

  • Send to CRM (boolean)

  • Date of CRM Lead Created (date)

  • Create New Lead (boolean trigger)

These properties help control when a HubSpot contact should sync or stop syncing to a Dynamics record.

Testing "Do Not Match" and Lead Filtering

Use a one-off trigger to send a lead without matching existing CRM records. Ensure the sync criteria explicitly exclude contacts unless the condition is met.


Lifecycle Stage Handling Between Systems

Mapping Lifecycle Stages

Use workflows to ensure lifecycle stages such as MQL (Marketing Qualified Lead) and SQL (Sales Qualified Lead) match the appropriate stage in Dynamics.

There is a slight challenge that one lifecycle stage can only be synced to one object. So your MQL's can be leads or contacts, not both. 

So, for instance, if you’re syncing a contact as a Lead, you can’t use that same field for Contact sync.

To work around this:

  • Use a modified lifecycle stage like Marketing Qualified Contact.

  • Once your lead is qualified, change the lifecycle stage from MQL to Marketing Qualified Contact. I also like using Sales Accepted Lead for this but that comes down the the culture. 

Handling MQL and SQL Transitions

When a lead becomes qualified in Dynamics:

  1. Update the lifecycle stage in HubSpot to "Marketing Qualified Contact".

  2. Set Send to CRM = No to break the sync for that lead.

  3. Optionally, create a new Dynamics Lead from the same contact using a webhook for subsequent conversions.


Step-by-Step Workflow: Create a Lead in Dynamics from HubSpot

Workflow Enrollment Criteria

  • Trigger when:
    Lifecycle Stage = MQL
    AND Exclude from Lead Sync = True

Setting Internal Flags and Sync Filters

  • Set custom property:
    Lead Creation Status = Queued for new Dynamics Lead

 

Triggering a Webhook for New Lead Creation

  • Webhook action setup:

    • POST Method

    • URL: Your Azure proxy endpoint

    • Headers:
      Content-Type: application/json

    • JSON body:

       
      {
      "firstname": "friend",
      "lastname": "",
      "email": "",
      "company": "",
      "lifecycle_stage": "",
      "source": "HubSpot"
      }

Building a Secure Webhook Integration

Azure App Registration and Permissions

  • Register a new app in Azure AD.

  • Grant Dynamics CRM – user_impersonation permission.

Fetching Access Tokens Securely

Use the OAuth 2.0 Client Credentials Flow to fetch a token:

POST https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token

JSON Payload Structure for Lead Creation

Make sure the Azure Function parses incoming JSON and securely authenticates with Dynamics to submit the payload.


Ensuring Data Integrity and Avoiding Overwrites

Managing Name Updates and Field Sync Conflicts

One of the recurring challenges in this integration is unintended name changes. For example, when a lead is qualified in Dynamics, it may overwrite the first or last name of the contact in HubSpot. This typically happens when Dynamics treats the lead and contact as linked records.

Best practice:

  • Avoid using lead name fields that are dynamically altered post-qualification.

  • Use workflows to update names intentionally in HubSpot once Dynamics confirms the lead has been created or qualified.

Use of Text Fields to Prevent Overwrites

Some fields in HubSpot—such as Client ID or Company Tier—should not sync back if their source of truth is Dynamics. The solution is to:

  • Change these fields to text fields in HubSpot.

  • Exclude them from sync mappings in the HubSpot–Dynamics connector.

This avoids accidental overwrites of CRM master data.


Advanced Integration Tactics

Creating Middleware with Azure or AWS Lambda

To go beyond native integration constraints:

  • Set up a proxy endpoint using:

    • Azure Functions

    • AWS Lambda

    • Node.js/Express API

The proxy should:

  • Authenticate using OAuth2.0.

  • POST contact data to /api/data/v9.2/leads.

  • Handle error logging and response parsing.

Managing Lead Sync Exclusions

Use custom properties like:

  • Exclude from Lead Sync = True

  • Create New Lead = Yes

These flags allow granular control over who syncs, when they sync, and how often.


Campaign Syncing Considerations

Managing Campaign Data via Custom Objects

If you plan to sync CRM campaigns into HubSpot:

  • Consider building a custom object in HubSpot.

  • Link campaign activities to contacts via custom workflows.

  • Use middleware to map campaign data from Dynamics into HubSpot-friendly formats.

Feasibility and System Limitations

  • Native integration doesn’t fully support campaign objects.

  • Custom API usage is needed for comprehensive campaign sync.


Best Practices for HubSpot–Dynamics Integration

Recommended Field Mappings

When integrating HubSpot with Microsoft Dynamics, it's crucial to map fields that align with your business processes to ensure seamless data flow and operational efficiency. Key fields to consider include Email, First Name, Last Name, Company, and Lifecycle Stage, as these are fundamental for maintaining consistent customer records across both platforms. Additionally, mapping custom fields such as "Create New Lead" and "Send to CRM" can address specific business needs, allowing for tailored data management and process automation. By solving for business processes through strategic field mapping, you can enhance data accuracy, streamline workflows, and ultimately drive better business outcomes.

HubSpot Field Dynamics Field
Email Emailaddress1
First Name Firstname
Last Name Lastname
Company Companyname
Lifecycle Stage Lead Source or Status
Create New Lead (Custom) Custom Sync Filter Flag

Internal Alerts and Sync Logs

  • Use internal notification emails within workflows to alert your team when a sync action or webhook is triggered.

  • Create a log object or dashboard in HubSpot to monitor sync statuses.

Common Challenges and Troubleshooting Tips

Sync Filter Not Working

  • Double-check that lifecycle stage filters and custom property values are configured exactly as expected in the workflow.

  • Review integration logs in both HubSpot and Dynamics.

Name Changes Propagating Unexpectedly

  • This usually happens when Dynamics auto-updates the contact upon lead qualification.

  • Prevent this by stopping sync before qualification or using proxy endpoints.

Frequently Asked Questions (FAQs)

1. Can I sync both contacts and leads from HubSpot to Dynamics?
Yes, the sync will let you connect to both but you need to consider how you separate them

2. How can I create a new lead from an existing contact?
Use a custom property trigger + webhook. This will stop syncing the old lead and create a new one without overwriting data.

3. What if a lead is already linked to a contact in Dynamics?
HubSpot might treat them as one entity. Manually break the link or exclude them using sync filters.

4. Do I need a developer to implement the webhook?
Yes, ideally. While HubSpot can send webhooks, a middleware service (like an Azure Function) is needed to manage OAuth tokens and API calls securely.

5. Is campaign data syncing possible?
Not natively. You’d need to build a custom object and sync campaign data using middleware or a third-party tool.

Conclusion: Getting the Most Out of HubSpot–Dynamics Sync

Integrating HubSpot with Microsoft Dynamics can transform your marketing and sales alignment. From handling duplicate leads to building webhook-driven workflows, the key lies in planning your data flow, using smart filters, and creating secure proxy endpoints for custom API actions.

While the native sync is powerful, leveraging middleware and custom logic gives you the flexibility to adapt this integration to your exact business needs.

For organizations scaling rapidly, this integration isn’t just a convenience—it’s a competitive advantage.

 

To-Do List: Set Up Your Integration the Smart Way

Here’s a checklist to make sure your HubSpot–Dynamics integration runs smoothly:

🔧 Integration Setup

Connect HubSpot to Microsoft Dynamics 365.

Decide on sync direction (one-way or two-way).

Start syncing based on email address.

🧠 Smart Sync Rules

  • Create Send to CRM property in HubSpot.

  • Create Create New Lead flag.

  • Use lifecycle stage filters (e.g., MQL only) for lead creation.

🛠️ Custom Workflow Setup

Build a contact-based workflow in HubSpot.

Set filters: Lifecycle Stage = MQL AND Exclude from Lead Sync = True.

Add a webhook action to send data to your API endpoint.

🧰 Technical Configuration

Set up Azure AD App for Dynamics API.

Assign permissions (user_impersonation).

Create a backend proxy to handle token requests + API calls.

🔐 Security & Logging

Do not expose client secrets in HubSpot.

Use a secure middleware (Azure Functions, AWS Lambda, etc.).

Log webhook responses and Dynamics errors.

🧪 Testing & Troubleshooting

Test contact-to-lead sync with dummy data.

Watch for name or email overwrites.

Monitor sync logs and update workflows as needed.

CRM
24 May 2023
I'm having a lot of conversations centered around the HubSpot CRM at the moment. I'm working with customers who are either moving away from ...
Read More
Retention Revenue Operations CRM
15 November 2023
Are you taking full advantage of the capabilities of your HubSpot CRM to optimize workflows and improve collaboration with your colleagues? ...
Read More
Revenue Operations HubSpot Salesforce Integration
1 January 1970
Preparation is crucial for the success of your integration process. This stage involves establishing the guidelines for transferring data ...
Read More