Skip to content

Commit 134897c

Browse files
authored
Merge pull request #25 from eamonoreilly/main
Updating instructions to run locally
2 parents 8524a9e + 58bbf8b commit 134897c

File tree

2 files changed

+42
-22
lines changed

2 files changed

+42
-22
lines changed

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -127,35 +127,39 @@ Your frontend and backend apps can run on the local machine using storage emulat
127127
2. Create a new `app/backend/local.settings.json` file to store Azure resource configuration using values in the .azure/[environment name]
128128
```json
129129
{
130-
"IsEncrypted": false,
131-
"Values": {
132-
"AZURE_OPENAI_ENDPOINT": "<Endpoint of existing OpenAI service, e.g. https://xx.openai.azure.com/>",
133-
"AZURE_OPENAI_CHATGPT_DEPLOYMENT": "chat",
134-
"AZURE_OPENAI_EMB_DEPLOYMENT": "embedding",
135-
"AZURE_SEARCH_ENDPOINT": "<Endpoint of existing Azure AI Search service, e.g. https://xx.search.windows.net>",
136-
"AZURE_SEARCH_INDEX": "openai-index",
137-
"fileShare": "/mounts/openaifiles",
138-
"ServiceBusConnection__fullyQualifiedNamespace": "<Namespace of existing service bus namespace>",
139-
"ServiceBusQueueName": "<Name of service bus Queue>",
140-
"OpenAiStorageConnection": "<Connection string of storage account used by OpenAI extension (managed identity coming soon!)>",
141-
"AzureWebJobsStorage__accountName": "<Account name of storage account used by Function runtime>",
142-
"DEPLOYMENT_STORAGE_CONNECTION_STRING": "<Account name of storage account used by Function deployment>",
143-
"APPLICATIONINSIGHTS_CONNECTION_STRING": "<Connection for App Insights resource>",
144-
"SYSTEM_PROMPT": "You are a helpful assistant. You are responding to requests from a user about internal emails and documents. You can and should refer to the internal documents to help respond to requests. If a user makes a request thats not covered by the documents provided in the query, you must say that you do not have access to the information and not try and get information from other places besides the documents provided. The following is a list of documents that you can refer to when answering questions. The documents are in the format [filename]: [text] and are separated by newlines. If you answer a question by referencing any of the documents, please cite the document in your answer. For example, if you answer a question by referencing info.txt, you should add \"Reference: info.txt\" to the end of your answer on a separate line."
130+
"IsEncrypted": false,
131+
"Values": {
132+
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
133+
"AZURE_OPENAI_ENDPOINT": "<Endpoint of existing OpenAI service, e.g. https://xx.openai.azure.com/>",
134+
"AZURE_OPENAI_CHATGPT_DEPLOYMENT": "chat",
135+
"AZURE_OPENAI_EMB_DEPLOYMENT": "embedding",
136+
"AZURE_SEARCH_ENDPOINT": "<Endpoint of existing Azure AI Search service, e.g. https://xx.search.windows.net>",
137+
"AZURE_SEARCH_INDEX": "openai-index",
138+
"fileShare": "<Local directory on file system, e.g c:\\temp or /tmp>",
139+
"ServiceBusConnection": "<Namespace of existing service bus namespace>",
140+
"ServiceBusQueueName": "<Name of service bus Queue>",
141+
"OpenAiStorageConnection": "UseDevelopmentStorage=true",
142+
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
143+
"SYSTEM_PROMPT": "You are a helpful assistant. You are responding to requests from a user about internal emails and documents. You can and should refer to the internal documents to help respond to requests. If a user makes a request thats not covered by the documents provided in the query, you must say that you do not have access to the information and not try and get information from other places besides the documents provided. The following is a list of documents that you can refer to when answering questions. The documents are in the format [filename]: [text] and are separated by newlines. If you answer a question by referencing any of the documents, please cite the document in your answer. For example, if you answer a question by referencing info.txt, you should add \"Reference: info.txt\" to the end of your answer on a separate line."
144+
}
145145
}
146-
}
147-
```
148-
3. Disable VNET private endpoints in resource group so your function can connect to remote resources (or VPN into VNET)
149-
4. Start Azurite using VS Code extension or run this command in a new terminal window using optional [Docker](http://www.docker.com)
146+
```json
147+
3. Make the OpenAI resource have public access so you can reach it as it is set up for private endpoints only. Go to the networking tab on the OpenAI resource and change access to public.
148+
4. Add your account (eg. contoso.microsoft.com) to the Open AI resource with the following role.
149+
- Cognitive Services OpenAI User
150+
5. Add your account (eg. contoso.microsoft.com) to the AI search resource with the following roles.
151+
- Search Service Contributor
152+
- Search Index Data Contributor
153+
6. Start Azurite using VS Code extension or run this command in a new terminal window using optional [Docker](http://www.docker.com)
150154
```bash
151155
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 \
152156
mcr.microsoft.com/azure-storage/azurite
153157
```
154-
5. Start the Function app by pressing `F5` in Visual Studio (Code) or run this command:
158+
5. Start the static web app and function app by running
155159
```bash
156-
func start
160+
swa start
157161
```
158-
6. navigate to http://127.0.0.1:5000
162+
6. navigate to http://localhost:4280/
159163
160164
### Using the frontend web app:
161165

swa-cli.config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
3+
"configurations": {
4+
"azure-functions-open-ai-demo": {
5+
"appLocation": "app/frontend",
6+
"apiLocation": "app/backend",
7+
"outputLocation": "dist",
8+
"apiLanguage": "dotnetisolated",
9+
"apiVersion": "6.0",
10+
"appBuildCommand": "npm run build",
11+
"apiBuildCommand": "dotnet publish -c Release",
12+
"run": "npm run dev",
13+
"appDevserverUrl": "http://localhost:5173"
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)