Skip to content

Commit 93558c0

Browse files
Merge pull request #293 from microsoft/data-changes
fix: Merging dev into main branch
2 parents de370d2 + 8208841 commit 93558c0

File tree

75 files changed

+8393
-3015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8393
-3015
lines changed

.azdo/pipelines/azure-dev.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Run when commits are pushed to mainline branch (main or master)
2+
# Set this to the mainline branch you are using
3+
trigger:
4+
- main
5+
6+
pool:
7+
vmImage: ubuntu-latest
8+
9+
steps:
10+
- task: setup-azd@0
11+
displayName: Install azd
12+
13+
14+
- pwsh: |
15+
azd config set auth.useAzCliAuth "true"
16+
displayName: Configure AZD to Use AZ CLI Authentication.
17+
18+
- task: AzureCLI@2
19+
displayName: Provision Infrastructure
20+
inputs:
21+
azureSubscription: azconnection
22+
scriptType: bash
23+
scriptLocation: inlineScript
24+
inlineScript: |
25+
azd provision --no-prompt
26+
env:
27+
28+
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
29+
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
30+
AZURE_LOCATION: $(AZURE_LOCATION)
31+
32+
- task: AzureCLI@2
33+
displayName: Deploy Application
34+
inputs:
35+
azureSubscription: azconnection
36+
scriptType: bash
37+
scriptLocation: inlineScript
38+
inlineScript: |
39+
azd deploy --no-prompt
40+
env:
41+
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
42+
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
43+
AZURE_LOCATION: $(AZURE_LOCATION)

.devcontainer/devcontainer.json

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
11
{
2-
"name": "Azure Developer CLI",
3-
"image": "mcr.microsoft.com/devcontainers/python:3.10",
2+
"name": "azd-template",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",
4+
"forwardPorts": [50505],
45
"features": {
5-
"ghcr.io/devcontainers/features/node:1": {
6-
"version": "16",
7-
"nodeGypDependencies": false
8-
},
9-
"ghcr.io/devcontainers/features/azure-cli:1.0.8": {},
106
"ghcr.io/azure/azure-dev/azd:latest": {}
117
},
128
"customizations": {
139
"vscode": {
1410
"extensions": [
1511
"ms-azuretools.azure-dev",
1612
"ms-azuretools.vscode-bicep",
17-
"ms-python.python"
18-
]
19-
},
20-
"codespaces": {
21-
"openFiles": [
22-
"README.md"
13+
"ms-python.python",
14+
"ms-toolsai.jupyter",
15+
"GitHub.vscode-github-actions"
2316
]
2417
}
2518
},
26-
"forwardPorts": [
27-
5000
28-
],
19+
// "postStartCommand": "git pull origin main && python3 -m pip install -r infra/scripts/index_scripts/requirements.txt",
2920
"remoteUser": "vscode",
3021
"hostRequirements": {
31-
"memory": "8gb"
22+
"memory": "4gb"
3223
}
33-
}
24+
}

.env.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ AZURE_OPENAI_TEMPLATE_SYSTEM_MESSAGE="Generate a template for a document given a
2121
AZURE_OPENAI_GENERATE_SECTION_CONTENT_PROMPT="Help the user generate content for a section in a document. The user has provided a section title and a brief description of the section. The user would like you to provide an initial draft for the content in the section. Must be less than 2000 characters. Only include the section content, not the title. Do not use markdown syntax. Whenever possible, use ingested documents to help generate the section content."
2222
AZURE_OPENAI_TITLE_PROMPT="Summarize the conversation so far into a 4-word or less title. Do not use any quotation marks or punctuation. Respond with a json object in the format {{\"title\": string}}. Do not include any other commentary or description."
2323
AZURE_OPENAI_PREVIEW_API_VERSION=2024-05-01-preview
24+
AZURE_OPENAI_API_VERSION=2024-05-01-preview
2425
AZURE_OPENAI_STREAM=True
2526
AZURE_OPENAI_ENDPOINT=
2627
AZURE_OPENAI_EMBEDDING_NAME=
@@ -119,4 +120,4 @@ PROMPTFLOW_API_KEY=
119120
PROMPTFLOW_RESPONSE_TIMEOUT=120
120121
PROMPTFLOW_REQUEST_FIELD_NAME=query
121122
PROMPTFLOW_RESPONSE_FIELD_NAME=reply
122-
PROMPTFLOW_CITATIONS_FIELD_NAME=documents
123+
PROMPTFLOW_CITATIONS_FIELD_NAME=documents

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +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 @hunterjam @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @malrose07
5+
* @toherman-msft @hunterjam @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @malrose07 @blessing-sanusi
6+

.github/workflows/azure-dev.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Azure Template Validation
2+
on:
3+
workflow_dispatch:
4+
5+
permissions:
6+
contents: read
7+
id-token: write
8+
pull-requests: write
9+
10+
jobs:
11+
template_validation_job:
12+
runs-on: ubuntu-latest
13+
name: Template validation
14+
15+
steps:
16+
# Step 1: Checkout the code from your repository
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
# Step 2: Validate the Azure template using microsoft/template-validation-action
21+
- name: Validate Azure Template
22+
uses: microsoft/[email protected]
23+
id: validation
24+
env:
25+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
26+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
27+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
28+
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
29+
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
# Step 3: Print the result of the validation
33+
- name: Print result
34+
run: cat ${{ steps.validation.outputs.resultFile }}

.github/workflows/docker-build-and-push.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
- name: Set up Docker Buildx
2525
uses: docker/setup-buildx-action@v1
2626

27-
- name: Log in to Azure Container Registry
27+
- name: Log in to Azure Container Registry - External Registry
2828
if: ${{ github.ref_name == 'main' }}
2929
uses: azure/docker-login@v2
3030
with:
3131
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
3232
username: ${{ secrets.ACR_USERNAME }}
3333
password: ${{ secrets.ACR_PASSWORD }}
3434

35-
- name: Log in to Azure Container Registry (Dev/Demo)
36-
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' }}
35+
- name: Log in to Azure Container Registry (Main/Dev/Demo/Dependabotchanges) - Internal Registry
36+
if: ${{ github.ref_name == 'main' ||github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
3737
uses: azure/docker-login@v2
3838
with:
3939
login-server: ${{ secrets.ACR_DEV_LOGIN_SERVER }}
@@ -46,7 +46,13 @@ jobs:
4646

4747
- name: Get registry
4848
id: registry
49-
run: echo "registry=${{ github.ref_name == 'main' && secrets.ACR_LOGIN_SERVER || secrets.ACR_DEV_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
49+
run: |
50+
if [[ "${{ github.ref_name }}" == "main" ]]; then
51+
echo "ext_registry=${{ secrets.ACR_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
52+
echo "int_registry=${{ secrets.ACR_DEV_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
53+
else
54+
echo "int_registry=${{ secrets.ACR_DEV_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
55+
fi
5056
5157
- name: Determine Tag Name Based on Branch
5258
id: determine_tag
@@ -57,17 +63,30 @@ jobs:
5763
echo "tagname=dev" >> $GITHUB_OUTPUT
5864
elif [[ "${{ github.ref_name }}" == "demo" ]]; then
5965
echo "tagname=demo" >> $GITHUB_OUTPUT
66+
elif [[ "${{ github.ref_name }}" == "dependabotchanges" ]]; then
67+
echo "tagname=dependabotchanges" >> $GITHUB_OUTPUT
6068
else
6169
echo "tagname=default" >> $GITHUB_OUTPUT
62-
6370
fi
6471
65-
- name: Build Docker Image and optionally push
72+
- name: Build Docker Image and optionally push - Internal Registry
73+
uses: docker/build-push-action@v6
74+
with:
75+
context: .
76+
file: WebApp.Dockerfile
77+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
78+
tags: |
79+
${{ steps.registry.outputs.int_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}
80+
${{ steps.registry.outputs.int_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}
81+
82+
- name: Build Docker Image and optionally push - External Registry
83+
if: ${{ github.ref_name == 'main' }}
6684
uses: docker/build-push-action@v6
6785
with:
6886
context: .
6987
file: WebApp.Dockerfile
70-
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
88+
push: ${{github.ref_name == 'main' }}
7189
tags: |
72-
${{ steps.registry.outputs.registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}
73-
${{ steps.registry.outputs.registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}
90+
${{ steps.registry.outputs.ext_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}
91+
${{ steps.registry.outputs.ext_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}
92+

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This solution accelerator is a powerful tool that helps you create your own AI a
1515

1616
It leverages Azure OpenAI Service and Azure AI Search, to identify relevant documents, summarize unstructured information, and generate document templates.
1717

18+
1819
### Key features
1920

2021
![Key Features](/docs/images/keyfeatures.png)
@@ -23,16 +24,13 @@ Below is an image of the solution.
2324

2425
![Landing Page](/docs/images/landing_page.png)
2526

26-
2727
**Scenario**
2828

2929
This example focuses on a generic use case - chat with your own data, generate a document template using your own data, and exporting the document in a docx format.
3030

3131
The sample data is sourced from generic AI-generated promissory notes.
3232
The documents are intended for use as sample data only.
3333

34-
<br/>
35-
3634

3735
### Solution accelerator architecture
3836
![image](/docs/images/architecture.png)
@@ -42,7 +40,7 @@ The documents are intended for use as sample data only.
4240
QUICK DEPLOY
4341
</h2>
4442

45-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Generic-Build-your-own-copilot-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/Generic-Build-your-own-copilot-Solution-Accelerator) | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FGeneric-Build-your-own-copilot-Solution-Accelerator%2Fmain%2Finfra%2Fmain.json) |
43+
| [![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) | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fdocument-generation-solution-accelerator%2Fmain%2Finfra%2Fmain.json) |
4644
|---|---|---|
4745

4846

@@ -100,7 +98,7 @@ You can run this solution using GitHub Codespaces. The button will open a web-ba
10098

10199
1. Open the solution accelerator (this may take several minutes):
102100

103-
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator)
101+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/document-generation-solution-accelerator)
104102
2. Accept the default values on the create Codespaces page
105103
3. Open a terminal window if it is not already open
106104
4. Continue with the [deploying steps](#deploying)
@@ -117,7 +115,7 @@ You can run this solution in VS Code Dev Containers, which will open the project
117115
1. Start Docker Desktop (install it if not already installed)
118116
2. Open the project:
119117

120-
[![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/Generic-Build-your-own-copilot-Solution-Accelerator)
118+
[![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)
121119

122120

123121
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
@@ -142,7 +140,7 @@ If you're not using one of the above options for opening the project, then you'l
142140
2. Download the project code:
143141

144142
```shell
145-
azd init -t microsoft/Generic-Build-your-own-copilot-Solution-Accelerator/
143+
azd init -t microsoft/document-generation-solution-accelerator/
146144
```
147145

148146
3. Open the project folder in your terminal or editor.
@@ -158,7 +156,7 @@ If you're not using one of the above options for opening the project, then you'l
158156

159157
Click the following deployment button to create the required resources for this solution directly in your Azure Subscription.
160158

161-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FGeneric-Build-your-own-copilot-Solution-Accelerator%2Fmain%2Finfra%2Fmain.json)
159+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fdocument-generation-solution-accelerator%2Fmain%2Finfra%2Fmain.json)
162160

163161
</details>
164162

@@ -223,7 +221,7 @@ https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-regi
223221
224222
2. Click the following deployment button to create the required resources for this accelerator in your Azure Subscription.
225223
226-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FGeneric-Build-your-own-copilot-Solution-Accelerator%2Fmain%2Finfrastructure%2Fdeployment.json)
224+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fdocument-generation-solution-accelerator%2Fmain%2Finfrastructure%2Fdeployment.json)
227225
228226
3. You will need to select an Azure Subscription, create/select a Resource group, and Region. If your intention is to deploy this solution accelerator and the corresponding sample data set, the default settings will suffice.
229227

0 commit comments

Comments
 (0)