Skip to content

Commit a6a260f

Browse files
authored
A bunch of fixes
1 parent 147bf70 commit a6a260f

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

articles/container-apps/azure-pipelines.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Publish revisions with Azure Pipelines in Azure Container Apps
3-
description: Learn to automatically create new revisions in Azure Container Apps using a Azure DevOps pipeline
3+
description: Learn to automatically create new revisions in Azure Container Apps using an Azure DevOps pipeline
44
services: container-apps
55
author: craigshoemaker
66
ms.service: container-apps
@@ -11,7 +11,7 @@ ms.author: cshoe
1111

1212
# Deploy to Azure Container Apps from Azure Pipelines (preview)
1313

14-
Azure Container Apps allows you to use Azure Pipelines to publish [revisions](revisions.md) to your container app. As commits are pushed to your Azure DevOps repository, a pipeline is triggered which updates the container image in the container registry. Azure Container Apps creates a new revision based on the updated container image.
14+
Azure Container Apps allows you to use Azure Pipelines to publish [revisions](revisions.md) to your container app. As commits are pushed to your [Azure DevOps repository](/azure/devops/repos/?view=azure-devops), a pipeline is triggered which updates the container image in the container registry. Azure Container Apps creates a new revision based on the updated container image.
1515

1616
The pipeline is triggered by commits to a specific branch in your repository. When creating the pipeline, you decide which branch is the trigger.
1717

@@ -29,7 +29,7 @@ Here are some common scenarios for using the task. For more information, see the
2929

3030
#### Build and deploy to Container Apps
3131

32-
The following snippet shows how to build a container image and deploy it to Container Apps.
32+
The following snippet shows how to build a container image from source code and deploy it to Container Apps.
3333

3434
```yaml
3535
steps:
@@ -56,9 +56,12 @@ steps:
5656
acrName: 'myregistry'
5757
containerAppName: 'my-container-app'
5858
resourceGroup: 'my-container-app-rg'
59-
imageToDeploy: 'myregistry.azurecr.io/my-container-app:latest'
59+
imageToDeploy: 'myregistry.azurecr.io/my-container-app:$(Build.BuildId)'
6060
```
6161

62+
> [!IMPORTANT]
63+
> If you're building a container image in a separate step, make sure you use a unique tag such as the build ID instead of a stable tag like `latest`. For more information, see [Image tag best practices](../container-registry/container-registry-image-tag-version.md).
64+
6265
### Authenticate with Azure Container Registry
6366

6467
The Azure Container Apps task needs to authenticate with your Azure Container Registry to push the container image. The container app also needs to authenticate with your Azure Container Registry to pull the container image.
@@ -110,14 +113,14 @@ Before creating a pipeline, the source code for your app must be in a repository
110113
1. Open a terminal and run the following command to clone the repository:
111114

112115
```bash
113-
git clone <REPOSITORY_URL>
116+
git clone <REPOSITORY_URL> my-container-app
114117
```
115118

116119
Replace `<REPOSITORY_URL>` with the URL you copied.
117120

118121
### Create a container app and configure managed identity
119122

120-
Create your container app using the `az containerapp up` command in the following steps. This command will build the container image, create an Azure Container Registry, and store the image in the registry.
123+
Create your container app using the `az containerapp up` command in the following steps. This command will create Azure resources, build the container image, store the image in a registry, and deploy to a container app.
121124

122125
After your app is created, you can add a managed identity to your app and assign the identity the `AcrPull` role to allow the identity to pull images from the registry.
123126

@@ -190,10 +193,10 @@ To learn more about service connections, see [Connect to Microsoft Azure](/azure
190193
resourceGroup: 'my-container-app-rg'
191194
```
192195

193-
Replace `<AZURE_SUBSCRIPTION_SERVICE_CONNECTION>` with the name of the Azure DevOps service connection you created in the previous step and `<ACR_NAME>` with the name of your Azure Container Registry.
196+
Replace `<AZURE_SUBSCRIPTION_SERVICE_CONNECTION>` with the name of the Azure DevOps service connection (`my-subscription-service-connection`) you created in the previous step and `<ACR_NAME>` with the name of your Azure Container Registry.
194197

195198
1. Select **Save and run**.
196199

197-
An Azure Pipelines run should start to build and deploy your container app. To check its progress, navigate to *Pipelines* and select the run.
200+
An Azure Pipelines run should start to build and deploy your container app. To check its progress, navigate to *Pipelines* and select the run. During the first pipeline run, you may be prompted to authorize the pipeline to use your service connection.
198201

199202
To deploy a new revision of your app, push a new commit to the *main* branch.

articles/container-apps/github-actions.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Azure Container Apps allows you to use GitHub Actions to publish [revisions](rev
1515

1616
:::image type="content" source="media/github-actions/azure-container-apps-github-actions.png" alt-text="Changes to a GitHub repo trigger an action to create a new revision.":::
1717

18-
The GitHub Actions workflow is triggered by commits to a specific branch in your repository. When creating the workflow, you decide which branch triggers the action.
18+
The GitHub Actions workflow is triggered by commits to a specific branch in your repository. When creating the workflow, you decide which branch triggers it.
1919

2020
This article shows you how to create your own workflow that you can fully customize. To generate a starter GitHub Actions workflow with Azure CLI, see [Generate GitHub Actions workflow with Azure CLI](github-actions-cli.md).
2121

@@ -33,7 +33,7 @@ Here are some common scenarios for using the action. For more information, see t
3333

3434
#### Build and deploy to Container Apps
3535

36-
The following snippet shows how to build a container image and deploy it to Container Apps.
36+
The following snippet shows how to build a container image from source code and deploy it to Container Apps.
3737

3838
```yaml
3939
steps:
@@ -72,9 +72,12 @@ steps:
7272
acrName: myregistry
7373
containerAppName: my-container-app
7474
resourceGroup: my-rg
75-
imageToDeploy: myregistry.azurecr.io/app:latest
75+
imageToDeploy: myregistry.azurecr.io/app:${{ github.sha }}
7676
```
7777

78+
> [!IMPORTANT]
79+
> If you're building a container image in a separate step, make sure you use a unique tag such as the commit SHA instead of a stable tag like `latest`. For more information, see [Image tag best practices](../container-registry/container-registry-image-tag-version.md).
80+
7881
### Authenticate with Azure Container Registry
7982

8083
The Azure Container Apps action needs to authenticate with your Azure Container Registry to push the container image. The container app also needs to authenticate with your Azure Container Registry to pull the container image.
@@ -131,7 +134,7 @@ Before creating a workflow, the source code for your app must be in a GitHub rep
131134

132135
### Create a container app with managed identity enabled
133136

134-
Create your container app using the `az containerapp up` command in the following steps. This command will build the container image, create an Azure Container Registry, and store the image in the registry.
137+
Create your container app using the `az containerapp up` command in the following steps. This command will create Azure resources, build the container image, store the image in a registry, and deploy to a container app.
135138

136139
After you create your app, you can add a managed identity to the app and assign the identity the `AcrPull` role to allow the identity to pull images from the registry.
137140

0 commit comments

Comments
 (0)