|
1 | 1 | # 1.1 Provision Infra |
2 | 2 |
|
| 3 | +!!! quote "BY THE END OF THIS LAB YOU SHOULD HAVE" |
| 4 | + |
| 5 | + - [X] Set your tab preference (Instructor-Led or Self-Guided) |
| 6 | + - [X] Launched GitHub Codespaces (and setup local environment) |
| 7 | + - [X] Provisioned Infrastructure (to get an Azure AI Foundry project) |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Before You Begin |
| 12 | + |
| 13 | +These instructions are setup to support both instructor-led training (in-venue, with pre-provisioned subscription) and self-guided learning (at home, with your subscription). The primary difference will be in the initial setup. |
| 14 | + |
| 15 | +**Pick the tab that best represents you right now** ⬇️ |
| 16 | + |
| 17 | +=== "Instructor-Led (In Venue)" |
| 18 | + |
| 19 | + !!! info "I am currently in the Microsoft Ignite 2025 Pre-Day Workshop (4h Session)" |
| 20 | + |
| 21 | +=== "Self-Guided (At Home)" |
| 22 | + |
| 23 | + !!! note "I am working through the lab at home, with my subscription (Self-Paced)" |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +<!--- |
3 | 28 | We will provision the AZD "Get Started with AI Agents" template as our infrastructure. These notes correspond to [this commit](https://github.com/nitya/get-started-with-ai-agents/commit/c63e1384ae6a295b3d57378fab02ac4227bf835d) on the AZD template repo. My goal is to document the usage and customization of this template to support various projects - as pre-provisioned infrastructure. |
| 29 | +--> |
| 30 | + |
| 31 | +## Provision Infrastructure |
| 32 | + |
| 33 | +By the end of this step, you should have an Azure subscription setup with the required resources for this project - which includes an Azure AI Foundry project, AI model deployments, an Azure AI Search service resource - and a default agent with a frontend app. |
| 34 | + |
| 35 | +=== "Instructor-Led (In Venue)" |
| 36 | + |
| 37 | + !!! success "You should have a pre-provisioned Azure subscription - check the [Azure Portal](https://portal.azure.com)" |
4 | 38 |
|
5 | | -<br/> |
| 39 | +=== "Self-Guided (At Home)" |
6 | 40 |
|
7 | | -## 0. Fork Template & Launch Codespaces |
| 41 | + ??? task "STEP 1: You need to provision the infrastructure - get the template!" |
8 | 42 |
|
9 | | -1. Visit the [Get Started With AI Agents](https://github.com/Azure-Samples/get-started-with-ai-agents) repo |
10 | | -1. Fork it to your profile to get a custom copy (.e., [my fork-branch](https://github.com/nitya/get-started-with-ai-agents/tree/sep2025-pdy123-infra)) |
11 | | -1. Launch GitHub Codespaces on your fork |
12 | | -1. Wait till the browser VS Code loads - and an active terminal appears. |
| 43 | + 1. Visit the [Get Started With AI Agents](https://github.com/Azure-Samples/get-started-with-ai-agents) repo |
| 44 | + 1. Fork it to your profile to get a custom copy (.e., [my fork-branch](https://github.com/nitya/get-started-with-ai-agents/tree/sep2025-pdy123-infra)) |
| 45 | + 1. Launch GitHub Codespaces on your fork |
| 46 | + 1. Wait till the browser VS Code loads - and an active terminal appears. |
13 | 47 |
|
14 | | -_You are ready to deploy the template_ |
| 48 | + _You are ready to deploy the template_ |
15 | 49 |
|
| 50 | + ??? task "STEP 2: You need customize template - setup env variables!" |
16 | 51 |
|
17 | | -## 1. Set AZD Env Variables |
| 52 | + The azd template can be customized in many ways - the easiest starting point is to use environment variables to customize the resource deployment paramters. Run these commands in the Codespaces terminal. _Note: Pick unique names for the last 2 variables that set the Foundry project and resource names in Azure AI Foundry Portal_ |
18 | 53 |
|
19 | | -The azd template can be customized in many ways - the easiest starting point is to use environment variables to customize the resource deployment paramters. Run these commands in the Codespaces terminal. _Note: Pick unique names for the last 2 variables that set the Foundry project and resource names in Azure AI Foundry Portal_ |
| 54 | + ```bash |
| 55 | + azd env set AZURE_AI_AGENT_DEPLOYMENT_CAPACITY 100 |
| 56 | + azd env set ENABLE_AZURE_MONITOR_TRACING true |
| 57 | + azd env set AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED true |
| 58 | + azd env set USE_AZURE_AI_SEARCH_SERVICE true |
| 59 | + azd env set USE_APPLICATION_INSIGHTS true |
| 60 | + azd env set AZURE_AIPROJECT_NAME nitya-pdy123-aiproj-v1 |
| 61 | + azd env set AZURE_AISERVICES_NAME nitya-pdy123-aisvcs-v1 |
| 62 | + ``` |
| 63 | + ??? task "STEP 3: You are ready to deploy it - have your Azure subscription ready!" |
20 | 64 |
|
21 | | -```bash |
22 | | -azd env set AZURE_AI_AGENT_DEPLOYMENT_CAPACITY 100 |
23 | | -azd env set ENABLE_AZURE_MONITOR_TRACING true |
24 | | -azd env set AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED true |
25 | | -azd env set USE_AZURE_AI_SEARCH_SERVICE true |
26 | | -azd env set USE_APPLICATION_INSIGHTS true |
27 | | -azd env set AZURE_AIPROJECT_NAME nitya-pdy123-aiproj-v1 |
28 | | -azd env set AZURE_AISERVICES_NAME nitya-pdy123-aisvcs-v1 |
29 | | -``` |
| 65 | + You should already have the Azure Developer CLI (`azd`) tool installed in the GitHub Codespaces environment. Provisioning and deployment is now just a single command: |
30 | 66 |
|
31 | | -## 2. Deploy it |
| 67 | + ```title="" linenums="0" |
| 68 | + azd up |
| 69 | + ``` |
32 | 70 |
|
33 | | -```bash |
34 | | -azd up |
35 | | -``` |
| 71 | + Note that we did not have to authenticate beforehand! This command will prompt you to do so, using a device-code workflow that looks something like this: |
36 | 72 |
|
37 | | -Note that we did not do any pre-authentication step. So we'll get prompted to login using a device-code workflow like this: |
| 73 | + ```title="" linenums="0" |
| 74 | + ? Would you like to log in now? Yes |
38 | 75 |
|
39 | | -```bash |
40 | | -? Would you like to log in now? Yes |
| 76 | + Start by copying the next code: XXXXXXX |
| 77 | + Then press enter and continue to log in from your browser... |
| 78 | + ``` |
41 | 79 |
|
42 | | -Start by copying the next code: XXXXXXX |
43 | | -Then press enter and continue to log in from your browser... |
44 | | -``` |
| 80 | + Next you'll be prompted to select your subscription and the region for deployment. I used `East US2`. |
| 81 | + |
| 82 | + ??? task "STEP 4: Wait for the provisioning to complete - it can take 10-15 mins!" |
45 | 83 |
|
46 | | -Next you'll be prompted to select your subscription and the region for deployment. I used `East US2`. Then just let the provisioning complete. **This can take 10-15 minutes given our added requirements** - the default (basic) template provisions in 4-6 minutes. _The output looks like this - the first section provisions resources, the second deploys the app_. |
| 84 | + You can track the deployments status in the Azure Portal (at the link you will see in your console logs). Wait for the **SUCCESS** message to ensure provisioning is done. |
47 | 85 |
|
48 | | -```bash |
49 | | -You can view detailed progress in the Azure Portal: |
50 | | -<url here> |
| 86 | + ```title="" linenums="0" |
| 87 | + You can view detailed progress in the Azure Portal: |
| 88 | + <url here> |
51 | 89 |
|
52 | | -(✓) Done: Resource group: rg-nitya-pdy123-azd-v1 (447ms) |
53 | | -(✓) Done: Log Analytics workspace: log-vchqcvq7rwoju (22.557s) |
54 | | -(✓) Done: Storage account: stvchqcvq7rwoju (20.675s) |
55 | | -(✓) Done: Application Insights: appi-vchqcvq7rwoju (3.537s) |
56 | | -(✓) Done: Azure AI Services: nitya-pdy123-aisvcs-v1 (1m8.574s) |
57 | | -(✓) Done: Azure AI Services Model Deployment: nitya-pdy123-aisvcs-v1/text-embedding-3-small (1m10.589s) |
58 | | -(✓) Done: Azure AI Services Model Deployment: nitya-pdy123-aisvcs-v1/gpt-4o-mini (1m10.027s) |
59 | | -(✓) Done: Search service: srch-vchqcvq7rwoju (4m50.479s) |
60 | | -(✓) Done: Container Registry: crvchqcvq7rwoju (19.98s) |
61 | | -(✓) Done: Container Apps Environment: containerapps-env-vchqcvq7rwoju (1m24.269s) |
62 | | -(✓) Done: Container App: ca-api-vchqcvq7rwoju (17.742s) |
| 90 | + (✓) Done: Resource group: rg-nitya-pdy123-azd-v1 (447ms) |
| 91 | + (✓) Done: Log Analytics workspace: log-vchqcvq7rwoju (22.557s) |
| 92 | + (✓) Done: Storage account: stvchqcvq7rwoju (20.675s) |
| 93 | + (✓) Done: Application Insights: appi-vchqcvq7rwoju (3.537s) |
| 94 | + (✓) Done: Azure AI Services: nitya-pdy123-aisvcs-v1 (1m8.574s) |
| 95 | + (✓) Done: Azure AI Services Model Deployment: nitya-pdy123-aisvcs-v1/text-embedding-3-small (1m10.589s) |
| 96 | + (✓) Done: Azure AI Services Model Deployment: nitya-pdy123-aisvcs-v1/gpt-4o-mini (1m10.027s) |
| 97 | + (✓) Done: Search service: srch-vchqcvq7rwoju (4m50.479s) |
| 98 | + (✓) Done: Container Registry: crvchqcvq7rwoju (19.98s) |
| 99 | + (✓) Done: Container Apps Environment: containerapps-env-vchqcvq7rwoju (1m24.269s) |
| 100 | + (✓) Done: Container App: ca-api-vchqcvq7rwoju (17.742s) |
63 | 101 |
|
64 | | -Deploying services (azd deploy) |
| 102 | + Deploying services (azd deploy) |
65 | 103 |
|
66 | | -Deploying service api_and_frontend (Running remote build) |
67 | | -- Endpoint: https://......eastus2.azurecontainerapps.io/ |
68 | | -────────────── Docker Output ───────────────────────── |
| 104 | + Deploying service api_and_frontend (Running remote build) |
| 105 | + - Endpoint: https://......eastus2.azurecontainerapps.io/ |
| 106 | + ────────────── Docker Output ───────────────────────── |
69 | 107 |
|
70 | | -────────────────────────────────────────────────────── |
| 108 | + ────────────────────────────────────────────────────── |
71 | 109 |
|
72 | | -💡 (Optional) To setup username and password for the web application, run './scripts/setup_credential.sh'. |
| 110 | + 💡 (Optional) To setup username and password for the web application, run './scripts/setup_credential.sh'. |
73 | 111 |
|
74 | | -SUCCESS: Your up workflow to provision and deploy to Azure completed in 11 minutes 50 seconds. |
75 | | -``` |
| 112 | + SUCCESS: Your up workflow to provision and deploy to Azure completed in 11 minutes 50 seconds. |
| 113 | + ``` |
| 114 | + !!! success "You should have a pre-provisioned Azure subscription - check the [Azure Portal](https://portal.azure.com)" |
0 commit comments