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/container-instances/container-instances-config-map.md
+46-36Lines changed: 46 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Config maps for Azure Container Instances
2
+
title: Config Maps for Azure Container Instances
3
3
description: Learn how to use config maps with Azure Container Instances.
4
4
author: mimckitt
5
5
ms.author: mimckitt
@@ -9,23 +9,23 @@ ms.custom:
9
9
ms.topic: how-to
10
10
ms.date: 11/17/2025
11
11
ms.reviewer: tomvcassidy
12
-
# Customer intent: As a container orchestrator user, I want to implement config maps in Azure Container Instances so that I can modify container configurations dynamically without restarting the instances, ensuring high availability and minimizing downtime.
12
+
# Customer intent: As a container orchestrator user, I want to implement config maps in Azure Container Instances so that I can modify container configurations dynamically without restarting the instances to ensure high availability and minimize downtime.
13
13
---
14
14
# Config maps for Azure Container Instances
15
15
16
-
A config map is a property that can be used to apply container configurations similar to environment variables and secret volumes. However, unlike when using environment variables or secret volumes where restarting the pod to apply the settings is required, apply settings using a config map doesn't require any restarts for the changes to take effect.
17
-
18
-
Azure Container Instances can be created with or without config maps and can be updated at any point in time post creation using config maps. Updating config maps in an existing running container group can be accomplished quickly without compromising uptime of the container.
16
+
A config map is a property that you can use to apply container configurations similar to environment variables and secret volumes. The process is unlike using environment variables or secret volumes where you must restart the pod to apply the settings. Using a config map to apply settings doesn't require any restarts for the changes to take effect.
19
17
18
+
You can use Azure Container Instances to create container instances with or without config maps. You can also update them at any point after creation by using config maps. Updating config maps in an existing running container group is a task that you can accomplish quickly without compromising uptime of the container.
20
19
21
20
## How it works
22
21
23
-
A config map can be included in the container properties or in a container group profile. Creating a container group profile with the config map settings makes applying those settings simple and easy to automate.
22
+
You can include a config map in the container properties or in a container group profile. Creating a container group profile with the config map settings makes applying those settings simple and easy to automate.
24
23
25
-
### Create a container group profile with config map settings
24
+
### Create a container group profile with config map settings
26
25
27
26
### [CLI](#tab/cli)
28
-
Create a container group profile with config map settings using [az container container-group-profile create](/cli/azure/container).
27
+
28
+
Create a container group profile with config map settings by using [az container container-group-profile create](/cli/azure/container).
29
29
30
30
```azurecli-interactive
31
31
az container container-group-profile create \
@@ -41,8 +41,10 @@ az container container-group-profile create \
41
41
--restart-policy never \
42
42
--config-map key1=value1 key2=value2
43
43
```
44
+
44
45
### [PowerShell](#tab/powershell)
45
-
Create a container group profile with config map settings using [New-AzContainerInstanceContainerGroupProfile](/powershell/module/az.containerinstance).
46
+
47
+
Create a container group profile with config map settings by using [New-AzContainerInstanceContainerGroupProfile](/powershell/module/az.containerinstance).
Create a container group profile with and config map settings deploy the template using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
65
66
67
+
Create a container group profile with config map settings by deploying the template by using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
66
68
67
69
```json
68
70
{
@@ -144,9 +146,9 @@ Create a container group profile with and config map settings deploy the templat
144
146
145
147
```
146
148
147
-
148
149
### [REST](#tab/rest)
149
-
Create a container group profile with config map settings using [Create or Update](/rest/api/container-instances/container-groups/create-or-update).
150
+
151
+
Create a container group profile with config map settings by using [Create or Update](/rest/api/container-instances/container-groups/create-or-update).
150
152
151
153
```HTTP
152
154
PUT https://management.azure.com/subscriptions/{SubscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.ContainerInstance/containerGroupProfiles/myContainerGroupProfile?api-version=2024-05-01-preview
@@ -201,12 +203,13 @@ Request Body
201
203
202
204
---
203
205
204
-
### Apply config map settings using a container group profile
206
+
### Apply config map settings by using the container group profile
205
207
206
-
Applying the config map settings stored in a container group profile requires updating the container and specifying the container group profile that should be associated with the update.
208
+
Applying the config map settings stored in a container group profile requires you to update the container. You also must specify the container group profile that should be associated with the update.
207
209
208
210
### [CLI](#tab/cli)
209
-
Apply the config map settings stored in the container group profile using [az container create](/cli/azure/container).
211
+
212
+
Apply the config map settings stored in the container group profile by using [az container create](/cli/azure/container).
210
213
211
214
```azurecli-interactive
212
215
az container create
@@ -219,7 +222,8 @@ az container create
219
222
```
220
223
221
224
### [PowerShell](#tab/powershell)
222
-
Apply the config map settings stored in the container group profile using [New-AzContainerGroup](/powershell/module/az.containerinstance/new-azcontainergroup).
225
+
226
+
Apply the config map settings stored in the container group profile by using [New-AzContainerGroup](/powershell/module/az.containerinstance/new-azcontainergroup).
Apply the config map settings stored in the container group profile using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
239
242
243
+
Apply the config map settings stored in the container group profile by using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
240
244
241
245
```json
242
246
{
@@ -330,9 +334,9 @@ Apply the config map settings stored in the container group profile using [az de
330
334
331
335
```
332
336
333
-
334
337
### [REST](#tab/rest)
335
-
Apply the config map settings stored in the container group profile using [Create or Update](/rest/api/container-instances/container-groups/create-or-update).
338
+
339
+
Apply the config map settings stored in the container group profile by using [Create or Update](/rest/api/container-instances/container-groups/create-or-update).
336
340
337
341
```HTTP
338
342
PUT
@@ -359,14 +363,13 @@ Request Body
359
363
360
364
---
361
365
366
+
### Apply config map settings without the container group profile
362
367
363
-
### Apply config map settings without container group profile
364
-
365
-
Config map settings can also be applied directly to the instance by specifying the config map settings in the create commands.
366
-
368
+
You can also apply config map settings directly to the instance by specifying the config map settings in the create commands.
367
369
368
370
### [CLI](#tab/cli)
369
-
Apply the config map settings using [az container create](/cli/azure/container).
371
+
372
+
Apply the config map settings by using [az container create](/cli/azure/container).
370
373
371
374
```azurecli-interactive
372
375
az container create \
@@ -377,8 +380,10 @@ az container create \
377
380
378
381
379
382
```
383
+
380
384
### [PowerShell](#tab/powershell)
381
-
Apply the config map settings using [New-AzContainerGrouop](/powershell/module/az.containerinstance/new-azcontainergroup).
385
+
386
+
Apply the config map settings by using [New-AzContainerGroup](/powershell/module/az.containerinstance/new-azcontainergroup).
Apply the config map settings using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
396
400
401
+
Apply the config map settings by using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
397
402
398
403
```json
399
404
{
@@ -476,9 +481,9 @@ Apply the config map settings using [az deployment group create](/cli/azure/depl
476
481
477
482
```
478
483
479
-
480
484
### [REST](#tab/rest)
481
-
Apply the config map settings using [Create or Update](/rest/api/container-instances/container-groups/create-or-update).
485
+
486
+
Apply the config map settings by using [Create or Update](/rest/api/container-instances/container-groups/create-or-update).
482
487
483
488
```HTTP
484
489
PUT
@@ -506,19 +511,24 @@ Request Body
506
511
507
512
---
508
513
509
-
### ConfigMaps in Linux containers
510
-
Once the update has been applied to an existing container and you will see the values mounted in the linux container without requiring a restart.
514
+
### Config maps in Linux containers
515
+
516
+
After the update is applied to an existing container, you see the values mounted in the Linux container without requiring a restart.
511
517
512
518
```
513
-
/mnt/configmap/<containername>/key1 with value as “value1”
519
+
/mnt/configmap/<containername>/key1 with value as "value1"
514
520
515
-
/mnt/configmap/<containername>/key2 with value as “value2”
521
+
/mnt/configmap/<containername>/key2 with value as "value2"
516
522
```
517
-
### ConfigMaps in Windows Containers
518
-
Once the update has been applied to an existing container and you can fetch the configmap keyvalue pairs in the windows container by making the following call, without requiring a restart. These values are not mounted anywhere for windows containers, as is the case for linux.
523
+
524
+
### Config maps in Windows containers
525
+
526
+
After the update is applied to an existing container, you can fetch the config map key/value pairs in the Windows container by making the following call, without requiring a restart. These values aren't mounted anywhere for Windows containers, as is the case for Linux.
527
+
519
528
```
520
529
Invoke-Expression "$Env:ConfigMapURI"
521
530
```
522
531
523
-
## Next steps
524
-
Learn how to use config maps with [standby pools to increase scale and availability](container-instances-standby-pool-get-details.md)
532
+
## Related content
533
+
534
+
- Learn how to use config maps with [standby pools to increase scale and availability](container-instances-standby-pool-get-details.md).
0 commit comments