Skip to content

Commit 67b967f

Browse files
committed
Cleanup for lab instructions
1 parent 53972cb commit 67b967f

File tree

1 file changed

+73
-52
lines changed

1 file changed

+73
-52
lines changed

docs/lab-instructions.md

Lines changed: 73 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
Log in to the Windows 11 lab VM with the credentials below.
88

9-
- **Username:** **+++@lab.VirtualMachine(Win11-Pro-Base).Username+++**
109
- **Password:** **+++@lab.VirtualMachine(Win11-Pro-Base).Password+++**
1110

1211
>[!Alert] After you sign in to the VM, you may see a window that asks you to protect your files and memories by backing up your PC. If you see this window, select **Opt-out of backup**. Then, on the **Backup is recommended** page, select **Skip for now**.
@@ -51,17 +50,14 @@ Your lab environment comes pre-configured with the necessary software:
5150
- Azure Developer CLI (AZD) for simplified deployment workflows
5251
- Docker for the Durable Task emulator and Azurite support
5352

54-
55-
> [+hint] Ignore any blue "Sign in required" notification stating...
56-
>> "Your device is having problems with your work or school account" or an "Activate Windows" watermark at the bottom right of the screen. Simply select "Not now" on any prompts and continue with the lab. These notifications will not affect your lab experience.
57-
> <br>
58-
> > !IMAGE[0-sign-in.png](instructions291323/0-sign-in.png)
59-
6053
From your lab environment's Desktop (or Taskbar), open **Edge - Snippy & Portal** shortcut, which opens three tabs you'll need:
6154
1. [] **Snippy Lab GitHub Repo:** Source code (*https://aka.ms/functions-mcp-lab*).
6255
2. [] **Azure Portal:** (*https://portal.azure.com*).
6356
3. [] **Azure AI Foundry:** (*https://ai.azure.com*).
6457

58+
> [!note]
59+
> When you open the Azure Portal and Azure Foundry tabs, you may see login pages. Don't worry about signing in yet - you'll receive the Azure credentials in **Step 4** when you begin the resource provisioning process. For now, you can leave these tabs open in the background.
60+
6561
===
6662

6763
## **2** - Clone the repository and launch VS Code
@@ -117,72 +113,64 @@ After signing into GitHub, go back to VS Code and complete the Copilot setup:
117113

118114
!IMAGE[SnippyLab-GH-Model](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-GH-Model.png)
119115

120-
121-
> [+hint] (Optional) MCP Server Access Restriction Workaround
122-
>
123-
> If your organization has disabled MCP server functionality via GitHub policy settings in the admin console, you may not be able to test the MCP tools in later exercises. This restriction affects how GitHub Copilot can connect to external MCP endpoints.
124-
>
125-
> **Workarounds:**
126-
> - Use a GitHub account that is not managed by your organization
127-
> - Use the MCP Inspector tool (instructions will be provided in the optional section later in the lab)
128-
>
129-
> This will only affect the MCP tool testing portions - all other parts of the lab will work normally regardless of policy settings.
130-
131116
===
132117

133118
## **4** - Start resource provisioning with azd (runs in background)
134119

135120
Now, you'll use the Azure Developer CLI (azd) to *start* provisioning all the necessary Azure resources for Snippy. This process takes several minutes (5-10) and will run in the background while you work on the coding exercises.
136121

137-
1. [] **Login to azd:**
138-
Open your terminal inside VS Code (*View → Terminal*) and log in to Azure (ensure you are in the *snippy* root directory):
122+
1. [] Open your terminal inside VS Code (*View → Terminal*) and log in to Azure (ensure you are in the *snippy* root directory):
139123

140124
!IMAGE[SnippyLab-VS-Terminal](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-VS-Terminal.png)
141125

142-
`azd auth login`
126+
2. [] **Login to azd:**
127+
128+
`azd auth login`
143129

144-
2. [] Use the following credentials to sign in:
130+
3. [] Select the same account used previously, if available.
131+
132+
If the account is not available, use the following credentials to sign in:
145133

146134
| Item | Value |
147135
|:----------------------|:---------------------------------------------|
148136
| Username | `@lab.CloudPortalCredential(User1).Username` |
149137
| Temporary Access Pass | `@lab.CloudPortalCredential(User1).TAP` |
150138

151-
Follow the prompts to authenticate in your browser. Close the browser tab after successful login and return to VS Code.
139+
Return to VS Code after login.
152140

153-
3. [] **Set up the azd Environment:**
141+
4. [] **Set up the azd Environment:**
154142

155143
An azd environment stores configuration details like subscription ID and location. Create a new environment for this lab (this will be unique to each lab environment):
156144

157-
`azd env new snippymcplab-@lab.labinstance.id --subscription @lab.cloudsubscription.id`
145+
`azd env new snippymcplab-@lab.labinstance.id --subscription @lab.cloudsubscription.id`
158146

159-
4. [] **Set the name suffix for Azure resources:**
147+
5. [] **Set the name suffix for Azure resources:**
160148

161149
The name suffix will be added at the end of the resources deployed to Azure.
162150

163-
`azd env set NAME_SUFFIX @lab.labInstance.id`
151+
`azd env set NAME_SUFFIX @lab.labInstance.id`
164152

165-
5. [] **Provision and Deploy Resources:**
153+
6. [] **Provision and Deploy Resources:**
166154

167155
Run the following command. This reads the infrastructure definition (*infra* folder, *main.bicep*) and begins creating the resources in Azure.
168156

169-
**Do not wait for it to complete.**
170-
171-
It will run in the background. Proceed immediately to the next step while it runs.
157+
`azd provision`
172158

173-
Run `azd provision` to provision all the Azure resources needed to run snippy.
174-
175-
If prompted, select a location from the terminal to deploy the Azure resources.
159+
If prompted, select a location from the terminal to deploy the Azure resources.
176160

161+
**Do not wait for it to complete.**
162+
163+
It will run in the background. Proceed immediately to the next step while it runs.
164+
177165
> [!knowledge] This command provisions Azure resources such as:
178166
> * Azure Function App (using the scalable Flex Consumption plan)
179167
> * Azure Storage Account (for Functions operations and state)
180168
> * Azure Cosmos DB for NoSQL (pre-configured for vector search)
181169
> * Azure AI Services (with *gpt-4o-mini* and *text-embedding-3-small* models deployed)
182-
> * Azure AI Foundry resources (Project, for AI Agents Service)
183-
> * Azure Key Vault (for secrets)
170+
> * Azure AI Foundry resources (Foundry projects)
184171
> * Azure Log Analytics & Application Insights (for monitoring)
185172
> * Durable Task Scheduler (for workflow orchestration)
173+
> * Managed Identity (for secure access to Azure resources)
186174
187175
> [!hint] These resources are created within a new resource group named **rg-snippymcplab-@lab.labinstance.id**. You will deploy your application code to the Function App later using *azd deploy*.
188176
@@ -267,7 +255,7 @@ Azure Functions provides a serverless platform for building AI-integrated micros
267255

268256
### 5.3 Review: Embeddings Input Binding
269257

270-
1. [] Look at the decorator chain above *http_save_snippet* (line 105) and *mcp_save_snippet* (line 174)
258+
1. [] Look at the decorator chain above *http_save_snippet* (line 104) and *mcp_save_snippet* (line 180)
271259

272260
2. [] **Examine the embeddings input binding:**
273261

@@ -513,7 +501,13 @@ Let's first install the Python packages required by the Function App:
513501

514502
!IMAGE[](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-LocalSettings.png)
515503

516-
5. [] (Optional) If for any reason the *local.settings.json* file wasn't properly generated or is missing values, you can manually run the generation script:
504+
5. [] **Only needed if settings are missing**
505+
506+
If for any reason the *local.settings.json* file wasn't properly generated or is missing values, you can manually run the generation script from the root directory:
507+
508+
```powershell
509+
cd $HOME\snippy\ # Or C:\Users\LabUser\snippy\
510+
```
517511

518512
```powershell
519513
# From the snippy root directory
@@ -536,17 +530,17 @@ The agent-framework-azurefunctions library requires the Durable Task emulator to
536530

537531
2. [] Start the Docker Compose services in detached mode:
538532

539-
`docker compose up -d`
533+
If prompted to allow network access, select **Allow** to continue.
540534

541-
This starts the Durable Task emulator container which the agents will use for state persistence.
535+
`docker compose up -d`
542536

543-
If prompted to allow network access, select **Allow** to continue.
537+
This starts the Durable Task emulator container which the agents will use for state persistence.
544538

545539
3. [] Verify the container is running:
546540

547541
`docker compose ps`
548542

549-
You should see the durable task emulator service running.
543+
You should see the durable task emulator service running as well as azurite.
550544

551545

552546
> [!note]
@@ -564,7 +558,14 @@ Now that *local.settings.json* points to your actual Azure resources provisioned
564558

565559
`az login --use-device-code`
566560

567-
>[!note] This command will output a URL and a device code. Copy the code, **Ctrl+Click** the URL to open it, then paste the code when prompted to complete authentication.
561+
> [!note]
562+
> This command will output a URL and a device code.
563+
>
564+
> Copy the code - highlight, then **Ctrl+C**
565+
>
566+
> Open the URL - mouseover, then **Ctrl+Click**
567+
>
568+
> Paste the code when prompted to complete authentication.
568569

569570
2. [] Go back to the VS Code terminal and enter `1` to pick the subscription.
570571

@@ -614,6 +615,7 @@ Now that *local.settings.json* points to your actual Azure resources provisioned
614615
>
615616
> <br>
616617

618+
===
617619

618620
### **10** - Explore MCP Tools in GitHub Copilot (Local Endpoint)
619621

@@ -644,11 +646,14 @@ Now, connect GitHub Copilot Chat to your *locally running* Function App's MCP en
644646

645647
!IMAGE[12a-mcp-ghcp-agent.png](instructions291323/12a-mcp-ghcp-agent.png)
646648

647-
- At the bottom of the chat panel, select **Select Tools...** (or select **Ctrl+Shift+/**)
648-
649-
!IMAGE[](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-MCP-Tools-Local.png)
649+
- At the bottom of the chat panel, select the **Tools** icon
650650

651+
!IMAGE[](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-GH-SelectTools.png)
652+
651653
- Make sure *MCP Server: local-snippy* and all its tools are checked
654+
655+
!IMAGE[](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-MCP-Tools-Local.png)
656+
652657
- Select **Escape** or select **OK** to confirm your selection
653658

654659
> [!knowledge] Troubleshooting MCP Server Connection Issues
@@ -681,13 +686,21 @@ Now, connect GitHub Copilot Chat to your *locally running* Function App's MCP en
681686
5. [] **Test the *save_snippet* Tool**:
682687
- [] Open any code file (e.g., **src/durable_agents.py**).
683688
- [] Select some interesting code sections (or it'll take the entire file as a snippet, which is fine, as well).
684-
- [] In Copilot Chat, enter `#local-snippy save this snippet as ai-agents-service-usage`, then select **Enter** or **Send**.
689+
- [] In Copilot Chat, enter
690+
691+
`#local-snippy save this snippet as ai-agents-service-usage`
692+
693+
select **Enter** or **Send**.
685694
- [] If prompted by Copilot to use the **save_snippet** tool, select **Allow**.
686695

687696
!IMAGE[](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-SaveSnippet-Local.png)
688697

689698
6. [] **Test the *get_snippet* Tool**:
690-
- [] In Copilot Chat, lets try explicity using the server and enter `#local-snippy get the snippet named ai-agents-service-usage`, then select **Enter** or **Send**.
699+
- [] In Copilot Chat, enter
700+
701+
`#local-snippy get the snippet named ai-agents-service-usage`
702+
703+
select **Enter** or **Send**.
691704
- [] Copilot will suggest using the **get_snippet** tool - Select **Allow**.
692705

693706
!IMAGE[](https://raw.githubusercontent.com/Azure-Samples/snippy/main/images/SnippyLab-GetSnippet-Local.png)
@@ -732,7 +745,10 @@ Now you'll test the `generate_comprehensive_documentation` tool, which orchestra
732745
- Select **Allow** when Copilot asks to use the **generate_comprehensive_documentation** tool
733746

734747
3. [] **Monitor the Orchestration**:
735-
- Switch to your browser at `http://localhost:8082/`
748+
- Switch to your browser at
749+
750+
`http://localhost:8082/`
751+
736752
- You should see a new orchestration instance appear in the dashboard
737753
- Watch as the orchestration progresses through multiple stages:
738754
- **DeepWiki Agent** generates initial documentation
@@ -756,7 +772,10 @@ Now you'll test the `generate_comprehensive_documentation` tool, which orchestra
756772
- All focused on MCP tools and vector search capabilities as requested
757773

758774
6. [] **Review the Completed Orchestration in the Dashboard**:
759-
- Return to the Durable Task Scheduler UI at `http://localhost:8082/`
775+
- Return to the Durable Task Scheduler UI at
776+
777+
`http://localhost:8082/`
778+
760779
- Find your completed orchestration instance in the list (it should show **Completed** status)
761780
- Click on the orchestration to view its detailed execution history:
762781
- **Timeline view**: See the sequence of all agent calls and their durations
@@ -786,7 +805,9 @@ Now you'll test the `generate_comprehensive_documentation` tool, which orchestra
786805

787806
You've implemented the code and verified it works locally against your provisioned cloud resources. Now, deploy the application code to the Azure Function App created by *azd provision*.
788807

789-
1. [] Go back to the Terminal and stop the local Functions host if it's still running (**Ctrl+C** in the *func start* terminal - wait a few seconds).
808+
1. [] Go back to the Terminal and stop the local Functions host (View- > Terminal)
809+
810+
If it's still running - **Ctrl+C** in the *func start* terminal - wait a few seconds.
790811

791812
2. [] Ensure your terminal is in the root *snippy* directory (the one containing *azure.yaml*).
792813

@@ -807,7 +828,7 @@ You've implemented the code and verified it works locally against your provision
807828
* Deploys the code to the Azure Function App provisioned earlier.
808829
* Configures the application settings in the deployed Function App based on your *.azure/snippy-mcp-lab-@lab.labinstance.id/.env* file, ensuring it can connect to OpenAI, Cosmos DB, etc., in the cloud.
809830

810-
4. [] Wait for the deployment to complete successfully. AZD will output the endpoints for your deployed application, including the Function App's base URL (e.g., *https://func-api-...azurewebsites.net*). Make a note of this URL.
831+
4. [] Wait for the deployment to complete successfully. AZD will output the endpoints for your deployed application, including the Function App's base URL (e.g., *https://func-api-...azurewebsites.net*).
811832

812833
---
813834

0 commit comments

Comments
 (0)