Skip to content

Commit cea503d

Browse files
authored
Merge pull request #213202 from macolso/main
Update container-instances-encrypt-data.md
2 parents 02c4d98 + 3050113 commit cea503d

File tree

2 files changed

+243
-24
lines changed

2 files changed

+243
-24
lines changed

articles/container-instances/container-instances-encrypt-data.md

Lines changed: 239 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ When running Azure Container Instances (ACI) resources in the cloud, the ACI ser
1717

1818
Data in ACI is encrypted and decrypted using 256-bit AES encryption. It is enabled for all ACI deployments, and you don't need to modify your deployment or containers to take advantage of this encryption. This includes metadata about the deployment, environment variables, keys being passed into your containers, and logs persisted after your containers are stopped so you can still see them. Encryption does not affect your container group performance, and there is no additional cost for encryption.
1919

20-
## Encryption key management
21-
2220
You can rely on Microsoft-managed keys for the encryption of your container data, or you can manage the encryption with your own keys. The following table compares these options:
2321

2422
| | Microsoft-managed keys | Customer-managed keys |
@@ -28,10 +26,12 @@ You can rely on Microsoft-managed keys for the encryption of your container data
2826
| **Key rotation responsibility** | Microsoft | Customer |
2927
| **Key access** | Microsoft only | Microsoft, Customer |
3028

31-
The rest of the document covers the steps required to encrypt your ACI deployment data with your key (customer-managed key).
29+
This article reviews two flows for encrypting data with a customer-managed key:
30+
* Encrypt data with a customer-managed key stored in a standard Azure Key Vault
31+
* Encrypt data with a customer-managed key stored in a network-protected Azure Key Vault with [Trusted Services](../key-vault/general/network-security.md) enabled.
3232

33+
## Encrypt data with a customer-managed key stored in a standard Azure Key Vau
3334
[!INCLUDE [azure-cli-prepare-your-environment.md](../../includes/azure-cli-prepare-your-environment.md)]
34-
3535
### Create Service Principal for ACI
3636

3737
The first step is to ensure that your [Azure tenant](../active-directory/develop/quickstart-create-new-tenant.md) has a service principal assigned for granting permissions to the Azure Container Instances service.
@@ -237,6 +237,241 @@ az deployment group create --resource-group myResourceGroup --template-file depl
237237

238238
Within a few seconds, you should receive an initial response from Azure. Once the deployment completes, all data related to it persisted by the ACI service will be encrypted with the key you provided.
239239

240+
## Encrypt data with a customer-managed key in a network protected Azure Key Vault with Trusted Services enabled
241+
242+
### Create a Key Vault resource
243+
244+
Create an Azure Key Vault using [Azure portal](../key-vault/general/quick-create-portal.md), [Azure CLI](../key-vault/general/quick-create-cli.md), or [Azure PowerShell](../key-vault/general/quick-create-powershell.md). To start, do not apply any network-limitations so we can add necessary keys to the vault. In subsequent steps, we will add network-limitations and enable trusted services.
245+
246+
For the properties of your key vault, use the following guidelines:
247+
* Name: A unique name is required.
248+
* Subscription: Choose a subscription.
249+
* Under Resource Group, either choose an existing resource group, or create new and enter a resource group name.
250+
* In the Location pull-down menu, choose a location.
251+
* You can leave the other options to their defaults or pick based on additional requirements.
252+
253+
> [!IMPORTANT]
254+
> When using customer-managed keys to encrypt an ACI deployment template, it is recommended that the following two properties be set on the key vault, Soft Delete and Do Not Purge. These properties are not enabled by default, but can be enabled using either PowerShell or Azure CLI on a new or existing key vault.
255+
### Generate a new key
256+
257+
Once your key vault is created, navigate to the resource in Azure portal. On the left navigation menu of the resource blade, under Settings, click **Keys**. On the view for "Keys," click "Generate/Import" to generate a new key. Use any unique Name for this key, and any other preferences based on your requirements. Make sure to capture key name and version for subsequent steps.
258+
259+
![Screenshot of key creation settings, PNG.](./media/container-instances-encrypt-data/generate-key.png)
260+
261+
### Create a user-assigned managed identity for your container group
262+
Create an identity in your subscription using the [az identity create](/cli/azure/identity#az-identity-create) command. You can use the same resource group used to create the key vault, or use a different one.
263+
264+
```azurecli-interactive
265+
az identity create \
266+
--resource-group myResourceGroup \
267+
--name myACIId
268+
```
269+
270+
To use the identity in the following steps, use the [az identity show](/cli/azure/identity#az-identity-show) command to store the identity's service principal ID and resource ID in variables.
271+
272+
```azurecli-interactive
273+
# Get service principal ID of the user-assigned identity
274+
spID=$(az identity show \
275+
--resource-group myResourceGroup \
276+
--name myACIId \
277+
--query principalId --output tsv)
278+
```
279+
280+
### Set access policy
281+
282+
Create a new access policy for allowing the user-assigned identity to access and unwrap your key for encryption purposes.
283+
284+
```azurecli-interactive
285+
az keyvault set-policy \
286+
--name mykeyvault \
287+
--resource-group myResourceGroup \
288+
--object-id $spID \
289+
--key-permissions get unwrapKey
290+
```
291+
292+
### Modify Azure Key Vault's network permissions
293+
The following commands set up an Azure Firewall for your Azure Key Vault and allow Azure Trusted Services such as ACI access.
294+
295+
```azurecli-interactive
296+
az keyvault update \
297+
--name mykeyvault \
298+
--resource-group myResourceGroup \
299+
--default-action Deny
300+
```
301+
302+
```azurecli-interactive
303+
az keyvault update \
304+
--name mykeyvault \
305+
--resource-group myResourceGroup \
306+
--bypass AzureServices
307+
```
308+
309+
### Modify your JSON deployment template
310+
311+
> [!IMPORTANT]
312+
> Encrypting deployment data with a customer-managed key is available in the 2022-09-01 API version or newer. The 2022-09-01 API version is only available via ARM or REST. If you have any issues with this, please reach out to Azure Support.
313+
Once the key vault key and access policy are set up, add the following properties to your ACI deployment template. Learn more about deploying ACI resources with a template in the [Tutorial: Deploy a multi-container group using a Resource Manager template](./container-instances-multi-container-group.md).
314+
* Under `resources`, set `apiVersion` to `2022-09-01`.
315+
* Under the container group properties section of the deployment template, add an `encryptionProperties`, which contains the following values:
316+
* `vaultBaseUrl`: the DNS Name of your key vault. This can be found on the overview blade of the key vault resource in Portal
317+
* `keyName`: the name of the key generated earlier
318+
* `keyVersion`: the current version of the key. This can be found by clicking into the key itself (under "Keys" in the Settings section of your key vault resource)
319+
* `identity`: this is the resource URI of the Managed Identity instance created earlier
320+
* Under the container group properties, add a `sku` property with value `Standard`. The `sku` property is required in API version 2022-09-01.
321+
* Under resources, add the `identity` object required to use Managed Identity with ACI, which contains the following values:
322+
* `type`: the type of the identity being used (either user-assigned or system-assigned). This case will be set to "UserAssigned"
323+
* `userAssignedIdentities`: the resourceURI of the same user-assigned identity used above in the `encryptionProperties` object.
324+
325+
The following template snippet shows these additional properties to encrypt deployment data:
326+
327+
```json
328+
[...]
329+
"resources": [
330+
{
331+
"name": "[parameters('containerGroupName')]",
332+
"type": "Microsoft.ContainerInstance/containerGroups",
333+
"apiVersion": "2019-12-01",
334+
"location": "[resourceGroup().location]",
335+
"identity": {
336+
"type": "UserAssigned",
337+
"userAssignedIdentities": {
338+
"/subscriptions/XXXXXXXXXXXXXXXXXXXXXX/resourcegroups/XXXXXXXXXXXXXXXXXXXXXX/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myACIId": {}
339+
}
340+
},
341+
"properties": {
342+
"encryptionProperties": {
343+
"vaultBaseUrl": "https://example.vault.azure.net",
344+
"keyName": "acikey",
345+
"keyVersion": "xxxxxxxxxxxxxxxx",
346+
"identity": "/subscriptions/XXXXXXXXXXXXXXXXXXXXXX/resourcegroups/XXXXXXXXXXXXXXXXXXXXXX/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myACIId"
347+
},
348+
"sku": "Standard",
349+
"containers": {
350+
[...]
351+
}
352+
}
353+
}
354+
]
355+
```
356+
357+
Following is a complete template, adapted from the template in [Tutorial: Deploy a multi-container group using a Resource Manager template](./container-instances-multi-container-group.md).
358+
359+
```json
360+
{
361+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
362+
"contentVersion": "1.0.0.0",
363+
"parameters": {
364+
"containerGroupName": {
365+
"type": "string",
366+
"defaultValue": "myContainerGroup",
367+
"metadata": {
368+
"description": "Container Group name."
369+
}
370+
}
371+
},
372+
"variables": {
373+
"container1name": "aci-tutorial-app",
374+
"container1image": "mcr.microsoft.com/azuredocs/aci-helloworld:latest",
375+
"container2name": "aci-tutorial-sidecar",
376+
"container2image": "mcr.microsoft.com/azuredocs/aci-tutorial-sidecar"
377+
},
378+
"resources": [
379+
{
380+
"name": "[parameters('containerGroupName')]",
381+
"type": "Microsoft.ContainerInstance/containerGroups",
382+
"apiVersion": "2022-09-01",
383+
"location": "[resourceGroup().location]",
384+
"identity": {
385+
"type": "UserAssigned",
386+
"userAssignedIdentities": {
387+
"/subscriptions/XXXXXXXXXXXXXXXXXXXXXX/resourcegroups/XXXXXXXXXXXXXXXXXXXXXX/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myACIId": {}
388+
}
389+
},
390+
"properties": {
391+
"encryptionProperties": {
392+
"vaultBaseUrl": "https://example.vault.azure.net",
393+
"keyName": "acikey",
394+
"keyVersion": "xxxxxxxxxxxxxxxx",
395+
"identity": "/subscriptions/XXXXXXXXXXXXXXXXXXXXXX/resourcegroups/XXXXXXXXXXXXXXXXXXXXXX/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myACIId"
396+
},
397+
"sku": "Standard",
398+
"containers": [
399+
{
400+
"name": "[variables('container1name')]",
401+
"properties": {
402+
"image": "[variables('container1image')]",
403+
"resources": {
404+
"requests": {
405+
"cpu": 1,
406+
"memoryInGb": 1.5
407+
}
408+
},
409+
"ports": [
410+
{
411+
"port": 80
412+
},
413+
{
414+
"port": 8080
415+
}
416+
]
417+
}
418+
},
419+
{
420+
"name": "[variables('container2name')]",
421+
"properties": {
422+
"image": "[variables('container2image')]",
423+
"resources": {
424+
"requests": {
425+
"cpu": 1,
426+
"memoryInGb": 1.5
427+
}
428+
}
429+
}
430+
}
431+
],
432+
"osType": "Linux",
433+
"ipAddress": {
434+
"type": "Public",
435+
"ports": [
436+
{
437+
"protocol": "tcp",
438+
"port": "80"
439+
},
440+
{
441+
"protocol": "tcp",
442+
"port": "8080"
443+
}
444+
]
445+
}
446+
}
447+
}
448+
],
449+
"outputs": {
450+
"containerIPv4Address": {
451+
"type": "string",
452+
"value": "[reference(resourceId('Microsoft.ContainerInstance/containerGroups/', parameters('containerGroupName'))).ipAddress.ip]"
453+
}
454+
}
455+
}
456+
```
457+
458+
### Deploy your resources
459+
460+
If you created and edited the template file on your desktop, you can upload it to your Cloud Shell directory by dragging the file into it.
461+
462+
Create a resource group with the [az group create][az-group-create] command.
463+
464+
```azurecli-interactive
465+
az group create --name myResourceGroup --location eastus
466+
```
467+
468+
Deploy the template with the [az deployment group create][az-deployment-group-create] command.
469+
470+
```azurecli-interactive
471+
az deployment group create --resource-group myResourceGroup --template-file deployment-template.json
472+
```
473+
474+
Within a few seconds, you should receive an initial response from Azure. Once the deployment completes, all data related to it persisted by the ACI service will be encrypted with the key you provided.
240475
<!-- LINKS - Internal -->
241476
[az-group-create]: /cli/azure/group#az_group_create
242477
[az-deployment-group-create]: /cli/azure/deployment/group/#az_deployment_group_create

articles/container-instances/container-instances-region-availability.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,60 +34,44 @@ The following regions and maximum resources are available to container groups wi
3434
| Region | Max CPU | Max Memory (GB) | VNET Max CPU | VNET Max Memory (GB) | Storage (GB) | GPU SKUs (preview) | Availability Zone support |
3535
| -------- | :---: | :---: | :----: | :-----: | :-------: | :----: | :----: |
3636
| Australia East | 4 | 16 | 4 | 16 | 50 | N/A | Y |
37-
| Australia Southeast | 4 | 14 | N/A | N/A | 50 | N/A | N |
38-
| Brazil South | 4 | 16 | 2 | 8 | 50 | N/A | Y |
3937
| Australia Southeast | 4 | 14 | 16 | 50 | 50 | N/A | N |
4038
| Brazil South | 4 | 16 | 2 | 16 | 50 | N/A | Y |
39+
| Brazil South | 4 | 16 | 2 | 8 | 50 | N/A | Y |
4140
| Canada Central | 4 | 16 | 4 | 16 | 50 | N/A | N |
4241
| Canada East | 4 | 16 | N/A | N/A | 50 | N/A | N |
43-
| Canada East | 4 | 16 | 16 | 50 | 50 | N/A | N |
4442
| Central India | 4 | 16 | 4 | 4 | 50 | V100 | N |
4543
| Central US | 4 | 16 | 4 | 16 | 50 | N/A | Y |
4644
| East Asia | 4 | 16 | 4 | 16 | 50 | N/A | N |
4745
| East US | 4 | 16 | 4 | 16 | 50 | K80, P100, V100 | Y |
4846
| East US 2 | 4 | 16 | 4 | 16 | 50 | N/A | Y |
4947
| France Central | 4 | 16 | 4 | 16 | 50 | N/A | Y|
50-
| Germany West Central | 4 | 16 | N/A | N/A | 50 | N/A | Y |
5148
| Germany West Central | 4 | 16 | 16 | 50 | 50 | N/A | Y |
5249
| Japan East | 4 | 16 | 4 | 16 | 50 | N/A | Y |
53-
| Japan West | 4 | 16 | N/A | N/A | 50 | N/A | N |
54-
| Jio India West | 4 | 16 | N/A | N/A | 50 | N/A | N |
55-
| Korea Central | 4 | 16 | N/A | N/A | 50 | N/A | N |
56-
| North Central US | 2 | 3.5 | 4 | 16 | 50 | K80, P100, V100 | N |
5750
| Japan West | 4 | 16 | 16 | 50 | 50 | N/A | N |
5851
| Jio India West | 4 | 16 | 16 | 50 | 50 | N/A | N |
5952
| Korea Central | 4 | 16 | 16 | 50 | 50 | N/A | N |
6053
| North Central US | 4 | 16 | 4 | 16 | 50 | K80, P100, V100 | N |
6154
| North Europe | 4 | 16 | 4 | 16 | 50 | K80 | Y |
62-
| Norway East | 4 | 16 | N/A | N/A | 50 | N/A | N |
63-
| Norway West | 4 | 16 | N/A | N/A | 50 | N/A | N |
64-
| South Africa North | 4 | 16 | N/A | N/A | 50 | N/A | N |
6555
| Norway East | 4 | 16 | 4 | 16 | 50 | N/A | N |
6656
| Norway West | 4 | 16 | 4 | 16 | 50 | N/A | N |
6757
| South Africa North | 4 | 16 | 4 | 16 | 50 | N/A | N |
6858
| South Central US | 4 | 16 | 4 | 16 | 50 | V100 | Y |
69-
| Southeast Asia | 4 | 16 | 4 | 16 | 50 | P100, V100 | Y |
70-
| South India | 4 | 16 | N/A | N/A | 50 | K80 | N |
71-
| Sweden Central | 4 | 16 | N/A | N/A | 50 | N/A | N |
72-
| Sweden South | 4 | 16 | N/A | N/A | 50 | N/A | N |
73-
| Switzerland North | 4 | 16 | N/A | N/A | 50 | N/A | N |
7459
| South India | 4 | 16 | 4 | 16 | 50 | K80 | N |
60+
| Southeast Asia | 4 | 16 | 4 | 16 | 50 | P100, V100 | Y |
7561
| Sweden Central | 4 | 16 | 4 | 16 | 50 | N/A | N |
7662
| Sweden South | 4 | 16 | 4 | 16 | 50 | N/A | N |
7763
| Switzerland North | 4 | 16 | 4 | 16 | 50 | N/A | N |
7864
| Switzerland West | 4 | 16 | N/A | N/A | 50 | N/A | N |
65+
| UAE North | 4 | 16 | 4 | 16 | 50 | N/A | N |
7966
| UK South | 4 | 16 | 4 | 16 | 50 | N/A | Y|
80-
| UK West | 4 | 16 | N/A | N/A | 50 | N/A | N |
81-
| UAE North | 4 | 16 | N/A | N/A | 50 | N/A | N |
8267
| UK West | 4 | 16 | 4 | 16 | 50 | N/A | N |
83-
| UAE North | 4 | 16 | 4 | 16 | 50 | N/A | N |
8468
| West Central US| 4 | 16 | 4 | 16 | 50 | N/A | N |
8569
| West Europe | 4 | 16 | 4 | 16 | 50 | K80, P100, V100 | Y |
8670
| West India | 4 | 16 | N/A | N/A | 50 | N/A | N |
8771
| West US | 4 | 16 | 4 | 16 | 50 | N/A | N |
8872
| West US 2 | 4 | 16 | 4 | 16 | 50 | K80, P100, V100 | Y |
89-
| West US 3 | 4 | 16 | N/A | N/A | 50 | N/A | N |
9073
| West US 3 | 4 | 16 | 4 | 16 | 50 | N/A | N |
74+
| West US 3 | 4 | 16 | N/A | N/A | 50 | N/A | N |
9175

9276
The following maximum resources are available to a container group deployed with [GPU resources](container-instances-gpu.md) (preview).
9377

0 commit comments

Comments
 (0)