Contoso encountered a major issue with customer churn, especially among millennials. The executives at Contoso struggled to understand this customer segment and figure out how to earn their loyalty. Despite having extensive data from customer interactions, surveys, and market research, Contoso found it difficult to pinpoint the root cause of the churn and determine effective solutions.
The main problem was the lack of integration in their existing systems. This prevented Contoso's executives from utilizing their data for root cause analysis and strategic insights, which in turn, hampered their ability to improve marketing strategies, product offerings, and customer experiences.
To solve the data silos issue, Contoso implemented an advanced AI solution using Azure OpenAI, Azure AI Search, and Microsoft Fabric. Once the team discovered that millennials were leaving because they couldn't find products, they developed an Azure OpenAI-powered shopping assistant to help with product search and recommendations.
In this exercise, we will learn how they achieved this!
Task 3.1: Integrate Fabric data with Azure AI Studio using Azure AI Search and Vector Indexing for Hybrid Search
Let’s step into the shoes of Eva, the Data Engineer, as she launches Azure AI Studio and leverages data stored in Microsoft OneLake as knowledge base.
-
Navigate back to the Microsoft Fabric tab on your browser.
-
Click on Workspaces and select .
- Click on Filter and select Lakehouse.
- Click on the lakehouse.
Note: There are 3 options for lakehouse, namely Lakehouse, Semantic model (Default) and SQL endpoint. Make sure you select the Lakehouse option.
- Click on the three dots next to Files folder and select New subfolder.
- Enter name of folder as input and click on Create button.
- Click on the three dots next to the newly created folder input and select Upload, then Upload files.
- In the Upload files window, click on the browse icon.
- Copy the following path C:\LabFiles\01_Pre_Day\artifacts\aistudio\input, paste it into the File Name field, and press Enter on the keyboard.
- Drag and select all the files in the folder and click on Open button.
- Click on Upload button.
- Wait for the files to get uploaded and click on close button.
- Click on the three dots next to the Files folder, then select Properties. Next, click the Copy to clipboard button next to the URL path. Save the URL in your notepad, and if the URL was copied from the input folder, remove /input from the end of the URL. This will be used in the further step.
- Copy paste the below URL in the new browser tab to open Azure AI Studio Project and click on the prj-ignite...
Note: Click on the Expand icon, if the left navigation is hidden.
- To connect with data stored in Onelake, scroll down in the left navigation pane and click on Data.
Note: Due to the screen resolution you might see a difference in the screenshot and actual lab interface, Scroll up to proceed with the next steps.
- Under the connect, create, or manage your data , click on + New Data button
- Click on the + New Connection.
- In the Service dropdown select Microsoft OneLake.
- In the OneLake Artifact URL field, paste the URL that you copied in the notepad earlier (step13).
- In the Authentication method dropdown select Microsoft Entra ID based
- In the Connection name field enter fabric_onelake. Finally click on the Create connection button.
Note: Ensure that you have removed /input from the URL to avoid connection failure.
- In the Data source dropdown select fabric_onelake, click on the input radio button and click on the Next button.
- In the Data name field enter input01 and click on Create button.
- Once the connection is created, the files can be viewed under the input folder.
Task 3.2 : Establish Azure OpenAI, Azure AI Content Safety, and AI Search Connections in Azure AI Studio.
Contoso integrated all of their data sources using Microsoft Fabric, including customer feedback, sales records, social media interactions, and encompassing internal company policy documents such as SOPs and research articles on customer behavior into Azure AI Search. This created a unified, searchable knowledge base.. Let’s step into Data Engineer, Eva’s shoes to see how.
- Navigate back to the Hub.. by clicking on it. To expand the sidebar, click on the Expand icon.
Note: If any item on the screen is not visible as shown in the screenshot, adjust your browser screen resolution as per the need.
- In Azure AI hub, scroll down the left navigation bar to the Shared resources section and click on Connections and scroll up.
- Click on the + New Connection button.
Note: If the left side bar is collapsed, please click on expand from the above of the left side bar and scroll below.
- Select Azure OpenAI Service.
- You will find two Azure OpenAI resources, gpt-4 (1) and gpt-4o (2). Create a connection with both by clicking on the Add connection button.
- Once the OpenAI services are connected, click on Back to select an asset type.
- Select Azure AI Search.
- Click on Add connection.
- Once the AI Search is connected, click on the Close button.
Note: If the close button is not visible, please reduce the screen size of the browser.
- Notice that Azure Open AI and Azure AI Search connections are established successfully.
- Click on All projects in the left navigation pane and select the pre-created Project displayed on your screen.
Task 3.3 : Create and configure a Vector Index in Azure AI Studio with Azure AI Search and OpenAI Connections.
Contoso indexed OneLake data in Azure AI Studio to improve the efficiency of searching and retrieving large datasets, enabling faster, data-driven decision-making across the organization. This approach enhances accessibility, scalability, and workflow for data scientists and analysts, while also providing a better user experience and reducing operational costs.. Let’s see how Eva, the Data Engineer, indexed OneLake data in Azure AI Studio.
- Scroll down in the left navigation pane, click on Indexes and then click on the + New index button.
- In the Data source dropdown, select Azure AI search.
- Click on the Next button.
- In the Select Azure AI Search service dropdown, select srch...
Note: If you get an error like "Unable to load search service indexes.Request failed with status code 403." please proceed by selecting Index.
- In the Select Azure AI Search index dropdown, select cosmosdb-index and then click on the Next button.
-
In the Azure OpenAI connection dropdown, select (Pre-Selected OpenAI is not GPT-4o, click on the drop down and select the OpenAI starting with name openAI2).
-
Click on the Next button.
- Click on the Next button.
- Click on the Create vector index button.
Note: Please wait for the index to load. It takes approximately 1-2 minutes.
- A screen similar to the screenshot below with the text Index not found will appear. Wait until the screen loads and click on Indexes.
- Check the Status shown as Ready and continue with the next task.
Prompt flow in Azure AI Studio offers a comprehensive, streamlined environment for creating AI applications. It provides a visual interface for orchestrating flows, and enables iterative prompt engineering. Azure AI Studio includes built-in evaluation tools, seamless deployment options, and integration with Azure's ecosystem. It also offers enterprise-level security and scalability, making it ideal for developing, testing, and deploying sophisticated AI solutions efficiently. Let’s explore how Contoso deployed and tested a Prompt flow.
- Click on Prompt flow from the left navigation pane and then click on the + Create button.
- Scroll down and click on the Upload button in the Upload from local section.
- Click on the Zip file radio button and then click on Browse.
-
Copy paste the following path C:\LabFiles\01_Pre_Day\artifacts\aistudio in the File name field and hit Enter on the Keyboard.
-
Click on shopping-assistant-prompt-flow zip folder and then click on the Open button.
-
In the Select flow type dropdown, select Chat flow and then click on the Upload button.
Note: If clicking on the Upload button doesn't redirect you to the Prompt Flow screen, click the Upload button again twice or thrice. If it still doesn't work, refresh the page and try uploading again.
- Click on the Start compute session button.
Note: It will take approximately 2-3 minutes to start the compute session. Please wait for some time.
-
Scroll down to the lookup node in the Prompt flow graph and click on it.
-
Click on the Validate and prase input button in the flow.
-
Once it is validated, click on edit option for mlindex_content as shown in the below screenshot.
-
Click on the acs_index_connection dropdown and select the srch.....
-
Click on the acs_index_name dropdown and select the cosmosdb-index.
-
Click on the embedding_type dropdown and select the Azure OpenAI.
-
Click on the aoai_embedding_connection dropdown and select the .
-
Click on the Save button.
- Click on prompt_for_looks in the Graph and then click on the Validate and prase input button in the Flow under input sections.
Note: If the Validate and Parse Input button is not visible on the screen, scroll down to locate it.
- Once it is validated, click on the Connection dropdown and then select .
Note: Scroll up to the heading prompt_for_looks to find the Connection drop-down below it.
- Click on max_token, remove the preset token, and set it to 100.
- Click on the Chat button.
Note: Close any pop-up appears on the screen as seen in the below screenshot.
- Paste the below question in chat box replacing the default question.
Can you show me some yellow indian dresses for a wedding in Udaipur?
- Click on the send icon.
- Observe the response.
Once the Prompt flow is deployed as an endpoint, It can be consumed in the webapplication. Let's see how the response look like in the webapp.
- Open a new tab and Copy-paste the below URL in the broswer address bar, and then press Enter.
<inject key= "shoppingcopilotwebapp" enableCopy="false"/>
- Click on the terms and conditions checkbox and then click on the Login button.
- Click on the Copilot icon at the bottom right of the page.
- Click on any of the pre-populated questions.
- Observe the response.
With their new Shopping Copilot, Contoso was able to provide their customers with an online shopping experience that has an in-store feel. This simulates a personalized shopping experience that helps increase customers’ engagement with enhanced data insights.