Microsoft Fabric
Microsoft Fabric
Step 1: Create a Workspace
Open Microsoft Fabric.
Select Workspaces.
Click New Workspace.
Enter the workspace name.
Select de WorkSpace Type and Apply.
Step 2: Create the Web v2 Connection
Navigate to Settings > Manage Connections and Gateways.
Click "+ New".
Select Cloud.
Enter a connection name.
Select the connection type : Web v2.
Enter the API base URL:
https://api.teamspowerpack.com.
Enter the
Token Audience URI
: api://11219288-2ee1-4f2d-b6f8-75d817c38d05
Select Authentication method: OAuth 2.0
Click Edit Credentials.
When prompted, sign in using an organizational account.
When prompted, sign in using an organizational account.
Complete the Microsoft authentication flow.
After
authentication
succeeds
,
return
to
the
connection
settings
page and configure
the
privacy
level: Organizational.
Click Create.
V
erify
that
the
connection
is
successfully
created
and
appears
in
the
Manage
Connections
and
Gateways
list
with
a
healthy
status
.
Step 3: Create and Configure the Pipeline
3.1 Create a New Data Pipeline
Navigate to the previously created workspace.
Click "+ New Item".
Select Data Pipeline.
Enter a name.
Click Create.
3.2 Create the Pipeline Variables
Open the Pipeline.
Select the Variables tab.
Click "+ New".
Create the next variables:
Variable Name:
nextPageUrl
Type
: String
3.3 Add the initial API request activity
Drag a Web activity onto the pipeline canvas.
Rename the activity.
Open the Settings tab.
Select the connection created previously.
Add a relative URL.
Select the "GET" Method.
3.4 Validate the initial request.
Save the changes and select Run.
Wait for the activity to complete.
Open the activity output.
Verify that records are returned by the API.
Verify that a nextpagelink property is included when additional pages are available.
Confirm the activity completes successfully before continuing.
3.5 Store the Next Page URL.
Drag a Set Variable activity onto the canvas.
Connect it
to execute after "GetInitialRecords" completes successfully.
Rename
the
activity:
StoreNextPageUrl
Configure the variable to update the value of nextPageUrl.
Set
the value using the following expression:
@replace(activity('GetInitialRecords'
).output
.nextpagelink,
'
https://api.teamspowerpack.com:443
','')
3.6 Add
the
Pagination
Loop
Drag
an Until activity onto the pipeline canvas.
Connect the "StoreNextPageUrl" activity to the Until activity.
Rename
the
activity:
ProcessRemainingPages
Open
the Until activity settings.
Configure
the loop exit condition
@empty(variables('nextPageUrl'))
Leave
the timeout with the default value or adjust it according to the expected execution time.
3.7 Add the Web Activity Inside the Loop
Open the ProcessRemainingPages activity.
Drag a Web activity inside the loop.
Rename the activity: GetNextPage
Open the Settings tab.
Select the existing API connection.
Configure the request method: GET
Configure the Relative URL:
@variables('nextPageUrl')
3.8 Add the Activity to Update the Next Page URL
Drag a Set Variable activity inside the loop.
Connect it to execute after GetNextPage succeeds.
Rename the activity: UpdateNextPageUrl
Configure the variable to update: nextPageUrl
Set the value using the following expression:
@if( contains(activity('GetNextPage').output, 'nextpagelink'),
replace( activity('GetNextPage').output.nextpagelink, 'https://api.teamspowerpack.com:443', ''), '')
3.9 Add the Wait Activity for HTTP 429 Responses
Inside the "ProcessRemainingPages" Until activity, drag a Wait activity onto the canvas.
Connect the Failed path from "GetNextPage" to the Wait activit
Rename the activity: Wait429
Open the activity settings.
Configure the wait duration using the value returned by the API:
@int(activity('GetNextPage').output.retryAfterSeconds)
3.10 Configure the Retry Request
Drag a new Web activity onto the canvas.
Connect the Completion path from "Wait429" to the new Web activity.
Rename the activity: WebRetry
Open the Settings tab.
Select the existing API connection.
Configure the request method: GET
Configure the Relative URL:
@variables('nextPageUrl')
3.11 Update the Next Page URL After the Retry
Add a Set Variable activity after "WebRetry".
Connect it to run when "WebRetry" succeeds.
Rename the activity: UpdateNextPageUrlAfterRetry
Configure the variable.
Variable Name: nextPageUrl
Set the value using the following expression:
@if(
contains(string(activity('WebRetry').output),'nextpagelink'),
replace(
activity('WebRetry').output.nextpagelink,
'https://api.teamspowerpack.com:443',
''
), ''