|
| 1 | +# Deploying on Azure Container Apps |
| 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: appservice` is used and `host: containerapp` is commented out. |
| 5 | + |
| 6 | +To deploy to Azure Container Apps, please follow the following steps: |
| 7 | + |
| 8 | +1. Comment out `host: appservice` and uncomment `host: containerapp` 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 `containerapps`: |
| 26 | + |
| 27 | + ```bash |
| 28 | + azd env set DEPLOYMENT_TARGET containerapps |
| 29 | + ``` |
| 30 | + |
| 31 | +5. (Optional) This is the point where you can customize the deployment by setting other `azd1 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. |
| 41 | + |
| 42 | +## Customizing Workload Profile |
| 43 | + |
| 44 | +The default workload profile is Consumption. If you want to use a dedicated workload profile like D4, please run: |
| 45 | + |
| 46 | +```bash |
| 47 | +azd env AZURE_CONTAINER_APPS_WORKLOAD_PROFILE D4 |
| 48 | +``` |
| 49 | + |
| 50 | +For a full list of workload profiles, please check [here](https://learn.microsoft.com/azure/container-apps/workload-profiles-overview#profile-types). |
| 51 | +Please note dedicated workload profiles have a different billing model than Consumption plan. Please check [here](https://learn.microsoft.com/azure/container-apps/billing) for details. |
| 52 | + |
| 53 | +## Private endpoints |
| 54 | + |
| 55 | +Private endpoints is still in private preview for Azure Conainer Apps and not supported for now. |
0 commit comments