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
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/quickstart-container-apps.md
+23-32Lines changed: 23 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,44 +12,31 @@ ms.author: malev
12
12
13
13
# Quickstart: Use Azure App Configuration in Azure Container Apps
14
14
15
-
In this quickstart, you will use Azure App Configuration in an ASP.NET Core app running in Azure Container Apps. This way, you can centralize the storage and management of your Container Apps configuration. This quickstart leverages the ASP.NET Core app created in [Quickstart: Create an ASP.NET Core app with App Configuration](./quickstart-aspnet-core-app.md). You will containerize the app and deploy it to Azure Container Apps. Complete the quickstart before you continue.
15
+
In this quickstart, you will use Azure App Configuration in an app running in Azure Container Apps. This way, you can centralize the storage and management of the configuration of your apps in Container Apps. This quickstart leverages the ASP.NET Core app created in [Quickstart: Create an ASP.NET Core app with App Configuration](./quickstart-aspnet-core-app.md). You will containerize the app and deploy it to Azure Container Apps. Complete the quickstart before you continue.
16
16
17
17
> [!TIP]
18
18
> While following this quickstart, preferably register all new resources within a single resource group, so that you can regroup them all in a single place and delete them faster later on if you don't need them anymore.
19
19
20
20
## Prerequisites
21
21
22
-
-The App Configuration store and the ASP.NET Core App that you created in the [Quickstart: Create an ASP.NET Core app with App Configuration](./quickstart-aspnet-core-app.md).
22
+
-An application using an App Configuration store. If you don't have one, create an instance using the [Quickstart: Create an ASP.NET Core app with App Configuration](./quickstart-aspnet-core-app.md).
Start by creating a basic [Azure Container Apps](../container-apps/overview.md) instance and a Container Apps environment, where you'll later host your app.
29
-
30
-
This Azure service is designed to run containerized applications.
31
-
32
-
#### [Portal](#tab/azure-portal)
33
-
34
-
To create the container app and container apps environment using the Azure portal, follow the [Azure Container Apps quickstart](/azure/container-apps/quickstart-portal).
35
-
36
-
#### [Azure CLI](#tab/azure-cli)
37
-
38
-
To create the container app and container apps environment using the Azure CLI, follow the [Azure Container Apps quickstart](/azure/container-apps/get-started). The created container app contains a default image.
25
+
- An Azure Container Apps instance. If you don't have one, create an instance using the [Azure portal](/azure/container-apps/quickstart-portal) or [the CLI](/azure/container-apps/get-started).
39
26
40
27
---
41
28
42
-
## Connect Azure Container Apps to Azure App Configuration
29
+
## Connect the container app to Azure App Configuration
43
30
44
-
In the next step, you'll add the connection string of your App Configuration store to the secret of your Container App and add an environment variable to your container to reference the secret. You use the[Service Connector](../service-connector/overview.md) to do this in a few steps without managing the connection information yourself.
31
+
The first step of this guide is to connect your container app to your configuration store. To do this, add the connection string of your App Configuration store to the secret of your Container App, and add an environment variable to your container to reference the secret. Use[Service Connector](../service-connector/overview.md) to do this in a few steps without managing the connection information yourself.
45
32
46
33
In the Azure portal, connect the container app to Azure App Configuration following the [Service Connector quickstart for Azure Container Apps](../service-connector/quickstart-portal-container-apps.md). While following the steps of the quickstart:
47
34
48
35
- In the **Basics** tab:
49
-
50
36
- select **App Configuration** for **Service type**
51
-
- pick the App Configuration store created in the quickstart for "**App Configuration**"
52
-
- select **.NET** for **Client Type**.
37
+
- pick your App Configuration store for "**App Configuration**"
38
+
39
+
:::image type="content" border="true" source="media\connect-container-app\use-service-connector.png" alt-text="Screenshot the Azure platform showing a form in the Service Connector menu in a Container App.":::
53
40
54
41
- In the **Authentication** tab:
55
42
- pick **Connection string** authentication type and **Read-Only** for "**Permissions for the connection string**
@@ -58,7 +45,7 @@ In the Azure portal, connect the container app to Azure App Configuration follow
58
45
59
46
Once done, an environment variable named **ConnectionStrings__AppConfig** will be added to the container of your Container App. Its value is a reference of the Container App secret, the connection string of your App Configuration store. The _ConnectionStrings__AppConfig_ is the environment variable your app built from the quickstart will look for.
60
47
61
-
## Build the container
48
+
## Build a container
62
49
63
50
1. Run the [dotnet publish](/dotnet/core/tools/dotnet-publish) command to build the app in release mode and create the assets in the *published* folder.
64
51
@@ -90,7 +77,7 @@ Create an Azure Container Registry (ACR). ACR enables you to build, store, and m
90
77
1. To create the container registry, follow the [Azure Container Registry quickstart](/azure/container-registry/container-registry-get-started-portal).
91
78
1. Once the deployment is complete, open your ACR instance and from the left menu, select **Settings > Access keys**.
92
79
1. Take note of the **Login server** value listed on this page. You'll use this information in a later step.
93
-
1. Switch **Admin user** to *Enabled*. This option lets you connect the ACR to Azure Container Apps using admin user credentials.
80
+
1. Switch **Admin user** to *Enabled*. This option lets you connect the ACR to Azure Container Apps using admin user credentials. If you leave it disabled, you can still connect the container registry and the container app using a managed identity.
94
81
95
82
#### [Azure CLI](#tab/azure-cli)
96
83
@@ -112,14 +99,14 @@ Push the Docker image to the ACR created earlier.
112
99
113
100
The command returns `Login Succeeded` once login is successful.
114
101
115
-
1. Use [docker tag](https://docs.docker.com/engine/reference/commandline/tag/) to tag the image with the ACR name
102
+
1. Use [docker tag](https://docs.docker.com/engine/reference/commandline/tag/) to tag the image appropriate details.
116
103
117
104
```docker
118
105
docker tag aspnetapp myregistry.azurecr.io/aspnetapp:v1
119
106
```
120
107
121
108
> [!TIP]
122
-
> To review the list of your existing docker images and tags, run `docker image ls`.
109
+
> To review the list of your existing docker images and tags, run `docker image ls`. In this scenario, you should see at least two images: `aspnetapp` and `myregistry.azurecr.io/aspnetapp`.
123
110
124
111
1. Use [docker push](https://docs.docker.com/engine/reference/commandline/push/) to push the image to the container registry. This example creates the *aspnetapp* repository in ACR containing the `aspnetapp` image. In the example below, replace the placeholders `<login-server`, `<image-name>` and `<tag>` by the ACR's log-in server value, the image name and the image tag.
125
112
@@ -135,6 +122,10 @@ Push the Docker image to the ACR created earlier.
135
122
docker push myregistry.azurecr.io/aspnetapp:v1
136
123
```
137
124
125
+
1. Open your Azure Container Registry in the Azure portal and confirm that under **Repositories**, you can see your new repository.
126
+
127
+
:::image type="content" border="true" source="media\connect-container-app\container-registry-repository.png" alt-text="Screenshot of the Azure platform showing a repository in Azure Container Registries.":::
128
+
138
129
## Add your container image to Azure Container Apps
139
130
140
131
Update the existing container app by importing the docker image you created and pushed to ACR earlier.
@@ -147,13 +138,13 @@ Update the existing container app by importing the docker image you created and
147
138
1. Under **Container image**, click on the name of the existing container image.
| Image source | *Azure Container Registry* | Select Azure Container Registry as your image source. |
144
+
| Authentication | *Admin Credentials* | Use the admin user credential option that was enabled earlier in the container registry. You can also [use a managed identity](../container-apps/managed-identity-image-pull.md?tabs=azure-cli&pivots=azure-portal), in which case you will need to manually enter the image and tag in the form. |
145
+
| Registry | *myregistry.azurecr.io* | Select the Azure Container Registry you created earlier. |
146
+
| Image | *aspnetapp* | Select the docker image you created and pushed to ACR earlier. |
147
+
| Image tag | *v1* | Select your image tag from the list. |
157
148
158
149
1. Select **Save** and then **Create** to deploy the update to Azure Container App.
0 commit comments