---
lab:
title: TechLab: Tech Connect Frontier Hack
description:
level: 300
duration: 120 minutes
islab: true
primarytopics:
---
@lab.Title
Please enter your own Microsoft alias (without the @microsoft.com) in the field below before starting the lab. This information is required to correctly associate your activity with your learner record and ensure your completion is accurately captured and reported. For data integrity and compliance reasons, learners may only enter their own alias. After completing the lab, please allow up to 5 business days for all reporting systems to fully reflect your completion.
@lab.ActivityGroup(aliascapture)
===
@lab.ActivityGroup(initialsurvey)
===
To begin, sign in to the virtual machine using the following credentials: +++@lab.VirtualMachine(Win11-Pro-Base).Password+++
Note: Text formatted as an +++example+++ represents type text. Selecting this text will automatically insert it to prevent any typing errors.
- Open your web browser
- Browse to:
https://app.fabric.microsoft.com - Sign in with your lab credentials (provided separately under the Resources Tab)
- Wait for the Fabric home page to load
- In the left navigation pane, select Workspaces
- Select the + New workspace button
- Enter workspace name:
NovaMart{your microsoft alias}- Example: If your alias is
xyz, useNovaMartxyz
- Example: If your alias is
- Select Advanced to expand advanced options
- The assigned F8 capacity will be auto populated in the Details section. No action required here.
- Select Apply to create the workspace
- Ensure you are in your newly created workspace (check the workspace name at the top)
- Select + New item in the toolbar
- Scroll down and select Lakehouse or Type Lakehouse in the search
- Enter lakehouse name:
lh_NovaMart(Ensure the Location is displaying the newly created worksapce) - Select Create
- Select your workspace name in the breadcrumb navigation to return to the workspace view
- Select Import> Notebook> From This Computer
- In the import dialog, select Upload
- Browse to:
C:\LabFiles\00-Setup-Lakehouse-Data.ipynb - Select the imported notebook and select Open
- Wait for the import to complete
Verification: The notebook
00-Setup-Lakehouse-Dataappears in your workspace items.
- Select the notebook 00-Setup-Lakehouse-Data to open it
- In the sidebar on the left side, locate and select Add Data items
- Select From OneLake catalog option
- From the list, choose lh_NovaMart
- Select Add.
- In the Explorer pane, choose ... on lh_Novamart and set as default lakehouse.
Verification: The lakehouse name
lh_NovaMartnow appears in the left sidebar under the Lakehouse section.
- At the top of the notebook, select the Run all button
- Wait for all cells to execute sequentially
- Monitor the progress indicator as cells complete
- When execution completes (within 1-2 minutes), scroll to the bottom and verify the output
- Return to your workspace (select the workspace name in the breadcrumb navigation)
- Select the lh_NovaMart lakehouse
- In the explorer pane on the left, expand Tables
- Right-click on the three dots (...) under tables and click refresh.
- Confirm you see the tables:
dim_customersdim_productsdim_merchantsfact_customer_events
- Select any table name to preview the data
Verification: Each table contains data as shown in the preview pane.
- Browse back to your workspace
- Select + New item > Serch bar
- In the search bar, type Data Agent and select it
- Enter name:
NovaMart-DataAgent - Select Create
- Wait for the Data Agent to provision
Verification: The Data Agent interface opens with a chat window.
- In the Data Agent view, select Add data> Data source
- Select Lakehouse from the available data source types
- Choose lh_NovaMart from the dropdown list
- Select all tables by checking the boxes:
dim_customersdim_productsdim_merchantsfact_customer_events
Verification: The Data Agent settings show lh_NovaMart as a connected data source with all tables.
- In Fabric, go to your Data Agent
- Select the Agent Instructions
- Open the file:
C:\LabFiles\DataAgent-Instructions.txtusing Notepad - Select all content (Ctrl+A) and copy (Ctrl+C)
- Return to the Data Agent settings
- Paste the ENTIRE content into the Agent Instructions text box (Ctrl+V)
- Within the Data Agent
- Choose the three dots (...) in
lh_NovaMartlakehouse - Select the Data Source Instructions
- Open the file:
C:\LabFiles\DataSourceInstructions.txtusing Notepad - Copy PART 1 (text between the "---START COPYING HERE---" and "---STOP COPYING HERE---" markers)
- Paste into the Description field
- Scroll down to find the "Instructions" field (large text area with markdown support)
- In the same
DataSourceInstructions.txtfile, scroll to PART 2 - Copy PART 2 (text between the "---START COPYING HERE---" and "---STOP COPYING HERE---" markers)
- Paste into the Instructions field
- Choose the three dots (...) in
lh_NovaMartlakehouse - Select the Example Queries
- Choose Import from JSON
- Open the file: C:\LabFiles\Example-Queries.json
- Select all the examples
Verification: Your data source now has both description and instructions configured and also your example queries need to be updated with no errors
- In the Data Agent interface, select the Publish button (top right)
- In the publish dialog, review the settings:
- Name: NovaMart-DataAgent
- Description: AI-powered analytics agent for NovaMart data
- Select Publish
- Wait for the success message
- Once Published, select the Settings icon in the Data Agent interface
- Browse to the Publishing section or Deployment tab
- Locate the Published URL field
- Select the Copy icon or select and copy the URL (Ctrl+C)
- IMPORTANT: Save this URL somewhere safe - you will need it later
Verification: You have copied the Data Agent URL.
- In the Data Agent chat interface, type the following question:
Which product category had the most paid orders over the past 12 months? - Press Enter or select the Send button
- Wait for the agent to process and respond
Verify the Response: Check to see if the Data Agent returns a response**
-
Open VS Code, go to File and select Open Folder. Then go to the techconnectlabsession folder in Downloads.
[!Note] The solution may be auto-loaded when you open the VS Code.
-
Install these extensions in VS Code - Python, Jupyter, Azure App Service. If already installed, ignore this step.

-
Select Terminal, and then select New Terminal. Create a virtual environment by running this command in the terminal -
python -m venv venv ```
-
Activate the virtual environment by running this command in the terminal -
.\venv\Scripts\activate ```
-
Install dependencies by running this command in the terminal. This step will take around 3-4 minutes :
pip install -r requirements.txt ```
-
Edit the .env.example, add the following two lines in the .env.example file and save it:
FABRIC_WORKSPACE_ID='' FABRIC_LAKEHOUSE_NAME='' -
Run this command in the VS Code Terminal:
copy .env.example .env -
Open the .env file from VS Code
-
Fill in all the values in .env file by following the steps below.
Go to the Azure portal -
https://portal.azure.com
Browse to Resource Groups, then select the 256RG resource group.
and deploy base model - text-embedding-ada-002 under deployment section
- Go to the Azure AI Search service named search{LabInstanceId}
- Copy the following details in .env file:
- Endpoint URL or URL (under the Overview section)
- Primary Admin Key (under Settings→Keys)
- Go to the Azure Document Intelligence (Form Recognizer) service named docint{LabInstanceId}
- Browse to Resource Management on the left side of the portal and expand the options.
- From the Keys and Endpoint, copy the following details into the .env file:
- Endpoint URL
- Key 1
- Go to the Azure Storage Account with the name sta{LabInstanceId}
- Copy the following details under the Access Keys of Security + networking section into the .env file:
- Connection String
- Key 1
- Go Azure Application Insights with the name appinsight{LabInstanceId}
- Copy the following detail from the Overview section into the .env file:
- Connection String
- Access Microsoft Fabric workspace from
https://app.fabric.microsoft.com - Go to the data agent NovaMart-DataAgent that you created.
- Select the Settings Icon.
- Go to the Publishing section and copy Data Agent url into .env file as you copied the Data Agent URL in part C of step 10 above.
- Go to the Azure Portal
https://portal.azure.com - Search
Microsoft Entra IDin the search bar and select it - Copy Tenant ID from the Overview page
-
Run the following index script in the terminal. This will create the index named orders-index with fields in the Search Service. Please validate the fields after executing the script:
document_id(string, key)customer_id(string, filterable)order_id(string, searchable)document_type(string, filterable)document_url(string)content(string, searchable)created_date(datetime)
python create_search_index.py -
Go back to VS Code, then open the terminal again and run the following command to ingest the proof-of-delivery file:
python ingest_documents.py --folder . --type proof_of_delivery --prefix POD -
Go back to the order_copilot_workflow.ipynb notebook and run all the cells individually. You may get a pop up to install ipykernel package. Select yes if that is the case.
[!Note] Interactive authentication is enabled for the Fabric data agent. A sign-in pop-up will appear-please enter your Azure user ID and complete the authentication.**
# Make sure virtual environment is activated
.\venv\Scripts\activate# Run Streamlit app
streamlit run app.pyThe application will open in your browser at http://localhost:8501
- Sample questions to run in the application:
- Show all the delivered orders
- Show the status of all shipped orders
- Can you check the status of this order - O000086051
- Show the proof of delivery for almonds order
- Create deployment files:
- create a new file under techconnectlabsession folder with the name startup.sh:
python -m streamlit run app.py --server.port 8000 --server.address 0.0.0.0
- create a new file under techconnectlabsession folder with the name .deployment and add below: [config] SCM_DO_BUILD_DURING_DEPLOYMENT=true
- Deploy from VS Code
- Browse to the Azure icon on VS Code and sign in using the credentials provided in the instructions.
- After signing in, the subscription name will be visible. Expand and select Azure App Service.
- Right-click on App Service and select "Deploy to Web App..."
- Follow the promptsand select the folder to deploy: techconnectlabsession
- Deployment will be initiated and can be tracked in Azure terminal.
- Set environment variables in the Azure portal. Go to: App Service>Settings> Environment Variables. Add all variables from your .env file.
- Go to App service in Azure portal with name appservice-{LabInstanceId} and select the default domain in the Overview section. Your Copilot website should now be running.
- Analyze all the logs under the Traces table in Application Insights.
===
[!Alert] IMPORTANT: These labs are hosted on the Skillable platform. Completion data is collected and then exported to Success Factors every Monday. SF require another 1-3 days to process that data. The status for this lab will be visible in Viva and Learning Path next week.
Be sure to select "Submit" in the bottom right corner to get credit for completing this lab.
@lab.ActivityGroup(completionsurvey)
[!Alert] After answering the survey questions, select submit to complete and end the lab. This is required in order to receive credit for lab completion.


