Skip to content

Commit a894fff

Browse files
Merge pull request #614 from microsoft/dev-v3
fix: merge from dev to main
2 parents 6e99dad + 14eed6a commit a894fff

8 files changed

Lines changed: 159 additions & 16 deletions

File tree

.github/workflows/deploy-waf.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
jobs:
1111
deploy:
1212
runs-on: ubuntu-latest
13+
env:
14+
GPT_MIN_CAPACITY: 1
15+
O4_MINI_MIN_CAPACITY: 1
16+
GPT41_MINI_MIN_CAPACITY: 1
1317
steps:
1418
- name: Checkout Code
1519
uses: actions/checkout@v3
@@ -21,7 +25,9 @@ jobs:
2125
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
2226
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
2327
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
24-
export GPT_MIN_CAPACITY="150"
28+
export GPT_MIN_CAPACITY="1"
29+
export O4_MINI_MIN_CAPACITY="1"
30+
export GPT41_MINI_MIN_CAPACITY="1"
2531
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
2632
2733
chmod +x infra/scripts/checkquota.sh
@@ -116,7 +122,9 @@ jobs:
116122
solutionName=${{ env.SOLUTION_PREFIX }} \
117123
location="${{ env.AZURE_LOCATION }}" \
118124
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
119-
gptModelCapacity=5 \
125+
gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} \
126+
gpt4_1ModelCapacity=${{ env.GPT41_MINI_MIN_CAPACITY }} \
127+
gptReasoningModelCapacity=${{ env.O4_MINI_MIN_CAPACITY }} \
120128
enableTelemetry=true \
121129
enableMonitoring=true \
122130
enablePrivateNetworking=true \

.github/workflows/deploy.yml

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ on:
1313
- cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT
1414
workflow_dispatch: #Allow manual triggering
1515
env:
16-
GPT_MIN_CAPACITY: 1
16+
GPT_MIN_CAPACITY: 150
17+
O4_MINI_MIN_CAPACITY: 50
18+
GPT41_MINI_MIN_CAPACITY: 50
1719
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
1820

1921
jobs:
@@ -36,7 +38,9 @@ jobs:
3638
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
3739
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
3840
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
39-
export GPT_MIN_CAPACITY="1"
41+
export GPT_MIN_CAPACITY="150"
42+
export O4_MINI_MIN_CAPACITY="50"
43+
export GPT41_MINI_MIN_CAPACITY="50"
4044
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
4145
4246
chmod +x infra/scripts/checkquota.sh
@@ -122,7 +126,7 @@ jobs:
122126
elif [[ "${{ env.BRANCH_NAME }}" == "hotfix" ]]; then
123127
IMAGE_TAG="hotfix"
124128
else
125-
IMAGE_TAG="latest"
129+
IMAGE_TAG="latest_v3"
126130
fi
127131
128132
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
@@ -135,12 +139,12 @@ jobs:
135139
solutionName=${{ env.SOLUTION_PREFIX }} \
136140
location="${{ env.AZURE_LOCATION }}" \
137141
gptModelDeploymentType="GlobalStandard" \
138-
gptModelName="gpt-4o" \
139-
gptModelVersion="2024-08-06" \
142+
gptModelName="gpt-4.1-mini" \
143+
gptModelVersion="2025-04-14" \
140144
backendContainerImageTag="${IMAGE_TAG}" \
141145
frontendContainerImageTag="${IMAGE_TAG}" \
142146
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
143-
gptModelCapacity=1 \
147+
gptModelCapacity=50 \
144148
createdBy="Pipeline" \
145149
tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}" \
146150
--output json
@@ -159,9 +163,10 @@ jobs:
159163
- name: Get Container App Backend URL
160164
id: get_backend_url
161165
run: |
166+
# Get specifically the backend container app (not the MCP container app)
162167
CONTAINER_APP_NAME=$(az containerapp list \
163168
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
164-
--query "[0].name" -o tsv)
169+
--query "[?starts_with(name, 'ca-') && !contains(name, 'mcp')].name" -o tsv)
165170
166171
MACAE_URL_API=$(az containerapp show \
167172
--name "$CONTAINER_APP_NAME" \
@@ -171,6 +176,38 @@ jobs:
171176
echo "MACAE_URL_API=https://${MACAE_URL_API}" >> $GITHUB_OUTPUT
172177
echo "CONTAINER_APP=${CONTAINER_APP_NAME}" >> $GITHUB_OUTPUT
173178
179+
- name: Run Post deployment scripts
180+
run: |
181+
set -e
182+
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
183+
184+
echo "Running post-deployment script..."
185+
186+
# Extract required resource names from the deployment
187+
STORAGE_ACCOUNT=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --resource-type "Microsoft.Storage/storageAccounts" --query "[0].name" -o tsv)
188+
AI_SEARCH=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --resource-type "Microsoft.Search/searchServices" --query "[0].name" -o tsv)
189+
190+
echo "Found Storage Account: $STORAGE_ACCOUNT"
191+
echo "Found AI Search Service: $AI_SEARCH"
192+
echo "Backend URL: ${{ steps.get_backend_url.outputs.MACAE_URL_API }}"
193+
194+
# Run upload team config script with parameters
195+
bash infra/scripts/upload_team_config.sh \
196+
"${{ steps.get_backend_url.outputs.MACAE_URL_API }}" \
197+
"data/agent_teams" \
198+
"${{ secrets.AZURE_SUBSCRIPTION_ID }}"
199+
200+
# Run process sample data script with parameters
201+
bash infra/scripts/process_sample_data.sh \
202+
"$STORAGE_ACCOUNT" \
203+
"sample-dataset" \
204+
"$AI_SEARCH" \
205+
"sample-dataset-index" \
206+
"${{ env.RESOURCE_GROUP_NAME }}" \
207+
"${{ secrets.AZURE_SUBSCRIPTION_ID }}"
208+
209+
echo "=== Post-Deployment Script Completed Successfully ==="
210+
174211
- name: Set Deployment Status
175212
id: deployment_status
176213
if: always()
@@ -181,9 +218,20 @@ jobs:
181218
echo "SUCCESS=false" >> $GITHUB_OUTPUT
182219
fi
183220
221+
e2e-test:
222+
needs: deploy
223+
if: needs.deploy.outputs.DEPLOYMENT_SUCCESS == 'true'
224+
uses: ./.github/workflows/test-automation.yml
225+
with:
226+
MACAE_WEB_URL: ${{ needs.deploy.outputs.WEBAPP_URL }}
227+
MACAE_URL_API: ${{ needs.deploy.outputs.MACAE_URL_API }}
228+
MACAE_RG: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
229+
MACAE_CONTAINER_APP: ${{ needs.deploy.outputs.CONTAINER_APP }}
230+
secrets: inherit
231+
184232
cleanup-deployment:
185233
if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != ''
186-
needs: [deploy]
234+
needs: [deploy, e2e-test]
187235
runs-on: ubuntu-latest
188236
env:
189237
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
@@ -317,7 +365,7 @@ jobs:
317365
echo "Resource purging completed successfully"
318366
319367
- name: Send Notification on Failure
320-
if: failure()
368+
321369
run: |
322370
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
323371

.github/workflows/test-automation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
MACAE_URL_API: ${{ inputs.MACAE_URL_API }}
3232
MACAE_RG: ${{ inputs.MACAE_RG }}
3333
MACAE_CONTAINER_APP: ${{ inputs.MACAE_CONTAINER_APP }}
34-
accelerator_name: "MACAE"
34+
accelerator_name: "MACAE v3"
3535

3636
steps:
3737
- name: Checkout repository

docs/DeploymentGuide.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
286286

287287
10. If you are done trying out the application, you can delete the resources by running `azd down`.
288288

289-
290289
### 🛠️ Troubleshooting
291290
If you encounter any issues during the deployment process, please refer [troubleshooting](../docs/TroubleShootingSteps.md) document for detailed steps and solutions.
292291

@@ -497,3 +496,7 @@ To debug the python server in the frontend directory (frontend_server.py) and re
497496
"jinja": true
498497
}
499498
```
499+
## Next Steps
500+
Now that you've completed your deployment, you can start using the solution.
501+
502+
To help you get started, here are some [Sample Questions](./SampleQuestions.md) you can follow to try it out.

docs/SampleQuestions.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
# Sample Workflow
3+
4+
To help you get started, here are some **Sample Prompts** you can ask in the app:
5+
6+
## **Teams**
7+
Select the Team option from the top-left section, then click Continue after choosing the desired team.
8+
9+
By default, three teams are available after running the post-deployment scripts:
10+
- Retail
11+
- HR
12+
- Marketing
13+
14+
![Application](images/samplequestion_1.png)
15+
16+
### **Retail Scenario**
17+
If you select the Retail team, follow the prompts below.
18+
19+
>**Agents Used:** Customer, Order, Analysis Recommendation
20+
21+
The Retail scenario enables users to explore and access information related to the Retail team and its associated data. Key activities include:
22+
23+
_Sample operation:_
24+
- Task: From the Quick Tasks, select **"Satisfaction Plan"** and submit it.
25+
> _Note: Average response time is 15–20 seconds._ <br>
26+
> _Observe: An analysis of Emily Thompson’s satisfaction with Contoso has been generated. It provides a proposed plan consisting of four or more steps._
27+
28+
- Task: Click **"Approve Task Plan"** Button
29+
> _Note: Average response time is 01 minute 15 seconds._ <br>
30+
> _Observe: It goes into "Thinking Process", "Processing your plan" and "coordinating with AI Agents"._ <br>
31+
> _Review the output._
32+
33+
### **Product Marketing Scenario**
34+
If you select the Marketing team, follow the prompts below.
35+
36+
>**Agents Used:** Product, Marketing , Proxy
37+
38+
The Product Marketing Scenario allows users to explore and retrieve information related to Marketing and specific product. Key tasks include:
39+
40+
_Sample operation:_
41+
- Task: Switch to **"Product Marketing Team"** from the top left section and click **"Continue"** button.
42+
- Task: From the Quick Tasks, select **"Draft a press release"** and submit it.
43+
> _Note: Average response time is 15–20 seconds._ <br>
44+
> _Observe: It will trigger the "Generating Plan Action" and give the Proposed Plan with 4 or more Steps_
45+
- Task: Click on **"Approve Task Plan"** Button
46+
> _Note: Average response time is around 01 minute._ <br>
47+
> _Observe: It goes into "Thinking Process" and observe a spinner "Processing your plan and coordinating with AI Agents"._ <br>
48+
> _Review the output._
49+
50+
### **HR Onboarding Scenario**
51+
If you select the HR team, follow the prompts below.
52+
53+
>**Agents Used:** HR Helper, Technical support , Proxy
54+
55+
The HR Onboarding Scenario allows users to explore and retrieve information related to OnBoarding the Employee. Key tasks include:
56+
57+
_Sample operation:_
58+
59+
- Task: Switch to the **"Human Resources Team"** from the top left section and click **"Continue"**
60+
- Task: From the Quick Tasks, select **"Onboard New Employee"** and submit it.
61+
62+
> _Note: Average response time is 15–20 seconds._ <br>
63+
> _Observe: If it asks for additional clarification (Human in the loop) Please provide this information irrespective of what specific information is asked. This will prevent agent for asking for multiple clarifications_
64+
65+
```sh
66+
department: hr, role: manager, start date: 11/23/2025, orientation date: 11/25/2025, location: onsite, email: js@contoso.com, mentor: Jim Shorts, benefits package: standard, ID Card: yes, salary: 70000, Laptop : Dell 14 Plus
67+
```
68+
> _Observe: It will trigger "Generating Plan Action" and "Proposed Plan" with 4 or more Steps_
69+
</br>
70+
71+
- Task: Click on **"Approve Task Plan"** Button.
72+
> _Note: Average response time is around 01 minute 15 seconds._ <br>
73+
> _Observe: It goes into "Thinking Process", "Processing your plan" and "coordinating with AI Agents"_ <br>
74+
> _Review the output._
75+
76+
77+
This structured approach ensures that users receive automated, AI-coordinated task execution and intelligent responses from specialized agents.

docs/images/samplequestion_1.png

50.9 KB
Loading

infra/scripts/checkquota.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ IFS=', ' read -ra REGIONS <<< "$AZURE_REGIONS"
55

66
SUBSCRIPTION_ID="${AZURE_SUBSCRIPTION_ID}"
77
GPT_MIN_CAPACITY="${GPT_MIN_CAPACITY}"
8+
O4_MINI_MIN_CAPACITY="${O4_MINI_MIN_CAPACITY}"
9+
GPT41_MINI_MIN_CAPACITY="${GPT41_MINI_MIN_CAPACITY}"
810
AZURE_CLIENT_ID="${AZURE_CLIENT_ID}"
911
AZURE_TENANT_ID="${AZURE_TENANT_ID}"
1012
AZURE_CLIENT_SECRET="${AZURE_CLIENT_SECRET}"
@@ -17,8 +19,10 @@ if ! az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET
1719
fi
1820

1921
echo "🔄 Validating required environment variables..."
20-
if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" || -z "$REGIONS" ]]; then
22+
if [[ -z "$SUBSCRIPTION_ID" || -z "$REGIONS" ]]; then
2123
echo "❌ ERROR: Missing required environment variables."
24+
echo "Required: AZURE_SUBSCRIPTION_ID, AZURE_REGIONS"
25+
echo "Optional: O4_MINI_MIN_CAPACITY (default: 50), GPT41_MINI_MIN_CAPACITY (default: 50)"
2226
exit 1
2327
fi
2428

@@ -31,7 +35,9 @@ echo "✅ Azure subscription set successfully."
3135

3236
# Define models and their minimum required capacities
3337
declare -A MIN_CAPACITY=(
34-
["OpenAI.GlobalStandard.gpt-4o"]=$GPT_MIN_CAPACITY
38+
["OpenAI.GlobalStandard.o4-mini"]="${O4_MINI_MIN_CAPACITY}"
39+
["OpenAI.GlobalStandard.gpt4.1"]="${GPT_MIN_CAPACITY}"
40+
["OpenAI.GlobalStandard.gpt4.1-mini"]="${GPT41_MINI_MIN_CAPACITY}"
3541
)
3642

3743
VALID_REGION=""

infra/scripts/upload_team_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def check_team_exists(backend_url, team_id, user_principal_id):
3939

4040
backend_url = sys.argv[1]
4141
directory_path = sys.argv[2]
42-
user_principal_id = sys.argv[3] if len(sys.argv) > 3 else "00000000-0000-0000-0000-000000000000"
42+
user_principal_id = sys.argv[3] if len(sys.argv) > 3 and sys.argv[3].strip() != "" else "00000000-0000-0000-0000-000000000000"
4343

4444
# Convert to absolute path if provided as relative
4545
directory_path = os.path.abspath(directory_path)
@@ -80,6 +80,7 @@ def check_team_exists(backend_url, team_id, user_principal_id):
8080
headers = {
8181
'x-ms-client-principal-id': user_principal_id
8282
}
83+
8384
params = {
8485
'team_id': team_id
8586
}

0 commit comments

Comments
 (0)