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
|`imageToDeploy`| Yes (for this scenario) | The name of the image that has already been pushed to a registry and will be deployed to the Container App by this task. If this image is found in an ACR instance that requires authentication to pull, the `acrName` argument, or the `acrUsername` and `acrPassword` arguments, can be provided to authenticate requests to the ACR instance. |
155
158
159
+
### Arguments required for using a YAML configuration file
|`yamlConfigPath`| Yes (for this scenario) | Full path (on the executing Azure Pipelines agent) to the YAML file detailing the configuration of the Container App. |
164
+
165
+
#### Important notes on the YAML configuration file
166
+
167
+
The `resourceGroup` property in the YAML configuration file _will not_ be used; the value for this either comes from
168
+
the `resourceGroup` argument provided to the task, or the default resource group name generated by the task. All other
169
+
properties provided in the YAML configuration file will override the values provided as arguments to this task; for
170
+
example, if the `containerAppName` argument is provided to the task, and the `name` property is set in the YAML
171
+
configuration file, the `name` property in the YAML file will be used when creating or updating the Container App.
172
+
173
+
Image and application source arguments (_e.g._, `appSourcePath`, `imageToDeploy`) will still be used to first build
174
+
and/or push an image that is used by the Container App; in this case, the provided YAML configuration file will need to
175
+
reference the image specified by `imageToDeploy` (or `imageToBuild`, depending on your scenario).
176
+
177
+
When creating a new Container App, all properties listed in the YAML configuration file (except `resourceGroup` as
178
+
mentioned above) will be set when the Container App is created. When updating an existing Container App, only the
179
+
properties listed in the file will be updated on the Container App.
180
+
181
+
Currently, the YAML file does not support setting up managed identity authentication for the container registry used;
depending on your scenario. For more information on the intended behavior when the YAML configuration file is provided,
190
+
please see the documents linked for the corresponding commands.
191
+
192
+
For more information on the structure of the YAML configuration file, please visit [this site](https://aka.ms/azure-container-apps-yaml).
193
+
156
194
### Additional arguments
157
195
158
196
| Argument name | Required | Description |
@@ -161,14 +199,15 @@ need to be provided in order for this task to successfully run using one of the
161
199
|`acrUsername`| No | The username used to authenticate push requests to the provided Azure Container Registry. If not provided, an access token will be generated via "az acr login" and provided to "docker login" to authenticate the requests. |
162
200
|`acrPassword`| No | The password used to authenticate push requests to the provided Azure Container Registry. If not provided, an access token will be generated via "az acr login" and provided to "docker login" to authenticate the requests. |
163
201
|`dockerfilePath`| No | Relative path (_without file prefixes, see example below_) to the Dockerfile in the provided application source that should be used to build the image that is then pushed to ACR and deployed to the Container App. If not provided, this task will check if there is a file named `Dockerfile` in the provided application source and use that to build the image. Otherwise, the Oryx++ Builder will be used to create the image. |
164
-
|`imageToBuild`| No | The custom name of the image that is to be built, pushed to ACR and deployed to the Container App by this task. _Note_: this image name should include the ACR server; _e.g._, `<acr-name>.azurecr.io/<repo>:<tag>`. If this argument is not provided, a default image name will be constructed in the form `<acr-name>.azurecr.io/ado-task/container-app:<build-id>.<build-number>`|
202
+
|`imageToBuild`| No | The custom name of the image that is to be built, pushed to ACR and deployed to the Container App by this task. _Note_: this image name should include the ACR server; _e.g._, `<acr-name>.azurecr.io/<repo>:<tag>`. If this argument is not provided, a default image name will be constructed in the form of `<acr-name>.azurecr.io/ado-task/container-app:<build-id>.<build-number>`|
165
203
|`containerAppName`| No | The name of the Container App that will be created or updated. If not provided, this value will be `ado-task-app-<build-id>-<build-number>`. |
166
-
|`resourceGroup`| No | The resource group that the Container App will be created in, or currently exists in. If not provided, this value will be `<container-app-name>-rg`. |
167
-
|`containerAppEnvironment`| No | The name of the Container App environment to use with the application. If not provided, an existing environment in the resource group of the Container App will be used, otherwise, an environment will be created in the formation`<container-app-name>-env`. |
168
-
|`runtimeStack`| No | The platform version stack used in the final runnable application image that is deployed to the Container App. The value should be provided in the formation`<platform>:<version>`. If not provided, this value is determined by Oryx based on the contents of the provided application. Please refer to [this document](https://github.com/microsoft/Oryx/blob/main/doc/supportedRuntimeVersions.md) for more information on supported runtime stacks for Oryx. |
169
-
|`targetPort`| No | The target port that the Container App will listen on. If not provided, this value will be "80" for Python applications and "8080" for all other supported platforms. |
204
+
|`resourceGroup`| No | The existing resource group that the Azure Container App will be created in. If not provided, this value will be `<container-app-name>-rg` and its existence will first be checked before attempting to create it. |
205
+
|`containerAppEnvironment`| No | The name of the Container App environment to use with the application. If not provided, an existing environment in the resource group of the Container App will be used, otherwise, an environment will be created in the form of`<container-app-name>-env`. |
206
+
|`runtimeStack`| No | The platform version stack used in the final runnable application image that is deployed to the Container App. The value should be provided in the form of`<platform>:<version>`. If not provided, this value is determined by Oryx based on the contents of the provided application. Please refer to [this document](https://github.com/microsoft/Oryx/blob/main/doc/supportedRuntimeVersions.md) for more information on supported runtime stacks for Oryx. |
207
+
|`targetPort`| No | The designated port for the application to run on. If no value is provided and the builder is used to build the runnable application image, the target port will be set to 80 for Python applications and 8080 for all other platform applications. If no value is provided when creating a Container App, the target port will default to 80. Note: when using this task to update a Container App, the target port may be updated if not provided based on changes to the ingress property. |
170
208
|`location`| No | The location that the Container App (and other created resources) will be deployed to. To view locations suitable for creating the Container App in, please run the following: `az provider show -n Microsoft.App --query "resourceTypes[?resourceType=='containerApps'].locations"`|
171
209
|`environmentVariables`| No | A list of environment variable(s) for the container. Space-separated values in 'key=value' format. Empty string to clear existing values. Prefix value with 'secretref:' to reference a secret. |
210
+
|`ingress`| No | Possible options: external, internal, disabled. If set to `external` (default value if not provided when creating a Container App), the Container App will be visible from the internet or a VNET, depending on the app environment endpoint configured. If set to `internal`, the Container App will be visible from within the app environment only. If set to `disabled`, ingress will be disabled for this Container App and will not have an HTTP or TCP endpoint. |
172
211
|`disableTelemetry`| No | If set to `true`, no telemetry will be collected by this Azure DevOps Task. If set to `false`, or if this argument is not provided, telemetry will be sent to Microsoft about the Container App build and deploy scenario targeted by this Azure DevOps Task. |
173
212
174
213
## Usage
@@ -209,6 +248,42 @@ This will create a new Container App named `ado-task-app-<build-id>-<build-numbe
209
248
`<container-app-name>-rg`where **no new image is built**, but an existing image named
210
249
`mcr.microsoft.com/azuredocs/containerapps-helloworld:latest`will be used for the Container App.
211
250
251
+
### Minimal - Use YAML configuration file with previously published image for Container App
252
+
253
+
```yml
254
+
steps:
255
+
256
+
- task: AzureContainerApps@0
257
+
displayName: Build and deploy Container App
258
+
inputs:
259
+
yamlConfigPath: simple-image-container-app.yaml
260
+
```
261
+
262
+
This will create a new Container App named `ado-task-app-<build-id>-<build-number>` in a new resource group named
263
+
`<container-app-name>-rg`where **no new image is built**, but an existing image named
264
+
`mcr.microsoft.com/azuredocs/containerapps-helloworld:latest`will be used for the Container App. Additional properties
265
+
about the Container App will be pulled from the `simple-image-container-app.yaml` file and will override any additional
266
+
values that would've been provided to the task as arguments **excluding `resourceGroup`**.
267
+
268
+
The `simple-image-container-app.yaml` file has the following structure:
0 commit comments