Quickstart - Run a workload sample
This quickstart guide shows you how to create and run a Microsoft Fabric workload using a sample workload.
This sample demonstrates storing and reading data from and to lakehouses. To do that, you need to generate tokens for Azure Storage service in On-Behalf-Of (OBO) flows.
Prerequisites
An environment that is set up for workload development.
If Azure storage isn't installed on your tenant, you must be a Global administrator in the tenant.
ASP.NET Core Runtime 6.0 - ASP.NET Core is used to build the sample workload.
.NET 6.0 Runtime - .NET is used to build the sample workload.
Step 1: Setup Azure storage
You need consent to use Azure Storage. In this step you check whether Azure Storage is installed in the tenant, and if it isn't you install it.
Log into the Azure portal.
Search for Enterprise applications and select it from the search results.
From the Application type filter dropdown list, select All applications and then select Apply.
In the Search by application name or object ID search box, enter Azure Storage.
If Azure Storage isn't listed, open PowerShell as an administrator and run the following commands:
Install-Module az Import-Module az Connect-AzureAD New-AzureADServicePrincipal -AppId e406a681-f3d4-42a8-90b6-c2b029497af1
Step 2: Download the sample
Follow these steps to run the sample workload.
Navigate to the Sample Project Directory repository, select Code and then select Download ZIP.
Extract the contents of the zip file to a local directory on your machine. A new folder called Microsoft-Fabric-workload-development-sample-main is created.
Step 3: Get your tenant ID
Follow these steps to get your tenant ID.
Log into Fabric with the user you want to use to create the workload.
Select the Help & Support (the question mark ?) and then select About.
From the Tenant URL, copy the string of numbers and letters after
https://app.powerbi.com/home?ctid=
. This is your tenant ID.For example, if your tenant URL is
https://app.powerbi.com/home?ctid=bbbbcccc-1111-dddd-2222-eeee3333ffff
, your tenant ID isbbbbcccc-1111-dddd-2222-eeee3333ffff
.
Step 4: Create a Microsoft Entra ID application
Use the provided script to create an Azure Entra ID application.
Open PowerShell.
Navigate to Microsoft-Fabric-workload-development-sample-main\Microsoft-Fabric-workload-development-sample-main\Authentication folder.
Run the command in this step. To authenticate, use the credentials of the user you're using to create the workload.
.\CreateDevAADApp.ps1 -applicationName "myWorkloadApp" -workloadName "Org.WorkloadSample" -tenantId "<your-tenant-id>"
Copy the following details from the output of the script:
- ApplicationIdUri / Audience - For example,
api://localdevinstance/<your-tenant-id>/Org.WorkloadSample/OyR
- RedirectURI -
http://localhost:60006/close
- Application Id - For example,
00001111-aaaa-2222-bbbb-3333cccc4444
- secret - For example,
aaaaa~0b0b0b0b0b0b0b0b0b.bb~2d2d2d2d2d2d2
- ApplicationIdUri / Audience - For example,
Step 5: Update the .env.dev file
Navigate to the Microsoft-Fabric-workload-development-sample-main folder and navigate to the Frontend folder.
Open the file .env.dev with a text editor.
Enter the following details:
- DEV_AAD_CONFIG_AUDIENCE= - The audience from the output of the script. For example,
DEV_AAD_CONFIG_AUDIENCE=api://localdevinstance/<your-tenant-id>/Org.WorkloadSample/OyR
. - DEV_AAD_CONFIG_APPID= - The application ID from the output of the script. For example,
DEV_AAD_CONFIG_APPID=00001111-aaaa-2222-bbbb-3333cccc4444
.
- DEV_AAD_CONFIG_AUDIENCE= - The audience from the output of the script. For example,
Save the .env.dev file.
Step 6: Run the frontend
Open PowerShell and do the following:
Navigate to Microsoft-Fabric-workload-development-sample-main\Microsoft-Fabric-workload-development-sample-main\Frontend folder.
To install the dependencies, run the command
npm install
. A new folder called node_modules is created.To start the frontend, run the command
npm start
.Once the frontend runs successfully, you see a message that includes successfully in PowerShell, and your web browser will open with the
http://localhost:60006/
URL. To check that frontend is running successfully, in your browser, navigate tohttp://localhost:60006/manifests
.
Step 7: Open Visual Studio 2022
The rest of the steps in this quickstart are performed in Visual Studio 2022. Use this step to open your solution in Visual Studio 2022. Once your solution is open, you can keep Visual Studio open while you complete the remaining steps.
Navigate to the Microsoft-Fabric-workload-development-sample-main folder and navigate to the Backend folder.
In Visual Studio 2022, open the file Fabric_Extension_BE_Boilerplate.sln.
Step 8: Update the backend files
In the Solution Explorer, expand Fabric_Extension_BE_Boilerplate and open the appsettings.json file and fill in the following fields:
- PublisherTenantId - Your tenant ID. For example,
PublisherTenantId: "bbbbcccc-1111-dddd-2222-eeee3333ffff"
. - ClientId - The Application Id from the output of the script. For example,
ClientId: "00001111-aaaa-2222-bbbb-3333cccc4444"
. - ClientSecret - The secret from the output of the script. For example,
ClientSecret: "aaaaa~0b0b0b0b0b0b0b0b0b.bb~2d2d2d2d2d2d2"
. - Audience - The ApplicationIdUri / Audience from the output of the script. For example,
Audience: "api://localdevinstance/<your-tenant-id>/Org.WorkloadSample/OyR"
.
- PublisherTenantId - Your tenant ID. For example,
Save the appsettings.json file.
In the Solution Explorer, expand the folder Packages > manifest and open the WorkloadManifest.xml file and fill in the following fields:
- AppID - Your App ID. For example,
<AppId>00001111-aaaa-2222-bbbb-3333cccc4444</AppId>
. - RedirectUri - Your redirect URI.
<RedirectUri>http://localhost:60006/close</RedirectUri>
. - ResourceId - The ApplicationIdUri / Audience from the output of the script. For example,
<ResourceId>api://localdevinstance/<your-tenant-id>/Org.WorkloadSample/OyR</ResourceId>
.
- AppID - Your App ID. For example,
Save the WorkloadManifest.xml file.
Step 9: Build the NuGet package
From the Visual Studio menu, select Build > Build Solution. The build creates a NuGet package that includes the frontend and backend XML and JSON files.
From the Output window, take the path that is listed in the row starting with 1>Successfully created package.
In this output example, the path is highlighted in bold.
1>Successfully created package
C:\Dev kit\Microsoft-Fabric-workload-development-sample-main\Microsoft-Fabric-workload-development-sample-main\Backend\src\bin\Debug\ManifestPackage.1.0.0.nupkg
.
Step 10: Copy to your local drive
In the Solution Explorer, open the workload-dev-mode.json file.
Fill in the following fields:
WorkspaceGuid - Your Fabric workspace ID.
You can find your workspace ID by navigating to the workspace you're using in Fabric. Once you're in the workspace, from the URL copy the string of numbers and letters after
https://app.powerbi.com/groups/
. The workspace ID ends with a forward slash. For example, if your workspace URL ishttps://app.powerbi.com/groups/bbbbcccc-1111-dddd-2222-eeee3333ffff/list?experience=power-bi
, your workspace ID isbbbbcccc-1111-dddd-2222-eeee3333ffff
.ManifestPackageFilePath - The path of the manifest package file (step 9). For example,
"ManifestPackageFilePath": "C:\Dev kit\Microsoft-Fabric-workload-development-sample-main\Microsoft-Fabric-workload-development-sample-main\Backend\src\bin\Debug\ManifestPackage.1.0.0.nupkg"
,
Save the workload-dev-mode.json file.
Copy the workload-dev-mode.json file from src/Config to
C:\
.
Step 11: Run the boilerplate
In Visual Studio 2022, from the menu, select the arrow next to IIS Express and from the dropdown menu select Boilerplate.
Select Boilerplate and authorize Visual Studio's requests. A command prompt opens with information about the running solution.
Step 12: Run the DevGateway file
Open PowerShell and navigate to the DevGateway folder.
In PowerShell, run the command:
.\Microsoft.Fabric.Workload.DevGateway.exe
. When the output shows the message info: DevGateway started. the workload is running successfully.
Step 13: Open the sample workload in Fabric
Tip
To open the sample workload in Fabric, you need to have three PowerShell windows open and running:
Open Microsoft Fabric.
Navigate to the workspace that you're using for development.
Select New item.
Open Sample Item (preview).