Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello,
I am trying to ingest data from a rest API using fabric data pipelines, but I am in trouble as oauth2 authentication isn't supported.
Is it possible to know when it will be available?
I ultimatly succeeded in getting data from a web activity (providing manually a token). Is there a way to use this output as a source in the copy activity? I can't setup the source currently due to the oauth2 authentication missing problem, I am trying to find a workaround.
Many thanks for you answers!
Hello, many thanks! I can see the path, but the way to get the token isn't clear (I have client id/client secret, callback uri etc...). Do you have some ressources about it? Is it achievable? I was using a custom connector that I developed before, and I really don't see how to reproduce all the steps here...
Hi @MylenePBI ,
You can send your client id, client secret along with the header in web api activity inorder to get the token. Can you confirm how did you get your token initially?
Hello @MylenePBI ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .
Hi @MylenePBI ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. Did your issue get resolved? Did my answer helped you?
Please let me know if you have any further queries.
Hello, sorry for the late answer...I still have trouble with ClientId and SecretId, I am not sure where and how to put them in the process.
Hi @MylenePBI - Thanks for using Fabric Community,
Inorder to understand how to use client_id and client_secret in your case, please follow below screenshot -
1. Connection - Add your base URL here.
2. Relative URL - Add your relative URL here.
3. Body (Main point) - Can add your client_id and client_secret here in json format
{
"grant_type":"client_credentials",
"client_id":"abcdefg",
"client_secret":"123ghy456"
}
4. Header: Add Content-Type : application/json
Hope this is helpful. In case of any queries please feel free.
Hello @MylenePBI ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .
Hello, I've tried your solution, but I always have the same problem "unsupported media type".
I am not sure what I do is ok. I have several Url:
- 1 base Url
- 1 authorization URL (base+relative)
- 1 token URL (base+relative)
- 1 URL where I call the data.
Currently I succeed in getting the data when I pass directly the token (that I get from postman) to the call with the last URL.
I have tried to follow what you have said to get the token in fabric data factory: Connect to the base URL, add the token relative URL, add client id, client seret, username and password to the body, add Content-type Json-application in the header, use POST method, but I always have this answer.
Hi @MylenePBI ,
The error code 2108 indicates an Unsupported Media Type error. This error occurs when the Content-Type header of the request does not match the media type of the content being sent.
For example, if you are sending JSON data in the body of the request, but the Content-Type header is set to application/x-www-form-urlencoded, the server will reject the request with an Unsupported Media Type error.
To fix this error, you need to make sure that the Content-Type header matches the media type of the content being sent. For example, if you are sending JSON data, the Content-Type header should be set to application/json.
Can you please share few screenshots and details of your implemenation so that I can guide you better?
Note: Try to hide sensitive information in case if any.
Further Queries:
Do you require authorization URL (base+relative) inorder to use token URL (base+relative) and get the token?
As I understand -
token URL (base+relative) --> token (passing) ---> URL (where I call the data) --> data as response
Hi @MylenePBI - Thanks for using Fabric Community,
As I understand you are trying to copy data from rest api to lakehouse with the help of fabric pipelines.
Current challenge in your case is inorder to invoke rest api you required token ( i.e.
Step 10: !Important (inorder to pass token dynamic way, not manually)
Configure value with add dynamic content Bearer @{activity('User_Login_Token').output.data.Token}
Note: .data.Token is as per my json output, you can write your expression based on your json output from API_1.
Hope this is helpful. Please feel free incase of any queries.
You are a genius! It took my some time to adapt it to my REST API, but I got it to work. This is so nice, thank you very much!
Hi Everyone, I can't seem to get this working myself did others get it working? I've configued as per below and the Login bit seems fine. I
The output I am getting from the login doesnt look like the output the previous post has.
I then subsequently get the 401.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
Check out the November 2024 Fabric update to learn about new features.
User | Count |
---|---|
6 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
17 | |
11 | |
9 | |
7 | |
6 |