Skip to content

Commit 71604db

Browse files
Merge pull request #626 from microsoft/main
chore: merging from main branch
2 parents acd968c + fd7ed1d commit 71604db

21 files changed

+1275
-33
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in the repo.
5-
* @toherman-msft @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @malrose07 @aniaroramsft
5+
* @toherman-msft @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @malrose07 @aniaroramsft @nchandhi
66

.github/workflows/deploy-v2.yml

Lines changed: 853 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/test-automation.yml

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ on:
1111
EMAILNOTIFICATION_LOGICAPP_URL_TA:
1212
required: false
1313
description: "Logic App URL for email notifications"
14+
outputs:
15+
TEST_SUCCESS:
16+
description: "Whether tests passed"
17+
value: ${{ jobs.test.outputs.TEST_SUCCESS }}
18+
TEST_REPORT_URL:
19+
description: "URL to test report artifact"
20+
value: ${{ jobs.test.outputs.TEST_REPORT_URL }}
1421

1522
env:
1623
url: ${{ inputs.DOCGEN_URL }}
@@ -19,6 +26,9 @@ env:
1926
jobs:
2027
test:
2128
runs-on: ubuntu-latest
29+
outputs:
30+
TEST_SUCCESS: ${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }}
31+
TEST_REPORT_URL: ${{ steps.upload_report.outputs.artifact-url }}
2232
steps:
2333
- name: Checkout repository
2434
uses: actions/checkout@v5
@@ -85,32 +95,49 @@ jobs:
8595
name: test-report
8696
path: tests/e2e-test/report/*
8797

88-
- name: Send Notification
98+
99+
100+
- name: Generate E2E Test Summary
89101
if: always()
90102
run: |
91-
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
92-
REPORT_URL=${{ steps.upload_report.outputs.artifact-url }}
93-
IS_SUCCESS=${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }}
94-
# Construct the email body
95-
if [ "$IS_SUCCESS" = "true" ]; then
96-
EMAIL_BODY=$(cat <<EOF
97-
{
98-
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has completed successfully.</p><p><strong>Run URL:</strong> <a href=\"${RUN_URL}\">${RUN_URL}</a><br></p><p><strong>Test Report:</strong> <a href=\"${REPORT_URL}\">${REPORT_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
99-
"subject": "${{ env.accelerator_name }} Test Automation - Success"
100-
}
101-
EOF
102-
)
103+
echo "## 🧪 E2E Test Job Summary" >> $GITHUB_STEP_SUMMARY
104+
echo "" >> $GITHUB_STEP_SUMMARY
105+
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
106+
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
107+
108+
# Determine overall test result
109+
OVERALL_SUCCESS="${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }}"
110+
if [[ "$OVERALL_SUCCESS" == "true" ]]; then
111+
echo "| **Job Status** | ✅ Success |" >> $GITHUB_STEP_SUMMARY
103112
else
104-
EMAIL_BODY=$(cat <<EOF
105-
{
106-
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Run URL:</strong> <a href=\"${RUN_URL}\">${RUN_URL}</a><br> ${OUTPUT}</p><p><strong>Test Report:</strong> <a href=\"${REPORT_URL}\">${REPORT_URL}</a></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>",
107-
"subject": "${{ env.accelerator_name }} Test Automation - Failure"
108-
}
109-
EOF
110-
)
113+
echo "| **Job Status** | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
111114
fi
112-
113-
# Send the notification
114-
curl -X POST "${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}" \
115-
-H "Content-Type: application/json" \
116-
-d "$EMAIL_BODY" || echo "Failed to send notification"
115+
116+
echo "| **Target URL** | [${{ env.url }}](${{ env.url }}) |" >> $GITHUB_STEP_SUMMARY
117+
echo "| **Test Report** | [Download Artifact](${{ steps.upload_report.outputs.artifact-url }}) |" >> $GITHUB_STEP_SUMMARY
118+
echo "" >> $GITHUB_STEP_SUMMARY
119+
120+
echo "### 📋 Test Execution Details" >> $GITHUB_STEP_SUMMARY
121+
echo "| Attempt | Status | Notes |" >> $GITHUB_STEP_SUMMARY
122+
echo "|---------|--------|-------|" >> $GITHUB_STEP_SUMMARY
123+
echo "| **Test Run 1** | ${{ steps.test1.outcome == 'success' && '✅ Passed' || '❌ Failed' }} | Initial test execution |" >> $GITHUB_STEP_SUMMARY
124+
125+
if [[ "${{ steps.test1.outcome }}" == "failure" ]]; then
126+
echo "| **Test Run 2** | ${{ steps.test2.outcome == 'success' && '✅ Passed' || steps.test2.outcome == 'failure' && '❌ Failed' || '⏸️ Skipped' }} | Retry after 30s delay |" >> $GITHUB_STEP_SUMMARY
127+
fi
128+
129+
if [[ "${{ steps.test2.outcome }}" == "failure" ]]; then
130+
echo "| **Test Run 3** | ${{ steps.test3.outcome == 'success' && '✅ Passed' || steps.test3.outcome == 'failure' && '❌ Failed' || '⏸️ Skipped' }} | Final retry after 60s delay |" >> $GITHUB_STEP_SUMMARY
131+
fi
132+
133+
echo "" >> $GITHUB_STEP_SUMMARY
134+
135+
if [[ "$OVERALL_SUCCESS" == "true" ]]; then
136+
echo "### ✅ Test Results" >> $GITHUB_STEP_SUMMARY
137+
echo "- End-to-end tests completed successfully" >> $GITHUB_STEP_SUMMARY
138+
echo "- Application is functioning as expected" >> $GITHUB_STEP_SUMMARY
139+
else
140+
echo "### ❌ Test Results" >> $GITHUB_STEP_SUMMARY
141+
echo "- All test attempts failed" >> $GITHUB_STEP_SUMMARY
142+
echo "- Check the e2e-test/test job for detailed error information" >> $GITHUB_STEP_SUMMARY
143+
fi

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ This example focuses on a generic use case - chat with your own data, generate a
1313
</div>
1414
<br/>
1515

16+
**Note:** With any AI solutions you create using these templates, you are responsible for assessing all associated risks and for complying with all applicable laws and safety standards. Learn more in the transparency documents for [Agent Service](https://learn.microsoft.com/en-us/azure/ai-foundry/responsible-ai/agents/transparency-note) and [Agent Framework](https://github.com/microsoft/agent-framework/blob/main/TRANSPARENCY_FAQ.md).
17+
<br/>
18+
1619
<h2><img src="./docs/images/readme/solution-overview.png" width="48" />
1720
Solution overview
1821
</h2>
@@ -69,8 +72,8 @@ Follow the quick deploy steps on the deployment guide to deploy this solution to
6972
[Click here to launch the deployment guide](./docs/DeploymentGuide.md)
7073
<br/><br/>
7174

72-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/document-generation-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/document-generation-solution-accelerator) |
73-
|---|---|
75+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/document-generation-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/document-generation-solution-accelerator) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvZG9jdW1lbnQtZ2VuZXJhdGlvbi1zb2x1dGlvbi1hY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==) |
76+
|---|---|---|
7477

7578
<br/>
7679

docs/CustomizingAzdParameters.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ By default this template will use the environment name as the prefix to prevent
1818
| `AZURE_ENV_OPENAI_API_VERSION` | string | `2025-01-01-preview` | Specifies the API version for Azure OpenAI. |
1919
| `AZURE_ENV_MODEL_CAPACITY` | integer | `30` | Sets the GPT model capacity (based on what's available in your subscription). |
2020
| `AZURE_ENV_EMBEDDING_MODEL_NAME` | string | `text-embedding-ada-002` | Sets the name of the embedding model to use. |
21+
| `AZURE_ENV_ACR_NAME` | string | `byocgacontainerreg` | Sets the Azure Container Registry name (allowed value: `byocgacontainerreg`)|
2122
| `AZURE_ENV_IMAGETAG` | string | `latest_waf` | Set the Image tag Like (allowed values: latest_waf, dev, hotfix) |
2223
| `AZURE_ENV_EMBEDDING_MODEL_CAPACITY` | integer | `80` | Sets the capacity for the embedding model deployment. |
2324
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | Guide to get your [Existing Workspace ID](/docs/re-use-log-analytics.md) | Reuses an existing Log Analytics Workspace instead of creating a new one. |
2425
| `AZURE_EXISTING_AI_PROJECT_RESOURCE_ID` | string | Guid to get your existing AI Foundry Project resource ID | Reuses an existing AIFoundry and AIFoundryProject instead of creating a new one. |
26+
| `AZURE_ENV_OPENAI_LOCATION` | string | `<User selects during deployment>` | Sets the Azure region for OpenAI resource deployment. |
2527

2628

2729
## How to Set a Parameter

docs/DeploymentGuide.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ azd env set AZURE_ENV_VM_ADMIN_PASSWORD <your-password>
6464
6565
## Deployment Options & Steps
6666

67-
Pick from the options below to see step-by-step instructions for GitHub Codespaces, VS Code Dev Containers, and Local Environments.
67+
Pick from the options below to see step-by-step instructions for GitHub Codespaces, VS Code Dev Containers, Visual Studio Code (WEB) and Local Environments.
6868

69-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/document-generation-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/document-generation-solution-accelerator) |
70-
|---|---|
69+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/document-generation-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/document-generation-solution-accelerator) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvZG9jdW1lbnQtZ2VuZXJhdGlvbi1zb2x1dGlvbi1hY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==) |
70+
|---|---|--|
7171

7272
<details>
7373
<summary><b>Deploy in GitHub Codespaces</b></summary>
@@ -103,6 +103,38 @@ You can run this solution in VS Code Dev Containers, which will open the project
103103

104104
</details>
105105

106+
<details>
107+
<summary><b>Deploy in Visual Studio Code (WEB)</b></summary>
108+
109+
### Visual Studio Code (WEB)
110+
111+
You can run this solution in VS Code Web. The button will open a web-based VS Code instance in your browser:
112+
113+
1. Open the solution accelerator (this may take several minutes):
114+
115+
[![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvZG9jdW1lbnQtZ2VuZXJhdGlvbi1zb2x1dGlvbi1hY2NlbGVyYXRvci9yZWZzL2hlYWRzL21haW4vaW5mcmEvdnNjb2RlX3dlYiIsICJpbmRleFVybCI6ICIvaW5kZXguanNvbiIsICJ2YXJpYWJsZXMiOiB7ImFnZW50SWQiOiAiIiwgImNvbm5lY3Rpb25TdHJpbmciOiAiIiwgInRocmVhZElkIjogIiIsICJ1c2VyTWVzc2FnZSI6ICIiLCAicGxheWdyb3VuZE5hbWUiOiAiIiwgImxvY2F0aW9uIjogIiIsICJzdWJzY3JpcHRpb25JZCI6ICIiLCAicmVzb3VyY2VJZCI6ICIiLCAicHJvamVjdFJlc291cmNlSWQiOiAiIiwgImVuZHBvaW50IjogIiJ9LCAiY29kZVJvdXRlIjogWyJhaS1wcm9qZWN0cy1zZGsiLCAicHl0aG9uIiwgImRlZmF1bHQtYXp1cmUtYXV0aCIsICJlbmRwb2ludCJdfQ==)
116+
117+
2. When prompted, sign in using your Microsoft account linked to your Azure subscription.
118+
119+
Select the appropriate subscription to continue.
120+
121+
3. Once the solution opens, the **AI Foundry terminal** will automatically start running the following command to install the required dependencies:
122+
123+
```shell
124+
sh install.sh
125+
```
126+
During this process, you’ll be prompted with the message:
127+
```
128+
What would you like to do with these files?
129+
- Overwrite with versions from template
130+
- Keep my existing files unchanged
131+
```
132+
Choose “**Overwrite with versions from template**” and provide a unique environment name when prompted.
133+
134+
4. Continue with the [deploying steps](#deploying-with-azd).
135+
136+
</details>
137+
106138
<details>
107139
<summary><b>Deploy in your local Environment</b></summary>
108140

@@ -172,7 +204,7 @@ To adjust quota settings, follow these [steps](./AzureGPTQuotaSettings.md).
172204

173205
### Deploying with AZD
174206

175-
Once you've opened the project in [Codespaces](#github-codespaces), [Dev Containers](#vs-code-dev-containers), or [locally](#local-environment), you can deploy it to Azure by following these steps:
207+
Once you've opened the project in [Codespaces](#github-codespaces), [Dev Containers](#vs-code-dev-containers), [Visual Studio Code (WEB)](#visual-studio-code-web) or [locally](#local-environment), you can deploy it to Azure by following these steps:
176208
177209
1. Login to Azure:
178210

infra/main.parameters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
},
4141
"azureExistingAIProjectResourceId":{
4242
"value": "${AZURE_EXISTING_AI_PROJECT_RESOURCE_ID}"
43+
},
44+
"acrName": {
45+
"value": "${AZURE_ENV_ACR_NAME}"
46+
},
47+
"azureAiServiceLocation": {
48+
"value": "${AZURE_ENV_OPENAI_LOCATION}"
4349
}
4450
}
4551
}

infra/main.waf.parameters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@
5858
},
5959
"azureExistingAIProjectResourceId":{
6060
"value": "${AZURE_EXISTING_AI_PROJECT_RESOURCE_ID}"
61+
},
62+
"acrName": {
63+
"value": "${AZURE_ENV_ACR_NAME}"
64+
},
65+
"azureAiServiceLocation": {
66+
"value": "${AZURE_ENV_OPENAI_LOCATION}"
6167
}
6268
}
6369
}

infra/scripts/process_sample_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ else
251251
else
252252
# Use Azure CLI login if running locally
253253
echo "Authenticating with Azure CLI..."
254-
az login
254+
az login --use-device-code
255255
fi
256256
echo "Not authenticated with Azure. Attempting to authenticate..."
257257
fi

infra/scripts/run_create_index_scripts.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,24 @@ fi
8383
echo "User already has the Azure AI User role."
8484
fi
8585

86+
### Assign Cognitive Services OpenAI User role to the signed in user ###
87+
88+
# Check if the user has the Cognitive Services OpenAI User role
89+
echo "Checking if user has the Cognitive Services OpenAI User role"
90+
role_assignment=$(MSYS_NO_PATHCONV=1 az role assignment list --role 5e0bd9bd-7b93-4f28-af87-19fc36ad61bd --scope $aif_resource_id --assignee $signed_user_id --query "[].roleDefinitionId" -o tsv)
91+
if [ -z "$role_assignment" ]; then
92+
echo "User does not have the Cognitive Services OpenAI User role. Assigning the role."
93+
MSYS_NO_PATHCONV=1 az role assignment create --assignee $signed_user_id --role 5e0bd9bd-7b93-4f28-af87-19fc36ad61bd --scope $aif_resource_id --output none
94+
if [ $? -eq 0 ]; then
95+
echo "Cognitive Services OpenAI User role assigned successfully."
96+
else
97+
echo "Failed to assign Cognitive Services OpenAI User role."
98+
exit 1
99+
fi
100+
else
101+
echo "User already has the Cognitive Services OpenAI User role."
102+
fi
103+
86104
### Assign Search Index Data Contributor role to the signed in user ###
87105

88106
echo "Getting Azure Search resource id"

0 commit comments

Comments
 (0)