Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
smeetsh
Frequent Visitor

Passing a bearer token to copy data action using GET

Hi All,

 

Not a question, but something I ran into, as I am just picking up MS Fabric, pipelines etc.

I needed to use web request, to get an access token that is valid for 30 minutes. Next I needed to use that token as a bearer token to do a follow up API call to get actual data , there didn't seem to be that much info around, when I tried to google it. Eventually I found a you tube video, that told me what i needed to know. (linked below). Things like apikeys and other credentials will of course vary on the API yo are trying to use.

 

This is my flow.

smeetsh_1-1714693398287.png


Step 1 
Do your web request

smeetsh_0-1714693348722.png

 

Step 2 link the Web and copy data action

 

Step 3 In the copy data action  set it up as follows:

smeetsh_2-1714693511064.png

As you can see the value of the Authorization header is dynamic, with in my case, the following expression:

Bearer @{activity('Get access token').output.access_token}

The part ".access_token" depends on the json you get returned, in my case it was a very flat structure with no above array.
{
    "token_type": "BearerToken",
    "issued_at": "xxx",
    "salesforce_id": "xxx",
    "access_token": "xxx",
    "application_name": "xxx",
    "scope": "refresh_token full",
    "expires_in": "xxx"
}

Above you can see where i got the parameter access_token from. If this array had been nested in for instance another array called  "data" then the value would have been data.access_token in stead of just access_token.

I hope this is usefull info to share here. The video I got this from you can find here .

Cheers

Hans




 

1 ACCEPTED SOLUTION

Good morning,

Yes just sharing knowledge, since it wasn't so straightforward to find as I thought it would be

 

Cheers

Hans

View solution in original post

2 REPLIES 2
v-gchenna-msft
Community Support
Community Support

Hi @smeetsh ,

Thanks for using Fabric Community. 
Can you please confirm whether this is a question or just sharing the knowledge across the Community?
As I understand you are just sharing the knowledge across the Community.

Good morning,

Yes just sharing knowledge, since it wasn't so straightforward to find as I thought it would be

 

Cheers

Hans

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayFBCUpdateCarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.