# Step 1: Get Your Azure OpenAI Details From Microsoft Foundry In this exercise, you collect the Azure OpenAI connection details from Microsoft Foundry so the agent can call the deployed chat model. This matters because every later step depends on the same endpoint, API key, and deployment name being available in the existing **.env** file. > [!Hint] 🌐 **In the browser — Microsoft Foundry** — you start in the browser to collect values, and switch to VS Code only when a step says to open **.env**. ## Log in to Microsoft Foundry 1. Open the Edge browser. 2. Navigate to **https://ai.azure.com** in the browser's address bar, if it's not already open. 3. Click **Sign in** in the top-right corner. ![Sign-In Button](./assets/sign-in-foundry.png) 4. Sign in with the details below: **Username**: +++@lab.CloudPortalCredential(User1).Username+++ **Password (TAP)**: +++@lab.CloudPortalCredential(User1).AccessToken+++ 5. In the top bar, make sure the **New Foundry** switch is toggled **On**. 6. From the project dropdown, select the only project available and click **Let's go**. 7. When the **Welcome to the new Microsoft Foundry** box appears, click **X** in the top-right corner. After you close the welcome box, you should see the Microsoft Foundry home page with **API key**, **Project endpoint**, and **Azure OpenAI endpoint** boxes near the top of the page. ![](./assets/foundry-landing.png) 1. Copy the value from the **Azure OpenAI endpoint** box. If the copied endpoint ends with **/openai/v1**, remove that part before adding it to **.env**. For example, change **https://foundry-12345.openai.azure.com/openai/v1** to **https://foundry-12345.openai.azure.com**. 2. Copy the value from the **API key** box. 3. Open the existing **.env** file in VS Code. 4. Add or update the endpoint and API key in **.env**. > [!Hint] 🖥️ **In VS Code** — steps 3 and 4 happen in the **.env** file. After saving, switch back to the browser for the next steps. 5. In the top navigation, select **Build**. 6. Open **Deployments**. 7. Confirm that **gpt-5.5** and **gpt-4.1-mini** are listed and each one has a **Succeeded** status. 8. Confirm that **AZURE_OPENAI_DEPLOYMENT_NAME** in **.env** matches **gpt-5.5**. 9. Confirm that **CITY_GUIDE_AZURE_OPENAI_DEPLOYMENT_NAME** in **.env** matches **gpt-4.1-mini**. Your **.env** file should include these values: ```env AZURE_OPENAI_ENDPOINT=https://.openai.azure.com AZURE_OPENAI_API_KEY= AZURE_OPENAI_DEPLOYMENT_NAME=gpt-5.5 CITY_GUIDE_AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4.1-mini ``` ## What You Learned You found the Azure OpenAI endpoint, API key, and deployment name in Microsoft Foundry and added them to the agent configuration.