Skip to content

Commit e34edd5

Browse files
authored
Switch to ACA by default (#2092)
1 parent 0946893 commit e34edd5

File tree

6 files changed

+58
-12
lines changed

6 files changed

+58
-12
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ The repo includes sample data so it's ready to try end to end. In this sample ap
6565
Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage.
6666
However, you can try the [Azure pricing calculator](https://azure.com/e/a87a169b256e43c089015fda8182ca87) for the resources below.
6767

68-
- Azure App Service: Basic Tier with 1 CPU core, 1.75 GB RAM. Pricing per hour. [Pricing](https://azure.microsoft.com/pricing/details/app-service/linux/)
69-
- Azure Container Apps: Only provisioned if you deploy to Azure Container Apps following [the ACA deployment guide](docs/azure_container_apps.md). Consumption plan with 1 CPU core, 2.0 GB RAM. Pricing with Pay-as-You-Go. [Pricing](https://azure.microsoft.com/pricing/details/container-apps/)
68+
- Azure Container Apps: Default host for app deployment as of 10/28/2024. See more details in [the ACA deployment guide](docs/azure_container_apps.md). Consumption plan with 1 CPU core, 2.0 GB RAM. Pricing with Pay-as-You-Go. [Pricing](https://azure.microsoft.com/pricing/details/container-apps/)
69+
- Azure App Service: Only provisioned if you deploy to Azure App Service following [the App Service deployment guide](docs/azure_app_service.md). Basic Tier with 1 CPU core, 1.75 GB RAM. Pricing per hour. [Pricing](https://azure.microsoft.com/pricing/details/app-service/linux/)
7070
- Azure OpenAI: Standard tier, GPT and Ada models. Pricing per 1K tokens used, and at least 1K tokens are used per question. [Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/)
7171
- Azure AI Document Intelligence: SO (Standard) tier using pre-built layout. Pricing per document page, sample documents have 261 pages total. [Pricing](https://azure.microsoft.com/pricing/details/form-recognizer/)
7272
- Azure AI Search: Basic tier, 1 replica, free level of semantic search. Pricing per hour. [Pricing](https://azure.microsoft.com/pricing/details/search/)
@@ -127,7 +127,7 @@ A related option is VS Code Dev Containers, which will open the project in your
127127

128128
## Deploying
129129

130-
The steps below will provision Azure resources and deploy the application code to Azure App Service. To deploy to Azure Container Apps instead, follow [the container apps deployment guide](docs/azure_container_apps.md).
130+
The steps below will provision Azure resources and deploy the application code to Azure Container Apps. To deploy to Azure App Service instead, follow [the app service deployment guide](docs/azure_app_service.md).
131131

132132
1. Login to your Azure account:
133133

@@ -136,6 +136,7 @@ The steps below will provision Azure resources and deploy the application code t
136136
```
137137

138138
For GitHub Codespaces users, if the previous command fails, try:
139+
139140
```shell
140141
azd auth login --use-device-code
141142
```
@@ -157,7 +158,7 @@ It will look like the following:
157158

158159
!['Output from running azd up'](docs/images/endpoint.png)
159160

160-
> NOTE: It may take 5-10 minutes after you see 'SUCCESS' for the application to be fully deployed. If you see a "Python Developer" welcome screen or an error page, then wait a bit and refresh the page. See [guide on debugging App Service deployments](docs/appservice.md).
161+
> NOTE: It may take 5-10 minutes after you see 'SUCCESS' for the application to be fully deployed. If you see a "Python Developer" welcome screen or an error page, then wait a bit and refresh the page.
161162

162163
### Deploying again
163164

@@ -261,7 +262,7 @@ Here are the most common failure scenarios and solutions:
261262
262263
1. You see `CERTIFICATE_VERIFY_FAILED` when the `prepdocs.py` script runs. That's typically due to incorrect SSL certificates setup on your machine. Try the suggestions in this [StackOverflow answer](https://stackoverflow.com/questions/35569042/ssl-certificate-verify-failed-with-python3/43855394#43855394).
263264

264-
1. After running `azd up` and visiting the website, you see a '404 Not Found' in the browser. Wait 10 minutes and try again, as it might be still starting up. Then try running `azd deploy` and wait again. If you still encounter errors with the deployed app, consult the [guide on debugging App Service deployments](docs/appservice.md). Please file an issue if the logs don't help you resolve the error.
265+
1. After running `azd up` and visiting the website, you see a '404 Not Found' in the browser. Wait 10 minutes and try again, as it might be still starting up. Then try running `azd deploy` and wait again. If you still encounter errors with the deployed app and are deploying to App Service, consult the [guide on debugging App Service deployments](docs/appservice.md). Please file an issue if the logs don't help you resolve the error.
265266
266267
### Resources
267268

azure.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ services:
88
project: ./app/backend
99
language: py
1010
# Please check docs/azure_container_apps.md for more information on how to deploy to Azure Container Apps
11-
# host: containerapp
12-
# docker:
13-
# remoteBuild: true
14-
host: appservice
11+
host: containerapp
12+
docker:
13+
remoteBuild: true
14+
# Please check docs/azure_app_service.md for more information on how to deploy to Azure App Service
15+
# host: appservice
1516
hooks:
1617
# This hook is called when App Service is the host
1718
prepackage:

docs/azure_app_service.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Deploying on Azure App Service
2+
3+
Due to [a limitation](https://github.com/Azure/azure-dev/issues/2736) of the Azure Developer CLI (`azd`), there can be only one host option in the [azure.yaml](../azure.yaml) file.
4+
By default, `host: containerapp` is used and `host: appservice` is commented out.
5+
6+
To deploy to Azure Container Apps, please follow the following steps:
7+
8+
1. Comment out `host: containerapp` and uncomment `host: appservice` in the [azure.yaml](../azure.yaml) file.
9+
10+
2. Login to your Azure account:
11+
12+
```bash
13+
azd auth login
14+
```
15+
16+
3. Create a new `azd` environment to store the deployment parameters:
17+
18+
```bash
19+
azd env new
20+
```
21+
22+
Enter a name that will be used for the resource group.
23+
This will create a new folder in the `.azure` folder, and set it as the active environment for any calls to `azd` going forward.
24+
25+
4. Set the deployment target to `appservice`:
26+
27+
```bash
28+
azd env set DEPLOYMENT_TARGET appservice
29+
```
30+
31+
5. (Optional) This is the point where you can customize the deployment by setting other `azd` environment variables, in order to [use existing resources](docs/deploy_existing.md), [enable optional features (such as auth or vision)](docs/deploy_features.md), or [deploy to free tiers](docs/deploy_lowcost.md).
32+
6. Provision the resources and deploy the code:
33+
34+
```bash
35+
azd up
36+
```
37+
38+
This will provision Azure resources and deploy this sample to those resources, including building the search index based on the files found in the `./data` folder.
39+
40+
**Important**: Beware that the resources created by this command will incur immediate costs, primarily from the AI Search resource. These resources may accrue costs even if you interrupt the command before it is fully executed. You can run `azd down` or delete the resources manually to avoid unnecessary spending.

docs/azure_container_apps.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Deploying on Azure Container Apps
22

33
Due to [a limitation](https://github.com/Azure/azure-dev/issues/2736) of the Azure Developer CLI (`azd`), there can be only one host option in the [azure.yaml](../azure.yaml) file.
4-
By default, `host: appservice` is used and `host: containerapp` is commented out.
4+
By default, `host: containerapp` is used and `host: appservice` is commented out.
5+
6+
However, if you have an older version of the repo, you may need to follow these steps to deploy to Container Apps instead, or you can stick with Azure App Service.
57

68
To deploy to Azure Container Apps, please follow the following steps:
79

@@ -52,4 +54,4 @@ Please note dedicated workload profiles have a different billing model than Cons
5254

5355
## Private endpoints
5456

55-
Private endpoints is still in private preview for Azure Conainer Apps and not supported for now.
57+
Private endpoints is still in private preview for Azure Container Apps and not supported for now.

docs/deploy_private.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
# Deploying with private access
33

4+
⚠️ This feature is not yet compatible with Azure Container Apps, so you will need to [deploy to Azure App Service](./azure_app_service.md) instead.
5+
46
If you want to disable public access when deploying the Chat App, you can do so by setting `azd` environment values.
57

68
## Before you begin

infra/main.parameters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
"value": "${TF_BUILD}"
262262
},
263263
"deploymentTarget": {
264-
"value": "${DEPLOYMENT_TARGET=appservice}"
264+
"value": "${DEPLOYMENT_TARGET=containerapps}"
265265
},
266266
"webAppExists": {
267267
"value": "${SERVICE_WEB_RESOURCE_EXISTS=false}"

0 commit comments

Comments
 (0)