Skip to content

Commit 809b491

Browse files
authored
Add agent deployment
1 parent dd5fc4c commit 809b491

File tree

2 files changed

+68
-13
lines changed

2 files changed

+68
-13
lines changed

README.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,26 +197,55 @@ The AI agent definition would likely be deployed from your application's pipelin
197197

198198
You'll be using this to deploy the agent and web application, simulating your deployment pipeline running in a build agent.
199199
200-
1. Log in and select your target subscription.
200+
1. Open a new PowerShell terminal. Log in and select your target subscription.
201201
202-
```bash
202+
```powershell
203203
az login
204204
az account set --subscription xxxxx
205205
```
206206
207-
1. Set the base name to the same value it was when you deployed the resources.
207+
1. Set the base name and location to the same value it was when you deployed the resources.
208208
209-
```bash
209+
```powershell
210210
$BASE_NAME="<exact same value>"
211+
$LOCATION="eastus2"
212+
```
213+
214+
1. Generate some varibles to set context within your jump box.
215+
216+
Update as needed if you customized this deployment.
217+
218+
```powershell
219+
$RESOURCE_GROUP="rg-chat-baseline-${LOCATION}"
220+
$AI_FOUNDRY_NAME="aif${BASE_NAME}"
221+
$BING_CONNECTION_NAME="bingaiagent"
222+
$BING_CONNECTION_ID="$(az cognitiveservices account show -n $AI_FOUNDRY_NAME -g $RESOURCE_GROUP --query 'id' --out tsv)/projects/projchat/connections/${BING_CONNECTION_NAME}"
223+
$MODEL_CONNECTION_NAME="gpt-4o"
224+
$AI_FOUNDRY_PROJECT_NAME="projchat"
225+
$AI_FOUNDRY_AGENT_CREATE_URL="https://${AI_FOUNDRY_NAME}.services.ai.azure.com/api/projects/${AI_FOUNDRY_PROJECT_NAME}/assistants?api-version=2025-05-15-preview"
226+
227+
echo $BING_CONNECTION_ID
228+
echo $MODEL_CONNECTION_NAME
229+
echo $AI_FOUNDRY_AGENT_CREATE_URL
211230
```
212231
213232
1. Deploy the agent.
214233
215-
TODO
234+
Agents can be created via the Azure AI Foundry portal, the SDK, or the API. Ideally agents should be a source controlled and versioned asset. You then deploy agents in a coordinated way with the rest of your workload's code.
235+
236+
This simulates deploying an AI agent through your pipeline from a network-connected build agent.
237+
238+
```powershell
239+
Invoke-WebRequest -Uri "https://github.com/Azure-Samples/openai-end-to-end-baseline/raw/refs/heads/main/agents/chat-with-bing.json" -OutFile "chat-with-bing.json"
240+
${c:chat-with-bing-output.json} = ${c:chat-with-bing.json} -replace 'MODEL_CONNECTION_NAME', $MODEL_CONNECTION_NAME -replace 'BING_CONNECTION_ID', $BING_CONNECTION_ID
241+
az rest -u $AI_FOUNDRY_AGENT_CREATE_URL -m "post" --resource "https://ai.azure.com" -b @chat-with-bing-output.json
242+
```
216243

217-
### 3. Test the agent from the Azure AI Foundry portal in the playground
244+
### 3. Test the agent from the Azure AI Foundry portal in the playground. *Optional.*
218245

219-
Here you'll test your orchestration agent by invoking it directly from the Azure AI Foundry portal's playground experience. This also helps you validate that your AI Foundry portal access is established correctly from your jump box.
246+
Here you'll test your orchestration agent by invoking it directly from the Azure AI Foundry portal's playground experience. The Azure AI Foundry portal is only accessible from your private network, so you'll do this from your jump box.
247+
248+
*This step testing step is completely optional.*
220249
221250
1. Open the Azure portal to your subscription.
222251
@@ -228,11 +257,11 @@ Here you'll test your orchestration agent by invoking it directly from the Azure
228257

229258
1. Click **Agents**.
230259

231-
1. Select the agent named 'TBD'.
260+
1. Select the agent named 'Baseline Chatbot Agent'.
232261

233-
1. TODO
262+
1. Click **Try in playground**.
234263

235-
1. Enter a question that would require grounding data through recent internet content, such as a notable current event or the weather today.
264+
1. Enter a question that would require grounding data through recent internet content, such as a notable current event or the weather today in your location.
236265

237266
1. A grounded response to your question should appear on the UI.
238267

@@ -248,7 +277,7 @@ In a production environment, you use a CI/CD pipeline to:
248277

249278
For this deployment guide, you'll continue using your jump box to simulate part of that process.
250279
251-
1. Using the same Powershell terminal session from previous steps, download the web UI.
280+
1. Using the same PowerShell terminal session from previous steps, download the web UI.
252281
253282
```powershell
254283
Invoke-WebRequest -Uri https://github.com/Azure-Samples/openai-end-to-end-baseline/raw/refs/heads/main/website/chatui.zip -OutFile chatui.zip
@@ -266,8 +295,6 @@ For this deployment guide, you'll continue using your jump box to simulate part
266295

267296
1. Restart the web app to launch the site.
268297

269-
*This can be done from your workstation or the jump box if you first set the $RESOURCE_GROUP variable.*
270-
271298
```powershell
272299
az webapp restart --name "app-${BASE_NAME}" --resource-group "${RESOURCE_GROUP}"
273300
```

agents/chat-with-bing.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "Baseline Chatbot Agent",
3+
"description": "Example Azure AI Agent agent that uses the Bing Search tool to answer questions. Used in the Microsoft Learn AI chat reference architecture. https://learn.microsoft.com/azure/architecture/ai-ml/architecture/baseline-openai-e2e-chat",
4+
"model": "MODEL_CONNECTION_NAME",
5+
"instructions": "You are a helpful Chatbot agent. You'll consult the Bing Search tool to answer questions. Always search the web for information.",
6+
"tools": [
7+
{
8+
"type": "bing_grounding",
9+
"bing_grounding": {
10+
"search_configurations": [
11+
{
12+
"connection_id": "BING_CONNECTION_ID",
13+
"count": 5,
14+
"freshness": "Week"
15+
}
16+
]
17+
}
18+
}
19+
],
20+
"tool_resources": {},
21+
"temperature": 1,
22+
"top_p": 1,
23+
"metadata": {
24+
"createdBy": "Microsoft Learn Baseline Architecture",
25+
"version": "1.0.0"
26+
},
27+
"response_format": "auto"
28+
}

0 commit comments

Comments
 (0)