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
@@ -16,13 +16,21 @@ This article shows you how to configure a custom container to run on Azure App S
16
16
17
17
::: zone pivot="container-windows"
18
18
19
-
Learn about key concepts and get instructions for containerization of Windows apps in App Service. New users should first follow the [custom container quickstart](quickstart-custom-container.md) and [tutorial](tutorial-custom-container.md).
19
+
Learn about key concepts and get instructions for containerization of Windows apps in App Service.
20
+
21
+
## Prerequisites
22
+
23
+
New users should first follow the [custom container quickstart](quickstart-custom-container.md) and [tutorial](tutorial-custom-container.md).
20
24
21
25
::: zone-end
22
26
23
27
::: zone pivot="container-linux"
24
28
25
-
Learn about key concepts and get instructions for containerization of Linux apps in App Service. New users should first follow the [custom container quickstart](quickstart-custom-container.md) and [tutorial](tutorial-custom-container.md). For sidecar containers, see [Tutorial: Configure a sidecar container for custom container in Azure App Service](tutorial-custom-container-sidecar.md).
29
+
Learn about key concepts and get instructions for containerization of Linux apps in App Service.
30
+
31
+
## Prerequisites
32
+
33
+
New users should first follow the [custom container quickstart](quickstart-custom-container.md) and [tutorial](tutorial-custom-container.md). For sidecar containers, see [Tutorial: Configure a sidecar container for a custom container app](tutorial-custom-container-sidecar.md).
26
34
27
35
::: zone-end
28
36
@@ -35,19 +43,19 @@ Learn about key concepts and get instructions for containerization of Linux apps
35
43
36
44
Select the right [parent image (base image)](https://docs.docker.com/develop/develop-images/baseimages/) for the framework you want for your custom Windows image:
37
45
38
-
- To deploy .NET Framework apps, use a parent image based on the Windows Server 2019 Core [Long-Term Servicing Channel](/windows-server/get-started/servicing-channels-comparison#long-term-servicing-channel-ltsc) release.
39
-
- To deploy .NET Core apps, use a parent image based on the Windows Server 2019 Nano [Annual Channel](/windows-server/get-started/servicing-channels-comparison#annual-channel-ac) release.
46
+
- To deploy .NET Framework apps, use a parent image based on the Windows Server [Long-Term Servicing Channel](/windows-server/get-started/servicing-channels-comparison#long-term-servicing-channel-ltsc) release.
47
+
- To deploy .NET Core apps, use a parent image based on the Windows Server [Annual Channel](/windows-server/get-started/servicing-channels-comparison#annual-channel-ac) release.
40
48
41
49
It takes some time to download a parent image during app startup. You can reduce startup time by using one of the following parent images that are already cached in Azure App Service:
@@ -56,30 +64,32 @@ It takes some time to download a parent image during app startup. You can reduce
56
64
Use the following command to change the current Docker image to a new image in an existing custom container:
57
65
58
66
```azurecli-interactive
59
-
az webapp config container set --name <app-name> --resource-group <group-name> --docker-custom-image-name <docker-hub-repo>/<image>
67
+
az webapp config container set --name <app-name> --resource-group <group-name> --container-image-name <docker-hub-repo>/<image>
60
68
```
61
69
70
+
Replace the *\<placeholders>* with your own values.
71
+
62
72
## Use an image from a private registry
63
73
64
74
To use an image from a private registry, such as Azure Container Registry, run the following command:
65
75
66
76
```azurecli-interactive
67
-
az webapp config container set --name <app-name> --resource-group <group-name> --docker-custom-image-name <image-name> --docker-registry-server-url <private-repo-url> --docker-registry-server-user <username> --docker-registry-server-password <password>
77
+
az webapp config container set --name <app-name> --resource-group <group-name> --container-image-name <image-name> --docker-registry-server-url <private-repo-url> --docker-registry-server-user <username> --docker-registry-server-password <password>
68
78
```
69
79
70
-
Supply the sign-in credentials for your private registry account in the `\<username>` and `\<password>` fields.
80
+
Supply the sign-in credentials for your private registry account in the *\<username>* and *\<password>* fields.
71
81
72
82
## Use managed identity to pull an image from Azure Container Registry
73
83
74
84
Use the following steps to configure your web app to pull from Azure Container Registry by using managed identity. The steps use system-assigned managed identity, but you can also use user-assigned managed identity.
75
85
76
-
1. Enable [the system-assigned managed identity](./overview-managed-identity.md) for the web app by using the [`az webapp identity assign`](/cli/azure/webapp/identity#az-webapp-identity-assign) command:
86
+
1. Enable the [system-assigned managed identity](./overview-managed-identity.md) for the web app by using the [`az webapp identity assign`](/cli/azure/webapp/identity#az-webapp-identity-assign) command:
Replace *\<app-name>* with the name you used in the previous step. The output of the command, filtered by the `--query` and `--output` arguments, is the service principal ID of the assigned identity.
92
+
Replace *\<app-name>* with the name of your app. The output of the command, filtered by the `--query` and `--output` arguments, is the service principal ID of the assigned identity.
83
93
84
94
1. Get the resource ID of your container registry:
85
95
@@ -97,8 +107,8 @@ Use the following steps to configure your web app to pull from Azure Container R
97
107
98
108
Replace the following values:
99
109
100
-
-*\<principal-id>* with the service principal ID from the `az webapp identity assign` command
101
-
-*\<registry-resource-id>* with the ID of your container registry from the `az acr show` command
110
+
-*\<principal-id>* with the service principal ID from the `az webapp identity assign` command.
111
+
-*\<registry-resource-id>* with the ID of your container registry from the `az acr show` command.
102
112
103
113
For more information about these permissions, see [What is Azure role-based access control?](../role-based-access-control/overview.md)
104
114
@@ -108,9 +118,7 @@ Use the following steps to configure your web app to pull from Azure Container R
108
118
az webapp config set --resource-group <group-name> --name <app-name> --generic-configurations '{"acrUseManagedIdentityCreds": true}'
109
119
```
110
120
111
-
Replace the following values:
112
-
113
-
-*\<app-name>* with the name of your web app.
121
+
Replace *\<app-name>* with the name of your web app.
114
122
115
123
> [!TIP]
116
124
> If you use PowerShell console to run the commands, escape the strings in the `--generic-configurations` argument in this step and the next step. For example: `--generic-configurations '{\"acrUseManagedIdentityCreds\": true'`.
@@ -121,7 +129,7 @@ Use the following steps to configure your web app to pull from Azure Container R
121
129
az identity show --resource-group <group-name> --name <identity-name> --query clientId --output tsv
122
130
```
123
131
124
-
Replace the `<identity-name>` of your user-assigned managed identity and use the output `<client-id>` to configure the user-assigned managed identity ID.
132
+
Replace the *\<identity-name>* of your user-assigned managed identity and use the output *\<client-id>* to configure the user-assigned managed identity ID.
125
133
126
134
```azurecli-interactive
127
135
az webapp config set --resource-group <group-name> --name <app-name> --generic-configurations '{"acrUserManagedIdentityID": "<client-id>"}'
@@ -203,7 +211,7 @@ For Internet Information Services (IIS) or .NET Framework (4.0 or later) contain
203
211
204
212
::: zone pivot="container-linux"
205
213
206
-
You can use this method for both single-container or multi-container apps, where the environment variables are specified in the `docker-compose.yml` file.
214
+
You can use this method for both single-container or multi-container apps, where the environment variables are specified in the *docker-compose.yml* file.
207
215
208
216
::: zone-end
209
217
@@ -213,7 +221,10 @@ You can use this method for both single-container or multi-container apps, where
213
221
214
222
You can use the `C:\home` directory in your custom container file system to persist files across restarts and share them across instances. When you use the `C:\home` directory, your custom container can access persistent storage.
215
223
216
-
When persistent storage is disabled, writes to the `C:\home` directory aren't persisted across app restarts or across multiple instances. When persistent storage is enabled, all writes to the `C:\home` directory persist. All instances of a scaled-out app can access them. When the container starts, if any files are present on the persistent storage, they overwrite any contents in the `C:\home` directory of the container.
224
+
- When persistent storage is *disabled*, writes to the `C:\home` directory aren't persisted across app restarts or across multiple instances.
225
+
- When persistent storage is *enabled*, all writes to the `C:\home` directory persist.
226
+
227
+
All instances of a scaled-out app can access them. When the container starts, if any files are present on the persistent storage, they overwrite any contents in the `C:\home` directory of the container.
217
228
218
229
The only exception is the `C:\home\LogFiles` directory. This directory stores the container and application logs. The folder always persists upon app restarts if [application logging is enabled](troubleshoot-diagnostic-logs.md?#enable-application-logging-windows) with the **File System** option, whether or not persistent storage is enabled. In other words, when you enable or disable persistent storage, it doesn't affect application logging behavior.
You can use the `/home` directory in your custom container file system to persist files across restarts and share them across instances. When you use the `C:\home` directory, your custom container can access persistent storage. Keep in mind that data that you save within `/home` contributes to the [storage space quota](../azure-resource-manager/management/azure-subscription-service-limits.md#azure-app-service-limits) included with your App Service plan.
247
+
You can use the `/home` directory in your custom container file system to persist files across restarts and share them across instances. When you use the `/home` directory, your custom container can access persistent storage. Keep in mind that data that you save within `/home` contributes to the [storage space quota](../azure-resource-manager/management/azure-subscription-service-limits.md#azure-app-service-limits) included with your App Service plan.
237
248
238
-
When persistent storage is disabled, writes to the `C:\home` directory aren't persisted across app restarts or across multiple instances. When persistent storage is enabled, all writes to the `C:\home` directory persist. All instances of a scaled-out app can access them. When the container starts, if any files are present on the persistent storage, they overwrite any contents in the `C:\home` directory of the container.
249
+
- When persistent storage is *disabled*, writes to the `/home` directory aren't persisted across app restarts or across multiple instances.
250
+
- When persistent storage is *enabled*, all writes to the `/home` directory persist.
239
251
240
-
The only exception is the `C:\home\LogFiles` directory. This directory stores the container and application logs. The folder always persists upon app restarts if [application logging is enabled](troubleshoot-diagnostic-logs.md?#enable-application-logging-windows) with the **File System** option, whether or not persistent storage is enabled. In other words, when you enable or disable persistent storage, it doesn't affect application logging behavior.
252
+
All instances of a scaled-out app can access them. When the container starts, if any files are present on the persistent storage, they overwrite any contents in the `/home` directory of the container.
253
+
254
+
The only exception is the `/home/LogFiles` directory. This directory stores the container and application logs. The folder always persists upon app restarts if [application logging is enabled](troubleshoot-diagnostic-logs.md?#enable-application-logging-linuxcontainer) with the **File System** option, whether or not persistent storage is enabled. In other words, when you enable or disable persistent storage, it doesn't affect application logging behavior.
241
255
242
256
We recommend that you write data to `/home` or a [mounted Azure storage path](configure-connect-to-azure-storage.md?tabs=portal&pivots=container-linux). Data that you write outside these paths isn't persistent during restarts. The data is saved to platform-managed host disk space separate from the App Service plans file storage quota.
243
257
@@ -340,7 +354,9 @@ The value is defined in megabytes (MB) and must be less and equal to the total p
340
354
341
355
## Customize the number of compute cores
342
356
343
-
By default, a Windows container runs with all available cores for your pricing tier. You might want to reduce the number of cores that your staging slot uses. To reduce the number of cores that a container uses, set the `WEBSITE_CPU_CORES_LIMIT` app setting to the preferred number of cores. You can set it by using [Cloud Shell](https://shell.azure.com). In Bash, use the following command:
357
+
By default, a Windows container runs with all available cores for your pricing tier. You might want to reduce the number of cores that your staging slot uses. To reduce the number of cores that a container uses, set the `WEBSITE_CPU_CORES_LIMIT` app setting to the preferred number of cores. You can set it by using [Cloud Shell](https://shell.azure.com).
358
+
359
+
In Bash, use the following command:
344
360
345
361
```azurecli-interactive
346
362
az webapp config appsettings set --resource-group <group-name> --name <app-name> --slot staging --settings WEBSITE_CPU_CORES_LIMIT=1
@@ -489,7 +505,7 @@ You can use Secure Shell (SSH) to remotely run administrative commands from a co
489
505
490
506
1. Rebuild and push the Docker image to the registry, and then test the **Web App SSH** feature in the Azure portal.
491
507
492
-
For more troubleshooting information, see the Azure App Service blog: [Enable SSH on a Linux web app for containers](https://azureossd.github.io/2022/04/27/2022-Enabling-SSH-on-Linux-Web-App-for-Containers/index.html#troubleshooting).
508
+
For more troubleshooting information, see the Azure App Service [Troubleshooting blog](https://azureossd.github.io/2022/04/27/2022-Enabling-SSH-on-Linux-Web-App-for-Containers/index.html#troubleshooting).
493
509
494
510
## Access diagnostic logs
495
511
@@ -498,7 +514,7 @@ For more troubleshooting information, see the Azure App Service blog: [Enable SS
498
514
## Configure multi-container apps
499
515
500
516
> [!NOTE]
501
-
> The Docker Compose feature will be retired on March 31, 2027. Sidecar containers succeed multi-container apps in App Service. For new services, see [Tutorial: Configure a sidecar container for custom container in Azure App Service](tutorial-custom-container-sidecar.md). For existing multi-container apps in App Service, see [Migrate your Docker Compose applications to the sidecar feature](https://azure.github.io/AppService/2025/04/01/Docker-compose-migration.html).
517
+
> The Docker Compose feature will be retired on March 31, 2027. Sidecar containers succeed multi-container apps in App Service. For new services, see [Tutorial: Configure a sidecar container for a custom container app](tutorial-custom-container-sidecar.md). For existing multi-container apps in App Service, see [Migrate your Docker Compose applications to the sidecar feature](https://azure.github.io/AppService/2025/04/01/Docker-compose-migration.html).
502
518
503
519
-[Use persistent storage in Docker Compose](#use-persistent-storage-in-docker-compose)
504
520
-[Preview limitations](#preview-limitations)
@@ -531,10 +547,10 @@ wordpress:
531
547
532
548
Multi-container is currently in preview. The following App Service platform features aren't supported:
533
549
534
-
- Authentication or authorization.
535
-
- Managed identities.
536
-
- Cross-origin resource sharing (CORS).
537
-
- Virtual network integration with Docker Compose scenarios.
550
+
- Authentication or authorization
551
+
- Managed identities
552
+
- Cross-origin resource sharing (CORS)
553
+
- Virtual network integration with Docker Compose scenarios
538
554
539
555
Docker Compose on Azure App Service currently has a limit of 4,000 characters.
540
556
@@ -579,6 +595,6 @@ The following sections show supported and unsupported Docker Compose configurati
579
595
## Related content
580
596
581
597
- [Tutorial: Migrate custom software to Azure App Service by using a custom container](tutorial-custom-container.md)
582
-
- [Tutorial: Configure a sidecar container for custom container in Azure App Service](tutorial-custom-container-sidecar.md)
583
-
- [Environment variables and app settings reference](reference-app-settings.md)
584
-
- [Load certificates in Windows/Linux containers](configure-ssl-certificate-in-code.md#load-certificates-in-linuxwindows-containers)
598
+
- [Tutorial: Configure a sidecar container for a custom container app](tutorial-custom-container-sidecar.md)
599
+
- [Environment variables and app settings in Azure App Service](reference-app-settings.md)
600
+
- [Load certificates in Linux/Windows containers](configure-ssl-certificate-in-code.md#load-certificates-in-linuxwindows-containers)
0 commit comments