Skip to content

Commit c0dd2f2

Browse files
committed
new aca HLA diagram and readme
1 parent b310441 commit c0dd2f2

File tree

6 files changed

+443
-6
lines changed

6 files changed

+443
-6
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ It demonstrates best practices for creating ChatGPT-like experiences over your o
3131

3232
This repository 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.
3333

34+
> [!NOTE]
35+
> This sample supports different architectural styles. It can be deployed as standalone app on top of Azure App Service or as a microservice event driven architecture hosted by Azure Container Apps. This page refers to the Azure App Service deployment. For Azure Container Apps deployment, see [here](docs/aca/README-ACA.md).
36+
37+
3438
## TL;DR
3539

3640
Open the project:
@@ -41,6 +45,7 @@ Open the project:
4145
Open the terminal and run:
4246

4347
```shell
48+
cd deploy/app-service
4449
azd auth login
4550
azd up
4651
```
@@ -115,9 +120,6 @@ All prerequisites are already installed in the container. You can skip to the [
115120
* [Java 17](https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-17)
116121
* [Maven 3.8.x](https://maven.apache.org/download.cgi)
117122
* [Azure Developer CLI](https://aka.ms/azure-dev/install)
118-
* [Python 3+](https://www.python.org/downloads/)
119-
* **Important**: Python and the pip package manager must be in the path in Windows for the setup scripts to work.
120-
* **Important**: Ensure you can run `python --version` from console. On Ubuntu, you might need to run `sudo apt install python-is-python3` to link `python` to `python3`.
121123
* [Node.js](https://nodejs.org/en/download/)
122124
* [Git](https://git-scm.com/downloads)
123125
* [Powershell 7+ (pwsh)](https://github.com/powershell/powershell) - For Windows users only.
@@ -132,6 +134,9 @@ You can clone this repo and change directory to the root of the repo. Or you can
132134

133135
Once you have the project available locally, run the following commands if you don't have any pre-existing Azure services and want to start from a fresh deployment.
134136

137+
> [!IMPORTANT]
138+
> All the commands below assume be run from the `deploy/app-service` folder
139+
135140
1. Run
136141

137142
```shell
@@ -360,7 +365,7 @@ The repository includes sample pdf documents in the data folder. They are ingest
360365
361366
If you want to chat with your custom documents you can:
362367
1. Add your pdf documents in the [data folder](./data).
363-
2. Open a terminal and cd to repo root folder. Example `cd path/to/your/custom/dir/azure-search-openai-demo-java`
368+
2. Open a terminal and cd to repo root folder for app service deployment. Example `cd path/to/your/custom/dir/azure-search-openai-demo-java/deploy/app-service`
364369
3. Run `./scripts/prepdocs.ps1` if you are on windows or `./scripts/prepdocs.sh` on linux
365370
4. Wait the script to complete. This is not a 'delta' process, it's not updating **only** the new files you've added. Instead, on each run, all documents in data folder will be ingested. Feel free to add new files you want to ingest and delete/move the old documents from the data folder. Once you've run the script and it completes successfully, Azure AI Search index has been updated and stored (until you want to manually delete it from your azure Azure AI Search instance)
366371
5. if ingestion and indexing is completed successfully you should see a message like this
@@ -414,7 +419,7 @@ However, you can try the [Azure pricing calculator](https://azure.com/e/8ffbe5b1
414419
- Azure Blob Storage: Standard tier with ZRS (Zone-redundant storage). Pricing per storage and read operations. [Pricing](https://azure.microsoft.com/pricing/details/storage/blobs/)
415420
- Azure Monitor: Pay-as-you-go tier. Costs based on data ingested. [Pricing](https://azure.microsoft.com/pricing/details/monitor/)
416421

417-
To reduce costs, you can switch to free SKUs for Azure App Service and Form Recognizer by changing the parameters file under the `infra` folder. There are some limits to consider; for example, the free Form Recognizer resource only analyzes the first 2 pages of each document. You can also reduce costs associated with the Form Recognizer by reducing the number of documents in the `data` folder, or by removing the postprovision hook in `azure.yaml` that runs the `prepdocs.py` script.
422+
To reduce costs, you can switch to free SKUs for Azure App Service and Form Recognizer by changing the parameters file under the `infra` folder. There are some limits to consider; for example, the free Form Recognizer resource only analyzes the first 2 pages of each document. You can also reduce costs associated with the Form Recognizer by reducing the number of documents in the `data` folder, or by removing the postprovision hook in `azure.yaml` that runs the `indexer java cli`.
418423

419424
⚠️ To avoid unnecessary costs, remember to take down your app if it's no longer in use,
420425
either by deleting the resource group in the Portal or running `azd down`.

deploy/aca/azure.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ services:
1414
host: containerapp
1515
docker:
1616
path: ./microservice/Dockerfile
17-
1817
web:
1918
project: ../../app/frontend
2019
language: js

deploy/aca/scripts/roles.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ done <<< "$output"
88

99
echo "Environment variables set."
1010

11+
1112
roles=(
1213
"5e0bd9bd-7b93-4f28-af87-19fc36ad61bd"
1314
"2a2b9908-6ea1-4ae2-8e65-a410df84e7d1"

deploy/shared/host/container-apps-environment.bicep

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,43 @@ param daprEnabled bool = false
1212
@description('Name of the Log Analytics workspace')
1313
param logAnalyticsWorkspaceName string
1414

15+
@description('Optional, default value is false. Sets if the environment will use availability zones. Your Container App Environment and the apps in it will be zone redundant. This requieres vNet integration.')
16+
param zoneRedundant bool = false
17+
18+
@description('Optional, the workload profiles required by the end user. The default is "Consumption", and is automatically added whether workload profiles are specified or not.')
19+
param workloadProfiles array = []
20+
// Example of a workload profile below:
21+
// [ {
22+
// workloadProfileType: 'D4' // available types can be found here: https://learn.microsoft.com/en-us/azure/container-apps/workload-profiles-overview#profile-types
23+
// name: '<name of the workload profile>'
24+
// minimumCount: 1
25+
// maximumCount: 3
26+
// }
27+
// ]
28+
29+
var defaultWorkloadProfile = [
30+
{
31+
workloadProfileType: 'Consumption'
32+
name: 'Consumption'
33+
}
34+
]
35+
36+
var effectiveWorkloadProfiles = workloadProfiles != [] ? concat(defaultWorkloadProfile, workloadProfiles) : defaultWorkloadProfile
37+
1538
resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-04-01-preview' = {
1639
name: name
1740
location: location
1841
tags: tags
1942
properties: {
43+
zoneRedundant: zoneRedundant
2044
appLogsConfiguration: {
2145
destination: 'log-analytics'
2246
logAnalyticsConfiguration: {
2347
customerId: logAnalyticsWorkspace.properties.customerId
2448
sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey
2549
}
2650
}
51+
workloadProfiles: effectiveWorkloadProfiles
2752
daprAIInstrumentationKey: daprEnabled && !empty(applicationInsightsName) ? applicationInsights.properties.InstrumentationKey : ''
2853
}
2954
}

0 commit comments

Comments
 (0)