I’m trying to pull contact data from HubSpot using Azure Data Factory but running into issues. I created a private application in HubSpot and I’m using this endpoint to get contact records:
https://api.hubapi.com/crm/v3/objects/contacts
When I test this same endpoint in Postman with OAuth authentication, everything works fine and I can see all the contact data. However, when I set up the REST linked service in Azure Data Factory, the connection test passes but no actual data gets returned during execution.
I’m getting a 401 Unauthorized error that says authentication credentials are missing. The error message points to OAuth documentation but I thought using a Bearer token in the authorization header would handle this.
Has anyone successfully connected Azure Data Factory to HubSpot’s API? I’m wondering if there’s an additional authentication step I’m missing or if the REST connector needs to be configured differently.
I’ve tried using the Bearer token approach since it should bypass the need for OAuth flow, but it seems like ADF might be handling authentication differently than Postman.
That 401 error after passing the connection test? ADF’s probably stripping your auth headers during actual data pulls. Hit this exact issue last year with HubSpot’s v3 API. ADF handles authentication differently between connection tests and pipeline runs - sometimes it overwrites custom headers or applies default auth logic that messes with your Bearer token. Here’s what fixed it: set the linked service authentication to ‘Anonymous’, then manually add your Authorization header with the private app token in the additional headers section. Don’t use ADF’s built-in auth fields. Also double-check your token has the right permissions and hasn’t been regenerated since your Postman tests worked. HubSpot’s developer portal has token usage logs - super helpful for confirming whether ADF’s actually sending your token during pipeline runs.
Check your base URL - ADF sometimes adds extra stuff to endpoints that breaks HubSpot’s routing. Also try adding limit=20 to the URL. HubSpot’s v3 API can be picky about pagination, even on the first request.
I hit the same auth issues with HubSpot and ADF. It’s usually token scope problems, not the auth method. When you made your private app in HubSpot, did you enable the right scopes for CRM data? You need crm.objects.contacts.read and maybe crm.schemas.contacts.read if you want property definitions. I also found ADF sometimes wants explicit Content-Type headers even on GET requests. Try adding ‘application/json’ as Content-Type in your REST connector headers with your Bearer token. Also double-check your private app token hasn’t expired or been regenerated in HubSpot’s developer portal - that’ll give you the exact 401 error you’re seeing even when Postman works fine.
Token juggling between ADF and HubSpot is a nightmare. Been there, done that - building middleware saves you massive headaches.
I built an automation workflow that handles HubSpot auth and gives ADF clean endpoints. No more token refresh issues, scope problems, or ADF’s weird header quirks.
The workflow pulls HubSpot data on schedule, handles OAuth automatically, and formats everything for ADF. You get way better error handling and logging than ADF’s black box REST connector.
I use Latenode for these integrations. Native HubSpot connection, outputs data however ADF wants it. Much more reliable than wrestling with REST connectors.
had this prob too. just check ur bearer token in the headers of the ADF request. sometimes it gets lost! also, don’t confuse the private app token with OAuth one; they act differently in hubspot.