Skip to content

Commit d7a8dae

Browse files
Merge pull request #266 from microsoft/azd-template1
Azd template folder structure and deployment scripts
2 parents c3ddd0f + db4c5f6 commit d7a8dae

File tree

13 files changed

+1370
-448
lines changed

13 files changed

+1370
-448
lines changed

.azdo/pipelines/azure-dev.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
- master
6+
7+
8+
9+
pool:
10+
vmImage: ubuntu-latest
11+
12+
steps:
13+
- task: setup-azd@0
14+
displayName: Install azd
15+
16+
17+
- pwsh: |
18+
azd config set auth.useAzCliAuth "true"
19+
displayName: Configure AZD to Use AZ CLI Authentication.
20+
21+
- task: AzureCLI@2
22+
displayName: Provision Infrastructure
23+
inputs:
24+
azureSubscription: azconnection
25+
scriptType: bash
26+
scriptLocation: inlineScript
27+
inlineScript: |
28+
azd provision --no-prompt
29+
env:
30+
31+
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
32+
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
33+
AZURE_LOCATION: $(AZURE_LOCATION)
34+
35+
- task: AzureCLI@2
36+
displayName: Deploy Application
37+
inputs:
38+
azureSubscription: azconnection
39+
scriptType: bash
40+
scriptLocation: inlineScript
41+
inlineScript: |
42+
azd deploy --no-prompt
43+
env:
44+
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
45+
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
46+
AZURE_LOCATION: $(AZURE_LOCATION)

.env.sample

Lines changed: 0 additions & 122 deletions
This file was deleted.
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 }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ static
88
scripts/config.json
99
venv
1010
myenv
11-
frontend/coverage
11+
frontend/coverage
12+
scriptsenv/

README.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ For additional training and support, please see:
5555
### Solution accelerator architecture
5656
![image](/docs/images/architecture.png)
5757

58+
<h2><img src="./docs/Images/ReadMe/quickDeploy.png" width="64">
59+
<br/>
60+
QUICK DEPLOY
61+
</h2>
62+
63+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator)
64+
[![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)
65+
[![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)
66+
5867

5968
> Note: Some features contained in this repository are in private preview. Certain features might not be supported or might have constrained capabilities. For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms).
6069
@@ -66,7 +75,7 @@ https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-regi
6675

6776
2. Click the following deployment button to create the required resources for this accelerator in your Azure Subscription.
6877

69-
[![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)
78+
[![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)
7079

7180
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.
7281

@@ -87,6 +96,69 @@ To add further access controls, update the logic in `getUserInfoList` in `fronte
8796
1. **For enhanced relevance and accuracy**, we recommend implementing [Azure hybrid search](https://learn.microsoft.com/en-us/azure/search/hybrid-search-overview) over full-text search. Azure hybrid search provides superior relevance, accuracy, support for complex queries, improved user experience, scalability, performance, advanced features, and integration with AI services. These advantages make it the ideal choice for modern applications that require robust and intelligent search capabilities.
8897
2. **Importance of prompt engineering**. Prompt engineering is a critical aspect of working with AI models, especially when leveraging advanced capabilities such as those provided by Azure AI services. Proper prompt engineering ensures that the AI models generate accurate, relevant, and contextually appropriate responses. It involves carefully crafting and refining prompts to guide the model's behavior and output effectively. Neglecting prompt engineering can result in suboptimal performance, irrelevant outputs, and increased frustration for users. Therefore, it is essential to invest time and effort in prompt engineering to fully harness the potential of AI models
8998

99+
### **Options**
100+
Pick from the options below to see step-by-step instructions for: GitHub Codespaces, VS Code Dev Containers, Local Environments, and Bicep deployments.
101+
102+
<details>
103+
<summary><b>Deploy in GitHub Codespaces</b></summary>
104+
105+
### GitHub Codpespaces
106+
107+
You can run this solution accelerator virtually by using GitHub Codespaces. The button will open a web-based VS Code instance in your browser:
108+
109+
1. Open the solution accelerator (this may take several minutes):
110+
111+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Generic-Build-your-own-copilot-Solution-Accelerator)
112+
2. Accept the default values on the create Codespaces page
113+
3. Open a terminal window if it is not already open
114+
4. Continue with the [deploying steps](#deploying)
115+
116+
</details>
117+
118+
<details>
119+
<summary><b>Deploy in VS Code</b></summary>
120+
121+
### VS Code Dev Containers
122+
123+
A related option is VS Code Dev Containers, which will open the project in your local VS Code using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers):
124+
125+
1. Start Docker Desktop (install it if not already installed)
126+
2. Open the project:
127+
128+
[![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)
129+
130+
131+
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
132+
4. Continue with the [deploying steps](#deploying)
133+
134+
</details>
135+
136+
<details>
137+
<summary><b>Deploy in your local environment</b></summary>
138+
139+
### Local environment
140+
141+
If you're not using one of the above options for opening the project, then you'll need to:
142+
143+
1. Make sure the following tools are installed:
144+
145+
* [Azure Developer CLI (azd)](https://aka.ms/install-azd)
146+
* [Python 3.9+](https://www.python.org/downloads/)
147+
* [Docker Desktop](https://www.docker.com/products/docker-desktop/)
148+
* [Git](https://git-scm.com/downloads)
149+
150+
2. Download the project code:
151+
152+
```shell
153+
azd init -t microsoft/Generic-Build-your-own-copilot-Solution-Accelerator/
154+
```
155+
156+
3. Open the project folder in your terminal or editor.
157+
158+
4. Continue with the [deploying steps](#deploying).
159+
160+
</details>
161+
90162
### Local deployment
91163
Review the local deployment [README](./docs/README_LOCAL.md).
92164
<br>

app-azure.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
3+
name: sample-app-aoai-chatgpt
4+
metadata:
5+
6+
services:
7+
backend:
8+
project: .
9+
language: py
10+
host: appservice
11+
hooks:
12+
prepackage:
13+
windows:
14+
shell: pwsh
15+
run: cd ./frontend;npm install;npm run build
16+
interactive: true
17+
continueOnError: false
18+
posix:
19+
shell: sh
20+
run: cd ./frontend;npm install;npm run build
21+
interactive: true
22+
continueOnError: false
23+
hooks:
24+
preprovision:
25+
windows:
26+
shell: pwsh
27+
run: ./scripts/auth_init.ps1
28+
interactive: true
29+
continueOnError: false
30+
posix:
31+
shell: sh
32+
run: ./scripts/auth_init.sh
33+
interactive: true
34+
continueOnError: false
35+
postprovision:
36+
windows:
37+
shell: pwsh
38+
run: ./scripts/auth_update.ps1;
39+
interactive: true
40+
continueOnError: false
41+
posix:
42+
shell: sh
43+
run: ./scripts/auth_update.sh;
44+
interactive: true
45+
continueOnError: false

0 commit comments

Comments
 (0)