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
Copy file name to clipboardExpand all lines: documentation/DeploymentGuide.md
+72-57Lines changed: 72 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ This will allow the scripts to run for the current session without permanently c
31
31
Pick from the options below to see step-by-step instructions for GitHub Codespaces, VS Code Dev Containers, Local Environments, and Bicep deployments.
32
32
33
33
|[](https://codespaces.new/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)|[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)|
<summary><b>Deploy in GitHub Codespaces</b></summary>
@@ -42,7 +42,7 @@ You can run this solution using GitHub Codespaces. The button will open a web-ba
42
42
43
43
1. Open the solution accelerator (this may take several minutes):
44
44
45
-
[](https://codespaces.new/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)
45
+
[](https://codespaces.new/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)
46
46
47
47
2. Accept the default values on the create Codespaces page.
48
48
3. Open a terminal window if it is not already open.
@@ -60,7 +60,7 @@ You can run this solution in VS Code Dev Containers, which will open the project
60
60
1. Start Docker Desktop (install it if not already installed).
61
61
2. Open the project:
62
62
63
-
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)
63
+
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)
64
64
65
65
3. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
66
66
4. Continue with the [deploying steps](#deploying-with-azd).
@@ -75,17 +75,18 @@ You can run this solution in VS Code Dev Containers, which will open the project
75
75
If you're not using one of the above options for opening the project, then you'll need to:
76
76
77
77
1. Make sure the following tools are installed:
78
-
-[PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) <small>(v7.0+)</small> - available for Windows, macOS, and Linux.
-[PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) <small>(v7.0+)</small> - available for Windows, macOS, and Linux.
By default, the **GPT model capacity**in deployment is set to **30k tokens**.
118
+
By default, the **GPT model capacity** in deployment is set to **140k tokens**.
119
+
118
120
> **We recommend increasing the capacity to 100k tokens for optimal performance.**
119
121
120
122
To adjust quota settings, follow these [steps](./AzureGPTQuotaSettings.md).
@@ -129,26 +131,27 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
129
131
130
132
1. Login to Azure:
131
133
132
-
```shell
133
-
azd auth login
134
-
```
134
+
```shell
135
+
azd auth login
136
+
```
135
137
136
-
#### To authenticate with Azure Developer CLI (`azd`), use the following command with your **Tenant ID**:
138
+
#### To authenticate with Azure Developer CLI (`azd`), use the following command with your **Tenant ID**:
137
139
138
-
```sh
139
-
azd auth login --tenant-id <tenant-id>
140
-
```
140
+
```sh
141
+
azd auth login --tenant-id <tenant-id>
142
+
```
141
143
142
144
2. Provision and deploy all the resources:
143
145
144
-
```shell
145
-
azd up
146
-
```
146
+
```shell
147
+
azd up
148
+
```
147
149
148
150
3. Provide an `azd` environment name (e.g., "macaeapp").
149
-
4. Select a subscription from your Azure account and choose a location that has quota for all the resources.
150
-
- This deployment will take *4-6 minutes* to provision the resources in your account and set up the solution with sample data.
151
-
- If you encounter an error or timeout during deployment, changing the location may help, as there could be availability constraints for the resources.
151
+
4. Select a subscription from your Azure account and choose a location that has quota for all the resources.
152
+
153
+
- This deployment will take _4-6 minutes_ to provision the resources in your account and set up the solution with sample data.
154
+
- If you encounter an error or timeout during deployment, changing the location may help, as there could be availability constraints for the resources.
152
155
153
156
5. Once the deployment has completed successfully, open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the App Service, and get the app URL from `Default domain`.
154
157
@@ -161,6 +164,7 @@ If you need to rebuild the source code and push the updated container to the dep
161
164
1. Set the environment variable `USE_LOCAL_BUILD` to `True`:
162
165
163
166
-**Linux/macOS**:
167
+
164
168
```bash
165
169
export USE_LOCAL_BUILD=True
166
170
```
@@ -169,7 +173,9 @@ If you need to rebuild the source code and push the updated container to the dep
169
173
```powershell
170
174
$env:USE_LOCAL_BUILD = $true
171
175
```
176
+
172
177
2. Run the `az login`command
178
+
173
179
```bash
174
180
az login
175
181
```
@@ -195,16 +201,16 @@ The easiest way to run this accelerator is in a VS Code Dev Containers, which wi
195
201
196
202
1. Start Docker Desktop (install it if not already installed)
197
203
1. Open the project:
198
-
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)
204
+
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator)
199
205
200
206
1. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window
201
207
202
208
## Detailed Development Container setup instructions
203
209
204
210
The solution contains a [development container](https://code.visualstudio.com/docs/remote/containers) with all the required tooling to develop and deploy the accelerator. To deploy the Chat With Your Data accelerator using the provided development container you will also need:
205
211
206
-
* [Visual Studio Code](https://code.visualstudio.com)
207
-
* [Remote containers extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
212
+
- [Visual Studio Code](https://code.visualstudio.com)
213
+
- [Remote containers extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
208
214
209
215
If you are running this on Windows, we recommend you clone this repository in [WSL](https://code.visualstudio.com/docs/remote/wsl)
210
216
@@ -219,7 +225,7 @@ code .
219
225
```
220
226
221
227
!!! tip
222
-
Visual Studio Code should recognize the available development container and ask you to open the folder using it. For additional details on connecting to remote containers, please see the [Open an existing folder in a container](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container) quickstart.
228
+
Visual Studio Code should recognize the available development container and ask you to open the folder using it. For additional details on connecting to remote containers, please see the [Open an existing folder in a container](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container) quickstart.
223
229
224
230
When you start the development container for the first time, the container will be built. This usually takes a few minutes. **Please use the development container for all further steps.**
225
231
@@ -258,58 +264,67 @@ The files for the dev container are located in `/.devcontainer/` folder.
258
264
az deployment group create -g <resource-group-name> -f deploy/macae-dev.bicep --query 'properties.outputs'
259
265
```
260
266
- **Note**: You will be prompted for a `principalId`, which is the ObjectID of your user in Entra ID. To find it, use the Azure Portal or run:
267
+
261
268
```bash
262
269
az ad signed-in-user show --query id -o tsv
263
270
```
264
-
You will also be prompted for locations for Cosmos and OpenAI services. This is to allow separate regions where there may be service quota restrictions.
271
+
272
+
You will also be prompted for locations for Cosmos and OpenAI services. This is to allow separate regions where there may be service quota restrictions.
265
273
266
274
- **Additional Notes**:
267
275
268
276
**Role Assignments in Bicep Deployment:**
269
-
270
-
The **macae-dev.bicep** deployment includes the assignment of the appropriate roles to AOAI and Cosmos services. If you want to modify an existing implementation—for example, to use resources deployed as part of the simple deployment for local debugging—you will need to add your own credentials to access the Cosmos and AOAI services. You can add these permissions using the following commands:
277
+
278
+
The **macae-dev.bicep** deployment includes the assignment of the appropriate roles to AOAI and Cosmos services. If you want to modify an existing implementation—for example, to use resources deployed as part of the simple deployment for local debugging—you will need to add your own credentials to access the Cosmos and AOAI services. You can add these permissions using the following commands:
279
+
271
280
```bash
272
281
az cosmosdb sql role assignment create --resource-group <solution-accelerator-rg> --account-name <cosmos-db-account-name> --role-definition-name "Cosmos DB Built-in Data Contributor" --principal-id <aad-user-object-id> --scope /subscriptions/<subscription-id>/resourceGroups/<solution-accelerator-rg>/providers/Microsoft.DocumentDB/databaseAccounts/<cosmos-db-account-name>
273
282
```
274
283
275
284
```bash
276
285
az role assignment create --assignee <aad-user-upn> --role "Cognitive Services OpenAI User" --scope /subscriptions/<subscription-id>/resourceGroups/<solution-accelerator-rg>/providers/Microsoft.CognitiveServices/accounts/<azure-openai-account-name>
277
286
```
278
-
**Using a Different Database in Cosmos:**
279
287
280
-
You can set the solution up to use a different database in Cosmos. For example, you can name it something like macae-dev. To do this:
281
-
1. Change the environment variable **COSMOSDB_DATABASE** to the new database name.
282
-
2. You will need to create the database in the Cosmos DB account. You can do this from the Data Explorer pane in the portal, click on the drop down labeled "_+ New Container_" and provide all the necessary details.
288
+
**Using a Different Database in Cosmos:**
289
+
290
+
You can set the solution up to use a different database in Cosmos. For example, you can name it something like macae-dev. To do this:
283
291
284
-
6. **Create a `.env` file:**
292
+
1. Change the environment variable **COSMOSDB_DATABASE** to the new database name.
293
+
2. You will need to create the database in the Cosmos DB account. You can do this from the Data Explorer pane in the portal, click on the drop down labeled "_+ New Container_" and provide all the necessary details.
294
+
295
+
5. **Create a `.env` file:**
285
296
286
297
- Navigate to the `src` folder and create a `.env` file based on the provided `.env.sample` file.
287
298
288
-
7. **Fill in the `.env` file:**
299
+
6. **Fill in the `.env` file:**
289
300
290
301
- Use the output from the deployment or check the Azure Portal under "Deployments" in the resource group.
291
302
292
-
8. **(Optional) Set up a virtual environment:**
303
+
7. **(Optional) Set up a virtual environment:**
293
304
294
305
- If you are using `venv`, create and activate your virtual environment for both the frontend and backend folders.
295
306
296
-
9. **Install requirements - frontend:**
307
+
8. **Install requirements - frontend:**
297
308
298
309
- In each of the frontend and backend folders -
299
310
Open a terminal in the `src` folder and run:
300
311
```bash
301
312
pip install -r requirements.txt
302
313
```
303
314
304
-
10. **Run the application:**
305
-
- From the src/backend directory:
306
-
```bash
307
-
python app.py
308
-
```
309
-
- In a new terminal from the src/frontend directory
310
-
```bash
311
-
python frontend_server.py
312
-
```
315
+
9. **Run the application:**
316
+
317
+
- From the src/backend directory:
318
+
319
+
```bash
320
+
python app.py
321
+
```
322
+
323
+
- In a new terminal from the src/frontend directory
324
+
325
+
```bash
326
+
python frontend_server.py
327
+
```
313
328
314
329
10. Open a browser and navigate to `http://localhost:3000`
315
330
11. To see swagger API documentation, you can navigate to `http://localhost:8000/docs`
@@ -329,6 +344,7 @@ You can debug the API backend running locally with VSCode using the following la
329
344
"jinja": true
330
345
}
331
346
```
347
+
332
348
To debug the python server in the frontend directory (frontend_server.py) and related, add the following launch.json entry:
333
349
334
350
```
@@ -342,4 +358,3 @@ To debug the python server in the frontend directory (frontend_server.py) and re
0 commit comments