Skip to content

Commit 6687c89

Browse files
authored
Merge pull request #27 from nitya/bami/nov10-tested
Nov 10 Cleanup / BAMI tested (Labs 1, 2, 4, 5) with updated notebook intros for consistency
2 parents 115072b + 2fa427a commit 6687c89

36 files changed

+4420
-6227
lines changed

labs/0-setup/00-validate-setup.ipynb

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,32 @@
55
"id": "543643eb",
66
"metadata": {},
77
"source": [
8-
"# Environment Setup Validation\n",
8+
"# 🛍️ | Cora-For-Zava: Validate Setup\n",
99
"\n",
10-
"This notebook validates that all required environment variables are properly configured for the lab exercises."
10+
"Welcome! This notebook validates that your Azure environment is properly configured before you start building **Cora**, our AI-powered shopping assistant for Zava Hardware Store.\n",
11+
"\n",
12+
"## 🛒 Our Zava Scenario\n",
13+
"\n",
14+
"**Cora** is a customer service chatbot for **Zava** - a fictitious retailer of home improvement goods for DIY enthusiasts. Before we can build Cora, we need to ensure all Azure resources, API keys, and configurations are properly set up.\n",
15+
"\n",
16+
"## 🎯 What This Notebook Does\n",
17+
"\n",
18+
"This validation notebook will check:\n",
19+
"- ✅ Azure subscription and resource group configuration\n",
20+
"- ✅ Azure OpenAI service endpoint and API keys\n",
21+
"- ✅ Azure AI Search service configuration\n",
22+
"- ✅ Azure AI Foundry project settings\n",
23+
"- ✅ Application Insights connection (for monitoring)\n",
24+
"\n",
25+
"## 💡 What You'll Learn\n",
26+
"\n",
27+
"- How to verify environment variables are properly configured\n",
28+
"- Which Azure services are required for the lab exercises\n",
29+
"- How to troubleshoot common setup issues\n",
30+
"\n",
31+
"Ready to validate your setup? Let's begin! 🚀\n",
32+
"\n",
33+
"---"
1134
]
1235
},
1336
{

labs/0-setup/README.self-guided.md

Lines changed: 131 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
🚨🚨🚨 TRACING ENV NEEDS MANUAL UPDATE - TODO: FIX IT 🚨🚨
44

5-
Use this guide if you are exploring this workshop on your own, at home. To do this you will need:
5+
6+
Use this guide if you are working on these labs on your own at home!
7+
8+
9+
## 1. Pre-Requisites
10+
11+
You will need:
612

713
- A personal GitHub account - [signup here for free](https://github.com/signup)
814
- An active Azure account - [signup here for free](https://aka.ms/free)
@@ -12,178 +18,154 @@ Use this guide if you are exploring this workshop on your own, at home. To do th
1218

1319
<br/>
1420

15-
## 1. Fork This Repo
21+
## 2. Setup Dev Environment
1622

17-
1. If you already have a fork of the repo, just pull the latest changes to get ready.
18-
1. If you don't have a fork already, [use this link](https://github.com/microsoft/ignite25-PREL13-observe-manage-and-scale-agentic-ai-apps-with-azure-ai-foundry/fork) to create one in your GitHub proile.
19-
1. Open a new browser tab and navigate to that fork in the browser.
23+
First, let's get you set up with a development environment for the lab. The repository is setup with a `devcontainer.json` that provides a pre-build development environment with all tools and dependencies installed. Let's activate that in three steps!
2024

21-
## 2. Launch GitHub Codespaces
25+
### 2.1. Fork This Repo
2226

23-
1. Click the blue "Code" button in that GitHub page to see options
24-
1. Select the "Codespaces" tab and click "+" to launch a new codespace
25-
1. This opens a new tab with a VS Code IDE - wait till that loads completely
27+
1. Create a fork of this repo in your personal profile [using this link](https://github.com/microsoft/ignite25-PREL13-observe-manage-and-scale-agentic-ai-apps-with-azure-ai-foundry/fork)
28+
1. Open a new browser tab - navigate to your new fork
2629

27-
## 3. Authenticate With Azure
30+
### 2.2. Launch GitHub Codespaces
2831

29-
1. Open a new terminal session in that VS Code window - wait till ready.
30-
1. Run this command - and complete the workflow with **your** Azure subscription
32+
1. Click the blue "Code" button - select the "Codespaces" tab
33+
1. Click "+" to launch a new codespace - it opens a new tab
34+
1. You will see a VS Code IDE - wait till that loads completely
35+
36+
### 2.3. Authenticate With Azure
37+
38+
1. Open a terminal in that VS Code session - wait till prompt is active
39+
1. Run this command - follow steps to complete auth with **your** subscription
3140

3241
```bash title="" linenums="0"
3342
az login
3443
```
35-
1. _We can now use this for managed identity credentials in code later_.
44+
1. When flow is complete, return to VS Code - accept default subscription
45+
46+
_Your development environment is ready - and connected to Azure!_
3647

3748
<br/>
3849

39-
## 4. Provision AI Agents Template
50+
## 3. Provision Your AI Agents Resources
4051

41-
1. The [Azure Developer CLI](https://aka.ms/azd) streamlines provsioning and deployment for AI Apps.
42-
1. The [AI Apps Gallery](https://aka.ms/ai-apps) has a number of curated AI application templates for AZD.
43-
1. In this repo, we have scripts to setup of the [Get Started With AI Agents](https://github.com/Azure-Samples/get-started-with-ai-agents) template
52+
1. We'll jumpstart our development using the [Get Started With AI Agents](https://github.com/Azure-Samples/get-started-with-ai-agents) template
53+
1. This provides a solution architecutre with sample code & infrastructure files
54+
1. We created a _custom_ version of this template that you can install with scripts.
4455
45-
**Let's Run the scripts in order**: _we recommend the defaults below_.
56+
_Let's get this done_
4657

47-
1. Change working directory: `cd scripts/`
48-
1. Run the setup script: `./1-setup.sh`
49-
1. Enter branch name: `msignite25-lab516`
50-
1. Enter environment name: `ignite-PREL13`
51-
1. Enter Azure region: `swedencentral`
52-
1. Enter Subscription ID: _your subscription id here_
53-
1. Do you want to activate Azure AI Search? (yes/no) [no]: yes
54-
1. Use these defaults? (yes/no) [yes]: yes
55-
1. Proceed with deployment? (yes/no): yes
58+
1. Open a new VS Code Terminal. Complete these steps:
5659

57-
<details>
58-
<summary> ➡️ ➡️ CLICK TO EXPAND FOR DETAILS </summary>
60+
```bash
61+
cd scripts
62+
./1-setup.sh
63+
```
64+
1. Then complete the interactive steps providing responses like this:
65+
66+
1. Enter branch name: `for-release-1.0.4`
67+
1. Enter environment name: `Ignite-PREL13`
68+
1. Enter Azure region: `swedencentral`
69+
1. Enter Subscription ID: _your subscription id here_
70+
1. Do you want to activate Azure AI Search? (yes/no) [no]: yes
71+
1. Use these defaults? (yes/no) [yes]: yes
72+
1. Proceed with deployment? (yes/no): yes
73+
74+
1. When complete you should see:
5975

60-
**By completing this step you will see:**
76+
1. A `scripts/ForBeginners/` folder cloned from a template repo
77+
1. A `scripts/ForBeginners/.azd-setup` with infrastructure files
78+
1. A `scripts/ForBeginners/.azd-setup/.azure` with infra env config
6179

62-
1. A local folder created: `scripts/ForBeginners` - cloned from our custom repo
63-
1. An azd template inside: `scripts/ForBeginners/.azd-setup` - with infra-as-code
64-
1. Our azd environment: `scripts/ForBeginners/.azd-setup/ignite-PREL13` with:
65-
- a `config.json` - with environment configuration
66-
- a `.env` - with environment variables from our infra deployment
67-
1. The deployment process will also begin - watch the console for updates.
68-
1. Make sure you have the required model quotas and access permissions.
69-
1. The process will take 10-15 minutes to complete.
80+
<br/>
81+
82+
**TROUBLESHOOTING:**
7083

84+
1. You may see issues related to "bicep" not being available. To fix, do the following:
85+
```bash
86+
cd ForBeginners/.azd-setup
87+
azd up
7188
```
72-
SUCCESS: Your up workflow to provision and deploy to Azure completed in 14 minutes 5 seconds.
73-
✓ Infrastructure deployed successfully
74-
75-
======================================
76-
Setup Complete!
77-
======================================
78-
✓ Repository cloned
79-
✓ Environment configured
80-
✓ Infrastructure deployed
81-
✓ Azure AI Search enabled (Index: zava-products)
82-
======================================
89+
90+
This completes azd deployment directly and ends with something like this:
91+
92+
```bash
93+
SUCCESS: Your up workflow to provision and deploy to Azure completed in 12 minutes 39 seconds.
8394
```
8495

85-
1. Populate the `.env` file from the provisioned environment variables
96+
1. You may get a deployment error part way through
8697

98+
```bash
99+
Deployment Error Details:
100+
RequestConflict: Cannot modify resource with id '/.../providers/Microsoft.CognitiveServices/accounts/aoai-t7sla5j64lcvo' because the resource entity provisioning state is not terminal
87101
```
88-
./6-get-env.sh
102+
103+
This is typically caused by a timing issue where a previous resource task has not completed. The best way to resolve this is to back off and try again. So just wait a few minutes, then retry this - and it should complete.
104+
105+
```bash
106+
azd up
89107
```
90108

91-
The script will automatically:
92-
- ✅ Extract the correct Azure AI Project name from your deployment
93-
- ✅ Retrieve Azure OpenAI API key programmatically
94-
- ✅ Retrieve Azure AI Search API key programmatically
95-
- ✅ Use the correct OpenAI endpoint format (`.openai.azure.com`)
96-
- ✅ Configure Application Insights connection string
109+
<br/>
110+
111+
## 4. Set up `.env` variables.
97112

98-
You should see output like:
113+
1. Make sure you are authenticated with Azure CLI. We will use this to retrieve and create a `.env` file based on the `scripts/.env.sample` format
99114

115+
```bash
116+
az login
100117
```
101-
✅ Successfully updated .env file!
102-
103-
📋 Updated Variables:
104-
• Resource Group: rg-ignite-PREL13
105-
• Location: swedencentral
106-
• OpenAI Endpoint: https://aoai-XXXXXXX.openai.azure.com/
107-
• OpenAI API Key: ✓ Retrieved
108-
• AI Search Endpoint: https://srch-XXXXX.search.windows.net/
109-
• AI Search API Key: ✓ Retrieved
110-
• AI Project Name: proj-XXXXX
111-
• Container Registry: XXXX.azurecr.io
112-
• Service API URI: https://ca-api-XXX...
113-
• Application Insights: ✓ Connected
114-
115-
💡 All API keys have been automatically retrieved from Azure!
116-
117-
💡 All API keys have been automatically retrieved from Azure!
118-
119-
======================================
120-
✓ Done!
121-
======================================
118+
119+
1. Run this script from root of repo - it will create `.env` with values extracted by Azure CLI. _By default it looks for an `rg-Ignite-XXX` resource group but you can override it.
120+
122121
```
122+
./scripts/1-update-env-selfguided.sh
123+
``````
124+
125+
<br/>
123126

127+
## 5. Populate Search Data
124128

125-
1. Now populate products and update the search index
129+
1. We have Zava data in `scripts/customization`. Let's create a product index in Azure AI Search. Switch to the `scripts/` folder and run the command:
126130
127131
```
132+
cd scripts/
128133
python 2-add-product-index.py
129134
```
130135
131-
You should see something like this:
136+
1. This will first run an RBAC update script to give this user the right roles and access to make updates.
137+
1. Then it should upload 49 products to a `zava-products` index with semantic search, in Azure AI Search.
132138
133-
```
134-
======================================================================
135-
Add Products to Azure AI Search Index
136-
======================================================================
137-
Using environment variables from system/default locations
138-
✓ Azure CLI authentication verified
139-
Running RBAC update script to ensure proper permissions...
140-
..
141-
..
142-
Uploading 49 products to index 'zava-products'...
143-
✓ Successfully uploaded 49 products to the search index!
144-
145-
The product catalog is now ready for semantic search.
146-
======================================================================
147-
```
139+
<br/>
148140
149-
1. Now, lets add the models you need to explore customizaton.
141+
## 6. Add Model Choices
150142
151-
```
152-
./2-add-models.sh
153-
```
143+
The default AI Agents template will deploy one chat model. The AI Search index creation will require a second text-embedding model.
154144
155-
You should see something like this:
145+
In addition, we want to be able to show _model selection_ with evaluators and graders - so we want to have a suitable set of model choices available. This script makes that happen.
156146
157-
```
158-
========================================
159-
Add Additional Model Deployments
160-
========================================
147+
1. Update the `scripts/customization/add-models.json` with the list of models you want to choose from, for deployments
161148
162-
ℹ️ Checking prerequisites...
163-
✓ Prerequisites check passed
164-
ℹ️ Using standalone Bicep template: customization/add-models.bicep
149+
1. Run this script and provide the selection you actually want deployed:
165150
166-
========================================
167-
Currently Deployed Models
168-
========================================
151+
```bash
152+
cd scripts/
153+
./2-add-model-choices.sh
154+
```
169155
170-
✓ gpt-4.1
171-
✓ text-embedding-3-large
156+
1. On success you should see:
172157
158+
```bash
173159
========================================
174-
Available Models to Deploy
160+
Add Additional Model Deployments
161+
(Using .env file)
175162
========================================
176-
...
177-
...
178163
179-
Select models to deploy (enter numbers separated by spaces, e.g., '1 3 5'):
180-
Or type 'all' to deploy all available models, or 'cancel' to exit:
181-
> all
164+
ℹ️ Checking prerequisites...
182165
...
183166
...
184167
185-
✓ Additional models deployed successfully!
186-
✓ Environment variable updated with deployment configuration
168+
✓ Added ADDITIONAL_MODEL_DEPLOYMENTS to .env file
187169
188170
========================================
189171
Deployment Summary
@@ -199,19 +181,39 @@ Use this guide if you are exploring this workshop on your own, at home. To do th
199181
200182
✓ Model deployment completed successfully!
201183
```
202-
</details>
184+
185+
1. It will also update the `.env` file with the relevant variable and list:
186+
187+
```bash
188+
ADDITIONAL_MODEL_DEPLOYMENTS=[{"name":"model-router","model":{"format":"OpenAI","name":"model-router","version":"2025-05-19"},"sku":{"name":"GlobalStandard","capacity":20}},{"name":"gpt-4o","model":{"format":"OpenAI","name":"gpt-4o","version":"2024-11-20"},"sku":{"name":"GlobalStandard","capacity":20}},{"name":"gpt-4o-mini","model":{"format":"OpenAI","name":"gpt-4o-mini","version":"2024-07-18"},"sku":{"name":"GlobalStandard","capacity":20}},{"name":"gpt-4.1-mini","model":{"format":"OpenAI","name":"gpt-4.1-mini","version":"2025-04-14"},"sku":{"name":"GlobalStandard","capacity":20}},{"name":"gpt-4.1-nano","model":{"format":"OpenAI","name":"gpt-4.1-nano","version":"2025-04-14"},"sku":{"name":"GlobalStandard","capacity":20}},{"name":"o3-mini","model":{"format":"OpenAI","name":"o3-mini","version":"2025-01-31"},"sku":{"name":"GlobalStandard","capacity":20}},{"name":"o4-mini","model":{"format":"OpenAI","name":"o4-mini","version":"2025-04-16"},"sku":{"name":"GlobalStandard","capacity":20}}]
189+
```
203190
204191
<br/>
205192
206-
## 4b. Optional: Using Pre-Existing Infra
193+
## 7. Validate your `.env` variables
194+
195+
1. It's easy - there's a notebook for that!
196+
1. Open `labs/0-setup/00-validate-setup.ipynb` in your Visual Studio Code editor.
197+
1. Select Kernel - pick the default Python environment
198+
1. "Run All" - to have validation checks run.
199+
200+
```bash
201+
============================================================
202+
📊 VALIDATION SUMMARY
203+
============================================================
204+
✅ Valid variables: 47
205+
❌ Missing variables: 0
206+
207+
🎉 All environment variables are properly configured!
208+
You're ready to proceed with the lab exercises.
209+
```
210+
211+
212+
## 8. (Optional) Refresh Env From Existing Infra
207213

208-
This section is relevant ONLY if you had already completed the deployment previously, and are now launching a new GitHub Codespaces to work with your pre-existing deployment. The goal is to refresh environment variables from existing infrastructure.
214+
What if you had provisioned infrastructure earlier - but had deleted your Codespaces? Can you _restore_ environment variables from an existing infrastructure?
209215

210-
1. In this case, respond with `no` to the "Proceed ith deployment?" question.
211-
1. Then switch to location containing template: `cd ForBeginners/.azd-setup`
212-
1. Login with azd: `azd auth login` - complete workflow with Azure subscription
213-
1. Then run the `azd env refresh` command - wait till it completes
214-
1. Your `scripts/ForBeginners/.azd-setup/ignite-PREL13/.env` will get updated!
216+
Yes. Note that the `scripts/1-update-env-selfguided.sh` script only needs your subscription and a resource group, and it can retrieve and update your `.env`.
215217

216218
<br/>
217219

0 commit comments

Comments
 (0)