Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I am trying to access data from REST WEB API protected by AAD token. How can I dynamically pass AAD token to be used in data source header to get authorized and retrive data from API.
I struggled with somethig similar for a JSON query, after mucking around with it for a while I got this work. Not sure if it the same for REST API but may help you.
let
Source = Web.Contents("https://www.wrike.com/api/v3/customfields",
[Headers=[#"Authorization"="bearer m5W.......,FIUK"]
]),
convertToJson = Json.Document(Source),
data = convertToJson[data],
#"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "title", "type"}, {"id", "title", "type"})
in
#"Expanded Column1"
I am also facing the same issue.
Below is my query to configure the data source
let
Source = Json.Document(Web.Contents("https://www.myapirul.com", [Headers=[Authorization=#"AuthenticationToken"]])),
chartMaintenances = Source[chartMaintenances],
#"Converted to Table" = Table.FromList(chartMaintenances, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"WorkOrderNo", "MaintenanceID", "MaintenanceType", "MaintenancePart", "Description", "RaisedBy", "DaysOpen"}, {"Column1.WorkOrderNo", "Column1.MaintenanceID", "Column1.MaintenanceType", "Column1.MaintenancePart", "Column1.Description", "Column1.RaisedBy", "Column1.DaysOpen"})
in
#"Expanded Column1"
where AuthenticationToken is the parameter I have created. When I execute this in PowerBi desktop application, it runs successfully and retrieves the value from the created parameter AuthenticationToken. Now I have doubts about how to pass AuthenticationToken parameter value from embedded power bi application using .net mvc
@Seward12533 In my case I have to get an idenity first which a Guid returned from the backend when user name and password are provided. It's one API call. Then using that idenity get a token which is another API. Then pull actuall data with that token and that is a third API call. Any scenario for that?
Thanks
Thanks for your reply. I am creating report which will be used by different customers with different AAD token values. Is there a way to pass AAD token value programatically to authorization header instead of hard coding it.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 34 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 72 | |
| 72 | |
| 38 | |
| 35 | |
| 26 |