Skip to content

Commit cfbfa41

Browse files
fix validation pipeline with missing files and actions (#1774)
* add missing sections and reorganize content * add missing security file * add security devops action to azure dev workflow * add upload sarif action to azure dev workflow * move screenshot and video after feature list * prioritizing cost information * moving running locally back down * remove actions * Some reorg that still meets reqs * Fix broken links * Delete local certs --------- Co-authored-by: Pamela Fox <[email protected]> Co-authored-by: Pamela Fox <[email protected]>
1 parent b49a89c commit cfbfa41

File tree

3 files changed

+97
-51
lines changed

3 files changed

+97
-51
lines changed

README.md

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,39 @@
22

33
This solution's backend is written in Python. There are also [**JavaScript**](https://aka.ms/azai/js/code), [**.NET**](https://aka.ms/azai/net/code), and [**Java**](https://aka.ms/azai/java/code) samples based on this one. Learn more about [developing AI apps using Azure AI Services](https://aka.ms/azai).
44

5+
[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=brightgreen&logo=github)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=599293758&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
6+
[![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/azure-samples/azure-search-openai-demo)
7+
58
## Table of Contents
69

710
- [Features](#features)
811
- [Azure account requirements](#azure-account-requirements)
9-
- [Azure deployment](#azure-deployment)
1012
- [Cost estimation](#cost-estimation)
11-
- [Project setup](#project-setup)
12-
- [GitHub Codespaces](#github-codespaces)
13-
- [VS Code Dev Containers](#vs-code-dev-containers)
14-
- [Local environment](#local-environment)
15-
- [Deploying](#deploying)
13+
- [Getting Started](#getting-started)
14+
- [GitHub Codespaces](#github-codespaces)
15+
- [VS Code Dev Containers](#vs-code-dev-containers)
16+
- [Local environment](#local-environment)
17+
- [Deploying](#deploying)
1618
- [Deploying again](#deploying-again)
17-
- [Sharing environments](#sharing-environments)
18-
- [Using the app](#using-the-app)
19+
- [Sharing environments](#sharing-environments)
1920
- [Running locally](#running-locally)
20-
- [Monitoring with Application Insights](#monitoring-with-application-insights)
21-
- [Customizing the UI and data](#customizing-the-ui-and-data)
22-
- [Productionizing](#productionizing)
21+
- [Using the app](#using-the-app)
2322
- [Clean up](#clean-up)
24-
- [Troubleshooting](#troubleshooting)
25-
- [Resources](#resources)
23+
- [Guidance](#guidance)
24+
- [Customizing the UI and data](#customizing-the-ui-and-data)
25+
- [Monitoring with Application Insights](#monitoring-with-application-insights)
26+
- [Productionizing](#productionizing)
27+
- [Troubleshooting](#troubleshooting)
28+
- [Resources](#resources)
2629

27-
[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=brightgreen&logo=github)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=599293758&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
28-
[![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/azure-samples/azure-search-openai-demo)
30+
![Chat screen](docs/images/chatscreen.png)
31+
32+
[📺 Watch a video overview of the app.](https://youtu.be/3acB0OWmLvM)
2933

3034
This sample demonstrates a few approaches for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It uses Azure OpenAI Service to access a GPT model (gpt-35-turbo), and Azure AI Search for data indexing and retrieval.
3135

3236
The repo includes sample data so it's ready to try end to end. In this sample application we use a fictitious company called Contoso Electronics, and the experience allows its employees to ask questions about the benefits, internal policies, as well as job descriptions and roles.
3337

34-
![RAG Architecture](docs/images/appcomponents.png)
35-
3638
## Features
3739

3840
- Chat (multi-turn) and Q&A (single turn) interfaces
@@ -44,9 +46,9 @@ The repo includes sample data so it's ready to try end to end. In this sample ap
4446
- Optional automation of [user login and data access](/docs/login_and_acl.md) via Microsoft Entra
4547
- Performance tracing and monitoring with Application Insights
4648

47-
![Chat screen](docs/images/chatscreen.png)
49+
### Architecture Diagram
4850

49-
[📺 Watch a video overview of the app.](https://youtu.be/3acB0OWmLvM)
51+
![RAG Architecture](docs/images/appcomponents.png)
5052

5153
## Azure account requirements
5254

@@ -58,8 +60,6 @@ The repo includes sample data so it's ready to try end to end. In this sample ap
5860
- Your Azure account must have `Microsoft.Authorization/roleAssignments/write` permissions, such as [Role Based Access Control Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#role-based-access-control-administrator-preview), [User Access Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#user-access-administrator), or [Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#owner). If you don't have subscription-level permissions, you must be granted [RBAC](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#role-based-access-control-administrator-preview) for an existing resource group and [deploy to that existing group](docs/deploy_existing.md#resource-group).
5961
- Your Azure account also needs `Microsoft.Resources/deployments/write` permissions on the subscription level.
6062

61-
## Azure deployment
62-
6363
### Cost estimation
6464

6565
Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage.
@@ -78,30 +78,31 @@ See this guide on [deploying with minimal costs](docs/deploy_lowcost.md) for mor
7878
⚠️ To avoid unnecessary costs, remember to take down your app if it's no longer in use,
7979
either by deleting the resource group in the Portal or running `azd down`.
8080

81-
### Project setup
81+
## Getting Started
8282

8383
You have a few options for setting up this project.
8484
The easiest way to get started is GitHub Codespaces, since it will setup all the tools for you,
8585
but you can also [set it up locally](#local-environment) if desired.
8686

87-
#### GitHub Codespaces
87+
### GitHub Codespaces
8888

8989
You can run this repo virtually by using GitHub Codespaces, which will open a web-based VS Code in your browser:
9090

9191
[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=brightgreen&logo=github)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=599293758&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
9292

9393
Once the codespace opens (this may take several minutes), open a terminal window.
9494

95-
#### VS Code Dev Containers
95+
### VS Code Dev Containers
9696

9797
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):
9898

9999
1. Start Docker Desktop (install it if not already installed)
100-
1. Open the project:
100+
2. Open the project:
101101
[![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/azure-samples/azure-search-openai-demo)
102-
1. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
103102

104-
#### Local environment
103+
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
104+
105+
### Local environment
105106

106107
1. Install the required tools:
107108

@@ -123,7 +124,7 @@ A related option is VS Code Dev Containers, which will open the project in your
123124

124125
Note that this command will initialize a git repository, so you do not need to clone this repository.
125126

126-
### Deploying
127+
## Deploying
127128

128129
Follow these steps to provision Azure resources and deploy the application code:
129130

@@ -162,7 +163,7 @@ If you've changed the infrastructure files (`infra` folder or `azure.yaml`), the
162163

163164
```azd up```
164165

165-
## Sharing environments
166+
#### Sharing environments
166167

167168
To give someone else access to a completely deployed and existing environment,
168169
either you or they can follow these steps:
@@ -176,7 +177,7 @@ either you or they can follow these steps:
176177
177178
## Running locally
178179
179-
You can only run locally **after** having successfully run the `azd up` command. If you haven't yet, follow the steps in [Azure deployment](#azure-deployment) above.
180+
You can only run locally **after** having successfully run the `azd up` command. If you haven't yet, follow the [deploying](#deploying) steps above.
180181

181182
1. Run `azd auth login`
182183
2. Change dir to `app`
@@ -195,7 +196,25 @@ Once in the web app:
195196
- Explore citations and sources
196197
- Click on "settings" to try different options, tweak prompts, etc.
197198

198-
## Monitoring with Application Insights
199+
## Clean up
200+
201+
To clean up all the resources created by this sample:
202+
203+
1. Run `azd down`
204+
2. When asked if you are sure you want to continue, enter `y`
205+
3. When asked if you want to permanently delete the resources, enter `y`
206+
207+
The resource group and all the resources will be deleted.
208+
209+
## Guidance
210+
211+
Besides the tips below, you can find extensive documentation in the [docs](docs/README.md) folder.
212+
213+
### Customizing the UI and data
214+
215+
Once you successfully deploy the app, you can start customizing it for your needs: changing the text, tweaking the prompts, and replacing the data. Consult the [app customization guide](docs/customization.md) as well as the [data ingestion guide](docs/data_ingestion.md) for more details.
216+
217+
### Monitoring with Application Insights
199218

200219
By default, deployed apps use Application Insights for the tracing of each request, along with the logging of errors.
201220

@@ -212,27 +231,13 @@ You can also see chart summaries on a dashboard by running the following command
212231
azd monitor
213232
```
214233

215-
## Customizing the UI and data
216-
217-
Once you successfully deploy the app, you can start customizing it for your needs: changing the text, tweaking the prompts, and replacing the data. Consult the [app customization guide](docs/customization.md) as well as the [data ingestion guide](docs/data_ingestion.md) for more details.
218-
219-
## Productionizing
234+
### Productionizing
220235

221236
This sample is designed to be a starting point for your own production application,
222237
but you should do a thorough review of the security and performance before deploying
223238
to production. Read through our [productionizing guide](docs/productionizing.md) for more details.
224239

225-
## Clean up
226-
227-
To clean up all the resources created by this sample:
228-
229-
1. Run `azd down`
230-
2. When asked if you are sure you want to continue, enter `y`
231-
3. When asked if you want to permanently delete the resources, enter `y`
232-
233-
The resource group and all the resources will be deleted.
234-
235-
## Troubleshooting
240+
### Troubleshooting
236241

237242
Here are the most common failure scenarios and solutions:
238243

@@ -248,7 +253,7 @@ Here are the most common failure scenarios and solutions:
248253

249254
1. After running `azd up` and visiting the website, you see a '404 Not Found' in the browser. Wait 10 minutes and try again, as it might be still starting up. Then try running `azd deploy` and wait again. If you still encounter errors with the deployed app, consult the [guide on debugging App Service deployments](docs/appservice.md). Please file an issue if the logs don't help you resolve the error.
250255
251-
## Resources
256+
### Resources
252257
253258
- [Additional documentation for this app](docs/README.md)
254259
- [📖 Revolutionize your Enterprise Data with ChatGPT: Next-gen Apps w/ Azure OpenAI and AI Search](https://aka.ms/entgptsearchblog)

SECURITY.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
2+
3+
## Security
4+
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](<https://docs.microsoft.com/previous-versions/tn-archive/cc751383(v=technet.10)>), please report it to us as described below.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14+
15+
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/msrc/pgp-key-msrc).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
- Full paths of source file(s) related to the manifestation of the issue
23+
- The location of the affected source code (tag/branch/commit or direct URL)
24+
- Any special configuration required to reproduce the issue
25+
- Step-by-step instructions to reproduce the issue
26+
- Proof-of-concept or exploit code (if possible)
27+
- Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/msrc/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

docs/deploy_features.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ By default, the deployed Azure web app allows users to chat with all your indexe
166166

167167
## Enabling user document upload
168168

169-
You can enable an optional user document upload system to allow users to upload their own documents and chat with them. This feature requires you to first [enable login and document level access control](docs/login_and_acl.md). Then you can enable the optional user document upload system by setting an azd environment variable:
169+
You can enable an optional user document upload system to allow users to upload their own documents and chat with them. This feature requires you to first [enable login and document level access control](./login_and_acl.md). Then you can enable the optional user document upload system by setting an azd environment variable:
170170

171171
`azd env set USE_USER_UPLOAD true`
172172

@@ -205,15 +205,15 @@ Both these repositories adhere to the same [HTTP protocol for AI chat apps](http
205205

206206
## Adding an OpenAI load balancer
207207

208-
As discussed in more details in our [productionizing guide](docs/productionizing.md), you may want to consider implementing a load balancer between OpenAI instances if you are consistently going over the TPM limit.
208+
As discussed in more details in our [productionizing guide](./productionizing.md), you may want to consider implementing a load balancer between OpenAI instances if you are consistently going over the TPM limit.
209209
Fortunately, this repository is designed for easy integration with other repositories that create load balancers for OpenAI instances. For seamless integration instructions with this sample, please check:
210210

211211
* [Scale Azure OpenAI for Python with Azure API Management](https://learn.microsoft.com/azure/developer/python/get-started-app-chat-scaling-with-azure-api-management)
212212
* [Scale Azure OpenAI for Python chat using RAG with Azure Container Apps](https://learn.microsoft.com/azure/developer/python/get-started-app-chat-scaling-with-azure-container-apps)
213213

214214
## Deploying with private endpoints
215215

216-
It is possible to deploy this app with public access disabled, using Azure private endpoints and private DNS Zones. For more details, read [the private deployment guide](docs/deploy_private.md). That requires a multi-stage provisioning, so you will need to do more than just `azd up` after setting the environment variables.
216+
It is possible to deploy this app with public access disabled, using Azure private endpoints and private DNS Zones. For more details, read [the private deployment guide](./deploy_private.md). That requires a multi-stage provisioning, so you will need to do more than just `azd up` after setting the environment variables.
217217

218218
## Using local parsers
219219

0 commit comments

Comments
 (0)