You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: labs/0-setup/00-validate-setup.ipynb
+25-2Lines changed: 25 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,32 @@
5
5
"id": "543643eb",
6
6
"metadata": {},
7
7
"source": [
8
-
"# Environment Setup Validation\n",
8
+
"# 🛍️ | Cora-For-Zava: Validate Setup\n",
9
9
"\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",
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:
6
12
7
13
- A personal GitHub account - [signup here for free](https://github.com/signup)
8
14
- 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
12
18
13
19
<br/>
14
20
15
-
## 1. Fork This Repo
21
+
## 2. Setup Dev Environment
16
22
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!
20
24
21
-
## 2. Launch GitHub Codespaces
25
+
###2.1. Fork This Repo
22
26
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
26
29
27
-
##3. Authenticate With Azure
30
+
### 2.2. Launch GitHub Codespaces
28
31
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
31
40
32
41
```bash title="" linenums="0"
33
42
az login
34
43
```
35
-
1. _We can now use this formanaged identity credentialsin 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!_
36
47
37
48
<br/>
38
49
39
-
## 4. Provision AI Agents Template
50
+
## 3. Provision Your AI Agents Resources
40
51
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.
44
55
45
-
**Let's Run the scripts in order**: _we recommend the defaults below_.
56
+
_Let's get this done_
46
57
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:
56
59
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:
59
75
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
61
79
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
- 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:**
70
83
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
71
88
```
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.
83
94
```
84
95
85
-
1. Populate the `.env` file from the provisioned environment variables
96
+
1. You may get a deployment error part way through
86
97
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
87
101
```
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
89
107
```
90
108
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`)
• 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
+
122
121
```
122
+
./scripts/1-update-env-selfguided.sh
123
+
``````
124
+
125
+
<br/>
123
126
127
+
## 5. Populate Search Data
124
128
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:
126
130
127
131
```
132
+
cd scripts/
128
133
python 2-add-product-index.py
129
134
```
130
135
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.
1. Now, lets add the models you need to explore customizaton.
141
+
## 6. Add Model Choices
150
142
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.
154
144
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.
156
146
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
161
148
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:
165
150
166
-
========================================
167
-
Currently Deployed Models
168
-
========================================
151
+
```bash
152
+
cd scripts/
153
+
./2-add-model-choices.sh
154
+
```
169
155
170
-
✓ gpt-4.1
171
-
✓ text-embedding-3-large
156
+
1. On success you should see:
172
157
158
+
```bash
173
159
========================================
174
-
Available Models to Deploy
160
+
Add Additional Model Deployments
161
+
(Using .env file)
175
162
========================================
176
-
...
177
-
...
178
163
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...
182
165
...
183
166
...
184
167
185
-
✓ Additional models deployed successfully!
186
-
✓ Environment variable updated with deployment configuration
168
+
✓ Added ADDITIONAL_MODEL_DEPLOYMENTS to .env file
187
169
188
170
========================================
189
171
Deployment Summary
@@ -199,19 +181,39 @@ Use this guide if you are exploring this workshop on your own, at home. To do th
199
181
200
182
✓ Model deployment completed successfully!
201
183
```
202
-
</details>
184
+
185
+
1. It will also update the `.env` file with the relevant variable and list:
🎉 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
207
213
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?
209
215
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`.
0 commit comments