You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=599293758&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
4
28
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/azure-search-openai-demo)
5
29
@@ -19,11 +43,13 @@ The repo includes sample data so it's ready to try end to end. In this sample ap
19
43
20
44

21
45
22
-
## Getting Started
46
+
## Getting started
23
47
24
48
> **IMPORTANT:** In order to deploy and run this example, you'll need an **Azure subscription with access enabled for the Azure OpenAI service**. You can request access [here](https://aka.ms/oaiapply). You can also visit [here](https://azure.microsoft.com/free/cognitive-search/) to get some free Azure credits to get you started.
25
49
26
-
## Azure Deployment Costs
50
+
## Azure deployment
51
+
52
+
### Cost estimation
27
53
28
54
Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage.
29
55
However, you can try the [Azure pricing calculator](https://azure.com/e/8ffbe5b1919c4c72aed89b022294df76) for the resources below.
@@ -42,7 +68,7 @@ either by deleting the resource group in the Portal or running `azd down`.
@@ -62,16 +88,14 @@ You can run this repo virtually by using GitHub Codespaces or VS Code Remote Con
62
88
[](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=599293758&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
63
89
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/azure-search-openai-demo)
64
90
65
-
### Installation
66
-
67
-
#### Project Initialization
91
+
### Project initialization
68
92
69
93
1. Create a new folder and switch to it in the terminal
70
94
1. Run `azd auth login`
71
95
1. Run `azd init -t azure-search-openai-demo`
72
96
* note that this command will initialize a git repository and you do not need to clone this repository
73
97
74
-
#### Starting from scratch
98
+
###Deploying from scratch
75
99
76
100
Execute the following command, if you don't have any pre-existing Azure services and want to start from a fresh deployment.
77
101
@@ -85,7 +109,7 @@ It will look like the following:
85
109
86
110
> NOTE: It may take a minute for the application to be fully deployed. If you see a "Python Developer" welcome screen, then wait a minute and refresh the page.
87
111
88
-
#### Using existing resources
112
+
###Deploying with existing resources
89
113
90
114
1. Run `azd env set AZURE_OPENAI_SERVICE {Name of existing OpenAI service}`
91
115
1. Run `azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group that OpenAI service is provisioned to}`
@@ -95,7 +119,7 @@ It will look like the following:
95
119
96
120
> NOTE: You can also use existing Search and Storage Accounts. See `./infra/main.parameters.json` for list of environment variables to pass to `azd env set` to configure those existing resources.
97
121
98
-
####Deploying again
122
+
### Deploying again
99
123
100
124
If you've only changed the backend/frontend code in the `app` folder, then you don't need to re-provision the Azure resources. You can just run:
101
125
@@ -105,13 +129,8 @@ If you've changed the infrastructure files (`infra` folder or `azure.yaml`), the
105
129
106
130
```azd up```
107
131
108
-
#### Running locally
109
-
110
-
1. Run `azd login`
111
-
2. Change dir to `app`
112
-
3. Run `./start.ps1` or `./start.sh` or run the "VS Code Task: Start App" to start the project locally.
113
132
114
-
####Sharing Environments
133
+
## Sharing environments
115
134
116
135
To give someone else access to a completely deployed and existing environment,
117
136
either you or they can follow these steps:
@@ -123,7 +142,9 @@ either you or they can follow these steps:
123
142
1. Set the environment variable `AZURE_PRINCIPAL_ID` either in that `.env` file or in the active shell to their Azure ID, which they can get with `az ad signed-in-user show`.
124
143
1. Run `./scripts/roles.ps1` or `.scripts/roles.sh` to assign all of the necessary roles to the user. If they do not have the necessary permission to create roles in the subscription, then you may need to run this script for them. Once the script runs, they should be able to run the app locally.
125
144
126
-
#### Enabling Application Insights
145
+
## Enabling optional features
146
+
147
+
### Enabling Application Insights
127
148
128
149
To enable Application Insights and the tracing of each request, along with the logging of errors, set the `AZURE_USE_APPLICATION_INSIGHTS` variable to true before running `azd up`
129
150
@@ -137,7 +158,21 @@ To inspect the performance of chat requests, use the "Drill into Samples" button
137
158
138
159
To see any exceptions and server errors, navigate to the "Investigate -> Failures" blade and use the filtering tools to locate a specific exception. You can see Python stack traces on the right-hand side.
139
160
140
-
### Quickstart
161
+
### Enabling authentication
162
+
163
+
By default, the deployed Azure web app will have no authentication or access restrictions enabled, meaning anyone with routable network access to the web app can chat with your indexed data. You can require authentication to your Azure Active Directory by following the [Add app authentication](https://learn.microsoft.com/azure/app-service/scenario-secure-app-authentication-app-service) tutorial and set it up against the deployed web app.
164
+
165
+
To then limit access to a specific set of users or groups, you can follow the steps from [Restrict your Azure AD app to a set of users](https://learn.microsoft.com/azure/active-directory/develop/howto-restrict-your-app-to-a-set-of-users) by changing "Assignment Required?" option under the Enterprise Application, and then assigning users/groups access. Users not granted explicit access will receive the error message -AADSTS50105: Your administrator has configured the application <app_name> to block users unless they are specifically granted ('assigned') access to the application.-
166
+
167
+
## Running locally
168
+
169
+
You can only run locally **after** having successfully run the `azd up` command.
170
+
171
+
1. Run `azd auth login`
172
+
2. Change dir to `app`
173
+
3. Run `./start.ps1` or `./start.sh` or run the "VS Code Task: Start App" to start the project locally.
174
+
175
+
## Using the app
141
176
142
177
* In Azure: navigate to the Azure WebApp deployed by azd. The URL is printed out when azd completes (as "Endpoint"), or you can find it in the Azure portal.
143
178
* Running locally: navigate to 127.0.0.1:50505
@@ -148,11 +183,6 @@ Once in the web app:
148
183
* Explore citations and sources
149
184
* Click on "settings" to try different options, tweak prompts, etc.
150
185
151
-
### Enabling authentication
152
-
By default, the deployed Azure web app will have no authentication or access restrictions enabled, meaning anyone with routable network access to the web app can chat with your indexed data. You can require authentication to your Azure Active Directory by following the [Add app authentication](https://learn.microsoft.com/azure/app-service/scenario-secure-app-authentication-app-service) tutorial and set it up against the deployed web app.
153
-
154
-
To then limit access to a specific set of users or groups, you can follow the steps from [Restrict your Azure AD app to a set of users](https://learn.microsoft.com/azure/active-directory/develop/howto-restrict-your-app-to-a-set-of-users) by changing "Assignment Required?" option under the Enterprise Application, and then assigning users/groups access. Users not granted explicit access will receive the error message -AADSTS50105: Your administrator has configured the application <app_name> to block users unless they are specifically granted ('assigned') access to the application.-
155
-
156
186
## Resources
157
187
158
188
*[Revolutionize your Enterprise Data with ChatGPT: Next-gen Apps w/ Azure OpenAI and Cognitive Search](https://aka.ms/entgptsearchblog)
0 commit comments