Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 2 column 19
---
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)

===

Survey

@lab.ActivityGroup(initialsurvey)

===

Welcome to Your Lab Environment

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.


Step 1: Access Microsoft Fabric Portal

  1. Open your web browser
  2. Browse to: https://app.fabric.microsoft.com
  3. Sign in with your lab credentials (provided separately under the Resources Tab)
  4. Wait for the Fabric home page to load

Step 2: Create Your Workspace

  1. In the left navigation pane, select Workspaces
  2. Select the + New workspace button
  3. Enter workspace name: NovaMart{your microsoft alias}
    • Example: If your alias is xyz, use NovaMartxyz
  4. Select Advanced to expand advanced options
  5. The assigned F8 capacity will be auto populated in the Details section. No action required here.
  6. Select Apply to create the workspace

Step 3: Create a Lakehouse

  1. Ensure you are in your newly created workspace (check the workspace name at the top)
  2. Select + New item in the toolbar
  3. Scroll down and select Lakehouse or Type Lakehouse in the search
  4. Enter lakehouse name: lh_NovaMart (Ensure the Location is displaying the newly created worksapce)
  5. Select Create

Step 4: Import the Setup Notebook

  1. Select your workspace name in the breadcrumb navigation to return to the workspace view
  2. Select Import> Notebook> From This Computer
  3. In the import dialog, select Upload
  4. Browse to: C:\LabFiles\00-Setup-Lakehouse-Data.ipynb
  5. Select the imported notebook and select Open
  6. Wait for the import to complete

Verification: The notebook 00-Setup-Lakehouse-Data appears in your workspace items.


Step 5: Attach Lakehouse to Setup Notebook

  1. Select the notebook 00-Setup-Lakehouse-Data to open it
  2. In the sidebar on the left side, locate and select Add Data items
  3. Select From OneLake catalog option
  4. From the list, choose lh_NovaMart
  5. Select Add.
  6. In the Explorer pane, choose ... on lh_Novamart and set as default lakehouse.

Verification: The lakehouse name lh_NovaMart now appears in the left sidebar under the Lakehouse section.


Step 6: Execute Setup Notebook to Generate Data

  1. At the top of the notebook, select the Run all button
  2. Wait for all cells to execute sequentially
  3. Monitor the progress indicator as cells complete
  4. When execution completes (within 1-2 minutes), scroll to the bottom and verify the output

Step 7: Verify Data in Lakehouse

  1. Return to your workspace (select the workspace name in the breadcrumb navigation)
  2. Select the lh_NovaMart lakehouse
  3. In the explorer pane on the left, expand Tables
  4. Right-click on the three dots (...) under tables and click refresh.
  5. Confirm you see the tables:
    • dim_customers
    • dim_products
    • dim_merchants
    • fact_customer_events
  6. Select any table name to preview the data

Verification: Each table contains data as shown in the preview pane.


Step 8: Create a Data Agent

  1. Browse back to your workspace
  2. Select + New item > Serch bar
  3. In the search bar, type Data Agent and select it
  4. Enter name: NovaMart-DataAgent
  5. Select Create
  6. Wait for the Data Agent to provision

Verification: The Data Agent interface opens with a chat window.


Step 9: Connect Lakehouse to Data Agent

  1. In the Data Agent view, select Add data> Data source
  2. Select Lakehouse from the available data source types
  3. Choose lh_NovaMart from the dropdown list
  4. Select all tables by checking the boxes:
    • dim_customers
    • dim_products
    • dim_merchants
    • fact_customer_events

Verification: The Data Agent settings show lh_NovaMart as a connected data source with all tables.


Step 10: Configure Data Source, Add Data Agent Instructions, Publish and Test

Part A: Configure Data Agent Instructions

  1. In Fabric, go to your Data Agent
  2. Select the Agent Instructions
  3. Open the file: C:\LabFiles\DataAgent-Instructions.txt using Notepad
  4. Select all content (Ctrl+A) and copy (Ctrl+C)
  5. Return to the Data Agent settings
  6. Paste the ENTIRE content into the Agent Instructions text box (Ctrl+V)

Part B: Configure Data Source

  1. Within the Data Agent
  2. Choose the three dots (...) inlh_NovaMart lakehouse
  3. Select the Data Source Instructions
  4. Open the file: C:\LabFiles\DataSourceInstructions.txt using Notepad
  5. Copy PART 1 (text between the "---START COPYING HERE---" and "---STOP COPYING HERE---" markers)
  6. Paste into the Description field

Add Data Source Instructions

  1. Scroll down to find the "Instructions" field (large text area with markdown support)
  2. In the same DataSourceInstructions.txt file, scroll to PART 2
  3. Copy PART 2 (text between the "---START COPYING HERE---" and "---STOP COPYING HERE---" markers)
  4. Paste into the Instructions field

Add Example Queries

  1. Choose the three dots (...) inlh_NovaMart lakehouse
  2. Select the Example Queries
  3. Choose Import from JSON
  4. Open the file: C:\LabFiles\Example-Queries.json
  5. 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

Part C: Publish Data Agent and Get URL

  1. In the Data Agent interface, select the Publish button (top right)
  2. In the publish dialog, review the settings:
    • Name: NovaMart-DataAgent
    • Description: AI-powered analytics agent for NovaMart data
  3. Select Publish
  4. Wait for the success message
  5. Once Published, select the Settings icon in the Data Agent interface
  6. Browse to the Publishing section or Deployment tab
  7. Locate the Published URL field
  8. Select the Copy icon or select and copy the URL (Ctrl+C)
  9. IMPORTANT: Save this URL somewhere safe - you will need it later

Verification: You have copied the Data Agent URL.

PART D: Test Your Data Agent

  1. In the Data Agent chat interface, type the following question:
    Which product category had the most paid orders over the past 12 months?
    
  2. Press Enter or select the Send button
  3. Wait for the agent to process and respond

Verify the Response: Check to see if the Data Agent returns a response**


Step 11: Environment Setup

  1. 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.

  2. Install these extensions in VS Code - Python, Jupyter, Azure App Service. If already installed, ignore this step. 9a8hlfmp.jpg

  3. Select Terminal, and then select New Terminal. Create a virtual environment by running this command in the terminal -

python -m venv venv ```

  1. Activate the virtual environment by running this command in the terminal -

.\venv\Scripts\activate ```

  1. Install dependencies by running this command in the terminal. This step will take around 3-4 minutes :

pip install -r requirements.txt ```


Step 12: Environment Configuration

  1. Edit the .env.example, add the following two lines in the .env.example file and save it:

     FABRIC_WORKSPACE_ID=''
    
     FABRIC_LAKEHOUSE_NAME=''
    
  2. Run this command in the VS Code Terminal:

     copy .env.example .env
    
  3. Open the .env file from VS Code

  4. Fill in all the values in .env file by following the steps below.


Step 13: Azure Service Configurations

Go to the Azure portal - https://portal.azure.com

Browse to Resource Groups, then select the 256RG resource group.

Azure OpenAI

  1. Go to Azure OpenAI service with named openai{LabInstanceId}.

  2. Launch the Foundry portal.

    3matpttd.jpg

and deploy base model - text-embedding-ada-002 under deployment section

nxdcgygs.jpg

  1. Copy the below details from the Home or Overview section in .env file:

    • OpenAI Endpoint
    • API Key

    a38z92vu.jpg

Azure AI Search

  1. Go to the Azure AI Search service named search{LabInstanceId}
  2. Copy the following details in .env file:
    • Endpoint URL or URL (under the Overview section)
    • Primary Admin Key (under Settings→Keys)

Azure Document Intelligence

  1. Go to the Azure Document Intelligence (Form Recognizer) service named docint{LabInstanceId}
  2. Browse to Resource Management on the left side of the portal and expand the options.
  3. From the Keys and Endpoint, copy the following details into the .env file:
    • Endpoint URL
    • Key 1

Azure Storage Account

  1. Go to the Azure Storage Account with the name sta{LabInstanceId}
  2. Copy the following details under the Access Keys of Security + networking section into the .env file:
    • Connection String
    • Key 1

Azure Application Insights

  1. Go Azure Application Insights with the name appinsight{LabInstanceId}
  2. Copy the following detail from the Overview section into the .env file:
    • Connection String

Microsoft Fabric

  1. Access Microsoft Fabric workspace from https://app.fabric.microsoft.com
  2. Go to the data agent NovaMart-DataAgent that you created.
  3. Select the Settings Icon.
  4. 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.

Tenant ID

  1. Go to the Azure Portal https://portal.azure.com
  2. Search Microsoft Entra ID in the search bar and select it
  3. Copy Tenant ID from the Overview page

Step 14: Set Up the Source Data and Run the Notebook

  1. 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
    
  2. 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
    
  3. 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.**


Step 15: Run the Application

# Make sure virtual environment is activated
.\venv\Scripts\activate
# Run Streamlit app
streamlit run app.py

The application will open in your browser at http://localhost:8501

  1. Sample questions to run in the application:
    1. Show all the delivered orders
    2. Show the status of all shipped orders
    3. Can you check the status of this order - O000086051
    4. Show the proof of delivery for almonds order

Step 16: Deploy the Application to Azure (OPTIONAL)

  1. 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
  1. 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.
  1. Set environment variables in the Azure portal. Go to: App Service>Settings> Environment Variables. Add all variables from your .env file.
  2. 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.
  3. 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.

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors