Skip to content

Commit 2f456cc

Browse files
committed
add Anthony's input
1 parent 09b46d5 commit 2f456cc

File tree

1 file changed

+27
-31
lines changed

1 file changed

+27
-31
lines changed

articles/container-apps/containerapp-up.md

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ The `up` command can create or use existing resources including:
2828
- Resource group
2929
- Azure Container Registry
3030
- Container Apps environment and Log Analytics workspace
31+
- the container app
3132

32-
The command can build and push a container image to an Azure Container Registry (ACR) when you provide local source code or a GitHub repo. When you're working from a GitHub repo, it creates a GitHub Action that automatically builds and pushes a new container image when you commit changes to your GitHub repo.
33+
The command can build and push a container image to an Azure Container Registry (ACR) when you provide local source code or a GitHub repo. When you're working from a GitHub repo, it creates a GitHub Actions workflow that automatically builds and pushes a new container image when you commit changes to your GitHub repo.
3334

34-
If you need to customize the Container App environment, first create the environment using the `az containerapp env create` command. If you don't provide an existing environment, the `up` command looks for one in your resource group and, if found, uses that environment. If not found, it creates an environment with a Log Analytics workspace.
35+
If you need to customize the Container Apps environment, first create the environment using the `az containerapp env create` command. If you don't provide an existing environment, the `up` command looks for one in your resource group and, if found, uses that environment. If not found, it creates an environment with a Log Analytics workspace.
3536

3637
To learn more about the `az containerapp up` command and its options, see [`az containerapp up`](/cli/azure/containerapp#az_containerapp_up).
3738

@@ -42,14 +43,13 @@ To learn more about the `az containerapp up` command and its options, see [`az c
4243
| Azure account | If you don't have one, [create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). You need the *Contributor* or *Owner* permission on the Azure subscription to proceed. Refer to [Assign Azure roles using the Azure portal](../role-based-access-control/role-assignments-portal.md?tabs=current) for details. |
4344
| GitHub Account | If you use a GitHub repo, sign up for [free](https://github.com/join). |
4445
| Azure CLI | Install the [Azure CLI](/cli/azure/install-azure-cli).|
45-
| Docker Desktop | If you're using local source code with a Dockerfile, you'll need to install Docker Desktop. Docker provides installers that configure the Docker environment on [macOS](https://docs.docker.com/docker-for-mac/), [Windows](https://docs.docker.com/docker-for-windows/), and [Linux](https://docs.docker.com/engine/installation/#supported-platforms). After installation, type `docker` from your command prompt to ensure Docker is running. |
4646
|Local source code | You need to have a local source code directory if you use local source code. |
4747
| Existing Image | If you use an existing image, you'll need your registry server, image name, and tag. If you're using a private registry, you'll need your credentials. |
4848

4949
## Set up
5050

5151
1. Log in to Azure with the Azure CLI.
52-
52+
5353
```azurecli
5454
az login
5555
```
@@ -61,21 +61,19 @@ To learn more about the `az containerapp up` command and its options, see [`az c
6161
6262
1. Now that the current extension or module is installed, register the `Microsoft.App` namespace.
6363
64-
6564
```azurecli
6665
az provider register --namespace Microsoft.App
6766
```
6867
6968
1. Register the `Microsoft.OperationalInsights` provider for the Azure Monitor Log Analytics workspace.
7069
71-
7270
```azurecli
7371
az provider register --namespace Microsoft.OperationalInsights
7472
```
7573
7674
## Deploy from an existing image
7775
78-
You can deploy a container app that uses an existing image in a public or private container registry.
76+
You can deploy a container app that uses an existing image in a public or private container registry. If you are deploying from a private registry, you'll need to provide your credentials using the `registry-server`, `--registry-username`, and `--registry-password` options.
7977
8078
In this example, the `az containerapp up` command performs the following actions:
8179
@@ -110,9 +108,14 @@ az containerapp up \
110108

111109
When you use the `up` command to deploy from a local source, it builds the container image, pushes it to a registry, and deploys the container app. It creates the registry in Azure Container Registry if you don't provide one.
112110

113-
The command can build the image with or without a Dockerfile. If building without a Dockerfile, there are two requirements:
111+
The command can build the image with or without a Dockerfile. If building without a Dockerfile the following languages are supported:
114112

115-
TODO: What are the requirements?
113+
- .NET
114+
- Node.js
115+
- PHP
116+
- Python
117+
- Ruby
118+
- Go
116119

117120
The following example shows how to deploy a container app from local source code.
118121

@@ -125,26 +128,22 @@ In the example, the `az containerapp up` command performs the following actions:
125128
1. Pushes the image to the registry.
126129
1. Creates and deploys the container app.
127130

128-
Follow these steps to deploy a container app from local source code:
129-
130-
1. Change to the directory containing your source code and, optionally, your Dockerfile, for the container image.
131+
Run the following command to deploy a container app from local source code:
131132

132-
TODO: Since they're specifying the source directory in the command, do they need to be in the source directory? And if they are in the source directory, do they need to specify the source directory in the command?
133-
134-
1. Run the following command:
135-
136-
```azurecli
133+
```azurecli
137134
az containerapp up \
138135
--name <CONTAINER_APP_NAME> \
139-
--source <SOURCE_DIRECTORY>
136+
--source <SOURCE_DIRECTORY>\
137+
--ingress external
138+
```
140139

141-
When the Dockerfile includes the EXPOSE instruction, the `up` command configures the container app's ingress and target port using the information in the Dockerfile.
140+
When the Dockerfile includes the EXPOSE instruction, the `up` command configures the container app's ingress and target port using the information in the Dockerfile.
142141

143-
The output of the command includes the URL for the container app.
142+
If you've configured ingress through your Dockerfile or your app doesn't require ingress, you can omit the `ingress` option.
144143

145-
If there's a failure, you can run the command again with the `--debug` option to get more information about the failure.
144+
The output of the command includes the URL for the container app.
146145

147-
TODO: What do we want to say if there's a failure?
146+
If there's a failure, you can run the command again with the `--debug` option to get more information about the failure. If the build fails without a Dockerfile, you can try adding a Dockerfile and running the command again.
148147

149148
To use the `az containerapp up` command to redeploy your container app with an updated image, include the `--resource-group` and `--environment` arguments. The following example shows how to redeploy a container app from local source code.
150149

@@ -161,16 +160,10 @@ To use the `az containerapp up` command to redeploy your container app with an u
161160
162161
## Deploy from a GitHub repository
163162
164-
When you use the `az containerapp up` command to deploy from a GitHub repository, it builds the container image, pushes it to a registry, and deploys the container app. The command creates the registry in Azure Container Registry if you don't provide one.
163+
When you use the `az containerapp up` command to deploy from a GitHub repository, it generates a GitHub Actions workflow that builds the container image, pushes it to a registry, and deploys the container app. The command creates the registry in Azure Container Registry if you don't provide one.
165164
166-
When your repository contains a Dockerfile, the `up` command builds the image using the Dockerfile. When the Dockerfile includes the EXPOSE instruction, the command configures the container app's ingress and target port using the information in the Dockerfile.
165+
A Dockerfile is required to build the image. When the Dockerfile includes the EXPOSE instruction, the command configures the container app's ingress and target port using the information in the Dockerfile.
167166
168-
The `up` command can also build the image without a Dockerfile. If building without a Dockerfile, there are two requirements:
169-
170-
TODO: What are the requirements?
171-
172-
The command will create a GitHub Actions workflow that builds the image and deploys the container app when changes are pushed to the repository.
173-
174167
The following example shows how to deploy a container app from a GitHub repository.
175168
176169
In the example, the `az containerapp up` command performs the following actions:
@@ -188,9 +181,12 @@ To deploy an app from a GitHub repository, run the following command:
188181
```azurecli
189182
az containerapp up \
190183
--name <CONTAINER_APP_NAME> \
191-
--repo <GitHub repository URL>
184+
--repo <GitHub repository URL> \
185+
--ingress external
192186
```
193187

188+
If you've configured ingress through your Dockerfile or your app doesn't require ingress, you can omit the `ingress` option.
189+
194190
Because the `up` command creates a GitHub Actions workflow, rerunning it to deploy changes to your app's image will have the unwanted effect of creating multiple workflows. Instead, push changes to your GitHub repository, and the GitHub workflow will automatically build and deploy your app. To change the workflow, edit the workflow file in GitHub.
195191

196192
## Next steps

0 commit comments

Comments
 (0)