Skip to content

Commit 3b3a9eb

Browse files
authored
Update README.md
1 parent 2248135 commit 3b3a9eb

File tree

1 file changed

+0
-160
lines changed

1 file changed

+0
-160
lines changed

README.md

Lines changed: 0 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ Note: some portions of the app use preview APIs.
1515

1616
## Deploy the app
1717

18-
### Deploy with Azure Developer CLI
19-
Please see [README_azd.md](./README_azd.md) for detailed instructions.
20-
21-
### One click Azure deployment
22-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fsample-app-aoai-chatGPT%2Fmain%2Finfrastructure%2Fdeployment.json)
23-
24-
Click on the Deploy to Azure button and configure your settings in the Azure Portal as described in the [Environment variables](#environment-variables) section.
25-
26-
Please see the [section below](#add-an-identity-provider) for important information about adding authentication to your app.
27-
2818
### Deploy from your local machine
2919

3020
#### Local Setup: Basic Chat Experience
@@ -97,125 +87,6 @@ To enable message feedback, you will need to set up CosmosDB resources. Then spe
9787
/.env
9888
- `AZURE_COSMOSDB_ENABLE_FEEDBACK=True`
9989

100-
#### Local Setup: Enable SQL Server
101-
To enable SQL Server, you will need to set up SQL Server resources. Then specify these additional environment variables:
102-
- `DATASOURCE_TYPE` (Should be set to `AzureSqlServer`)
103-
- `AZURE_SQL_SERVER_CONNECTION_STRING`
104-
- `AZURE_SQL_SERVER_TABLE_SCHEMA`
105-
106-
#### Deploy with the Azure CLI
107-
**NOTE**: If you've made code changes, be sure to **build the app code** with `start.cmd` or `start.sh` before you deploy, otherwise your changes will not be picked up. If you've updated any files in the `frontend` folder, make sure you see updates to the files in the `static` folder before you deploy.
108-
109-
You can use the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) to deploy the app from your local machine. Make sure you have version 2.48.1 or later.
110-
111-
If this is your first time deploying the app, you can use [az webapp up](https://learn.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest#az-webapp-up). Run the following two commands from the root folder of the repo, updating the placeholder values to your desired app name, resource group, location, and subscription. You can also change the SKU if desired.
112-
113-
1. `az webapp up --runtime PYTHON:3.11 --sku B1 --name <new-app-name> --resource-group <resource-group-name> --location <azure-region> --subscription <subscription-name>`
114-
1. `az webapp config set --startup-file "python3 -m gunicorn app:app" --name <new-app-name>`
115-
116-
If you've deployed the app previously, first run this command to update the appsettings to allow local code deployment:
117-
118-
`az webapp config appsettings set -g <resource-group-name> -n <existing-app-name> --settings WEBSITE_WEBDEPLOY_USE_SCM=false`
119-
120-
Check the runtime stack for your app by viewing the app service resource in the Azure Portal. If it shows "Python - 3.10", use `PYTHON:3.10` in the runtime argument below. If it shows "Python - 3.11", use `PYTHON:3.11` in the runtime argument below.
121-
122-
Check the SKU in the same way. Use the abbreviated SKU name in the argument below, e.g. for "Basic (B1)" the SKU is `B1`.
123-
124-
Then, use these commands to deploy your local code to the existing app:
125-
126-
1. `az webapp up --runtime <runtime-stack> --sku <sku> --name <existing-app-name> --resource-group <resource-group-name>`
127-
1. `az webapp config set --startup-file "python3 -m gunicorn app:app" --name <existing-app-name>`
128-
129-
Make sure that the app name and resource group match exactly for the app that was previously deployed.
130-
131-
Deployment will take several minutes. When it completes, you should be able to navigate to your app at {app-name}.azurewebsites.net.
132-
133-
### Add an identity provider
134-
After deployment, you will need to add an identity provider to provide authentication support in your app. See [this tutorial](https://learn.microsoft.com/en-us/azure/app-service/scenario-secure-app-authentication-app-service) for more information.
135-
136-
If you don't add an identity provider, the chat functionality of your app will be blocked to prevent unauthorized access to your resources and data.
137-
138-
To remove this restriction, you can add `AUTH_ENABLED=False` to the environment variables. This will disable authentication and allow anyone to access the chat functionality of your app. **This is not recommended for production apps.**
139-
140-
To add further access controls, update the logic in `getUserInfoList` in `frontend/src/pages/chat/Chat.tsx`.
141-
142-
### Common Customization Scenarios (e.g. updating the default chat logo and headers)
143-
144-
The interface allows for easy adaptation of the UI by modifying certain elements, such as the title and logo, through the use of [environment variables](#environment-variables).
145-
146-
- `UI_TITLE`
147-
- `UI_LOGO`
148-
- `UI_CHAT_TITLE`
149-
- `UI_CHAT_LOGO`
150-
- `UI_CHAT_DESCRIPTION`
151-
- `UI_FAVICON`
152-
- `UI_SHOW_SHARE_BUTTON`
153-
- `UI_SHOW_CHAT_HISTORY_BUTTON`
154-
155-
Feel free to fork this repository and make your own modifications to the UX or backend logic. You can modify the source (`frontend/src`). For example, you may want to change aspects of the chat display, or expose some of the settings in `app.py` in the UI for users to try out different behaviors. After your code changes, you will need to rebuild the front-end via `start.sh` or `start.cmd`.
156-
157-
### Scalability
158-
You can configure the number of threads and workers in `gunicorn.conf.py`. After making a change, redeploy your app using the commands listed above.
159-
160-
See the [Oryx documentation](https://github.com/microsoft/Oryx/blob/main/doc/configuration.md) for more details on these settings.
161-
162-
### Debugging your deployed app
163-
First, add an environment variable on the app service resource called "DEBUG". Set this to "true".
164-
165-
Next, enable logging on the app service. Go to "App Service logs" under Monitoring, and change Application logging to File System. Save the change.
166-
167-
Now, you should be able to see logs from your app by viewing "Log stream" under Monitoring.
168-
169-
### Configuring vector search
170-
When using your own data with a vector index, ensure these settings are configured on your app:
171-
- `AZURE_SEARCH_QUERY_TYPE`: can be `vector`, `vectorSimpleHybrid`, or `vectorSemanticHybrid`,
172-
- `AZURE_OPENAI_EMBEDDING_NAME`: the name of your Ada (text-embedding-ada-002) model deployment on your Azure OpenAI resource.
173-
- `AZURE_SEARCH_VECTOR_COLUMNS`: the vector columns in your index to use when searching. Join them with `|` like `contentVector|titleVector`.
174-
175-
### Changing Citation Display
176-
The Citation panel is defined at the end of `frontend/src/pages/chat/Chat.tsx`. The citations returned from Azure OpenAI On Your Data will include `content`, `title`, `filepath`, and in some cases `url`. You can customize the Citation section to use and display these as you like. For example, the title element is a clickable hyperlink if `url` is not a blob URL.
177-
178-
```
179-
<h5
180-
className={styles.citationPanelTitle}
181-
tabIndex={0}
182-
title={activeCitation.url && !activeCitation.url.includes("blob.core") ? activeCitation.url : activeCitation.title ?? ""}
183-
onClick={() => onViewSource(activeCitation)}
184-
>{activeCitation.title}</h5>
185-
186-
const onViewSource = (citation: Citation) => {
187-
if (citation.url && !citation.url.includes("blob.core")) {
188-
window.open(citation.url, "_blank");
189-
}
190-
};
191-
192-
```
193-
194-
### Using Entra ID
195-
196-
The app uses Azure OpenAI on your data [(see documentation)](https://learn.microsoft.com/en-us/azure/ai-services/openai/references/on-your-data). To enable Entra ID for intra-service authentication
197-
198-
1. Enable managed identity on Azure OpenAI
199-
2. Configure AI search to allow access from Azure OpenAI
200-
1. Enable Role Based Access control on the used AI search instance [(see documentation)](https://learn.microsoft.com/en-us/azure/search/search-security-enable-roles)
201-
2. Assign `Search Index Data Reader` and `Search Service Contributor` to the identity of the Azure OpenAI instance
202-
3. Do not configure `AZURE_SEARCH_KEY` and `AZURE_OPENAI_KEY` to use Entra ID authentication.
203-
4. Configure the webapp identity
204-
1. Enable managed identity in the app service that hosts the webapp
205-
2. Go to the Azure OpenAI instance and assign the role `Cognitive Services OpenAI User` to the identity of the webapp
206-
207-
Note: RBAC assignments can take a few minutes before becoming effective.
208-
209-
### Best Practices
210-
We recommend keeping these best practices in mind:
211-
212-
- Reset the chat session (clear chat) if the user changes any settings. Notify the user that their chat history will be lost.
213-
- Clearly communicate to the user what impact each setting will have on their experience.
214-
- When you rotate API keys for your AOAI or ACS resource, be sure to update the app settings for each of your deployed apps to use the new key.
215-
- Pull in changes from `main` frequently to ensure you have the latest bug fixes and improvements, especially when using Azure OpenAI on your data.
216-
217-
**A note on Azure OpenAI API versions**: The application code in this repo will implement the request and response contracts for the most recent preview API version supported for Azure OpenAI. To keep your application up-to-date as the Azure OpenAI API evolves with time, be sure to merge the latest API version update into your own application code and redeploy using the methods described in this document.
218-
21990
## Environment variables
22091

22192
Note: settings starting with `AZURE_SEARCH` are only needed when using Azure OpenAI on your data with Azure AI Search. If not connecting to your data, you only need to specify `AZURE_OPENAI` settings.
@@ -268,37 +139,6 @@ Note: settings starting with `AZURE_SEARCH` are only needed when using Azure Ope
268139
|PROMPTFLOW_CITATIONS_FIELD_NAME|documents|Default field name to process the citations output from Promptflow request.|
269140
|DATASOURCE_TYPE||Type of data source to use for using the 'on-your-data' api. Can be `AzureCognitiveSearch`, `AzureCosmosDB`, `Elasticsearch`, `Pinecone`, `AzureMLIndex`, `AzureSqlServer` or `None` |
270141

271-
272-
## Contributing
273-
274-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
275-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
276-
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
277-
278-
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
279-
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
280-
provided by the bot. You will only need to do this once across all repos using our CLA.
281-
282-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
283-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
284-
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
285-
286-
When contributing to this repository, please help keep the codebase clean and maintainable by running
287-
the formatter and linter with `npm run format` this will run `npx eslint --fix` and `npx prettier --write`
288-
on the frontebnd codebase.
289-
290-
If you are using VSCode, you can add the following settings to your `settings.json` to format and lint on save:
291-
292-
```json
293-
{
294-
"editor.codeActionsOnSave": {
295-
"source.fixAll.eslint": "explicit"
296-
},
297-
"editor.formatOnSave": true,
298-
"prettier.requireConfig": true,
299-
}
300-
```
301-
302142
## Trademarks
303143

304144
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft

0 commit comments

Comments
 (0)