Skip to content

Commit 331fc12

Browse files
authored
Merge pull request #100728 from dkkapur/master
encrypt deployment templates for ACI
2 parents d95b781 + 181e454 commit 331fc12

File tree

7 files changed

+262
-1
lines changed

7 files changed

+262
-1
lines changed

articles/container-instances/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
href: container-instances-vnet.md
6060
- name: Deploy from Azure Container Registry
6161
href: container-instances-using-azure-container-registry.md
62+
- name: Encrypt deployment data
63+
href: container-instances-encrypt-data.md
64+
- name: Deploy on dedicated hosts
65+
href: container-instances-dedicated-hosts.md
6266
- name: Container scenarios
6367
items:
6468
- name: Set restart policy for run-once tasks
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: Deploy on dedicated hosts
3+
description: Use dedicated hosts to achieve true host level isolation for your workloads
4+
ms.topic: article
5+
ms.date: 01/10/2020
6+
ms.author: danlep
7+
---
8+
9+
# Deploy on dedicated hosts
10+
11+
"Dedicated" is an Azure Container Instances (ACI) sku that provides an isolated and dedicated compute environment for securely running containers. Using the dedicated sku results in each container group having a dedicated physical server in an Azure datacenter, ensuring full workload isolation to help meet your organization's security and compliance requirements.
12+
13+
The dedicated sku is appropriate for container workloads that require workload isolation from a physical server perspective.
14+
15+
## Using the dedicated sku
16+
17+
> [!IMPORTANT]
18+
> Using the dedicated sku is only available in the latest API version (2019-12-01) that is currently rolling out. Specify this API version in your deployment template. Additionally, the default limit for any subscription to use the dedicated sku is 0. If you would like to use this sku for your production container deployments, please create an [Azure Support request][azure-support]
19+
20+
Starting with API version 2019-12-01, there is a "sku" property under the container group properties section of a deployment template, which is required for an ACI deployment. Currently, you can use this property as part of an Azure Resource Manager deployment template for ACI. You can learn more about deploying ACI resources with a template in the [Tutorial: Deploy a multi-container group using a Resource Manager template](https://docs.microsoft.com/azure/container-instances/container-instances-multi-container-group).
21+
22+
The sku property can have one of the following values:
23+
* Standard - the standard ACI deployment choice, which still guarantees hypervisor-level security
24+
* Dedicated - used for workload level isolation with dedicated physical hosts for the container group
25+
26+
## Modify your JSON deployment template
27+
28+
In your deployment template, where the container group resource is specified, ensure that the `"apiVersion": "2019-12-01",`. In the properties section of the container group resource, set `"sku": "Dedicated",`.
29+
30+
Here is an example snippet for the resources section of a container group deployment template that uses the dedicated sku:
31+
32+
```json
33+
{
34+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
35+
"contentVersion": "1.0.0.0",
36+
"parameters": {
37+
"containerGroupName": {
38+
"type": "string",
39+
"defaultValue": "myContainerGroup",
40+
"metadata": {
41+
"description": "Container Group name."
42+
}
43+
}
44+
},
45+
"resources": [
46+
{
47+
"name": "[parameters('containerGroupName')]",
48+
"type": "Microsoft.ContainerInstance/containerGroups",
49+
"apiVersion": "2019-12-01",
50+
"location": "[resourceGroup().location]",
51+
"properties": {
52+
"sku": "Dedicated",
53+
"containers": [
54+
{
55+
"name": "container1",
56+
"properties": {
57+
"image": "nginx",
58+
"command": [
59+
"/bin/sh",
60+
"-c",
61+
"while true; do echo `date`; sleep 1000000; done"
62+
],
63+
"ports": [
64+
{
65+
"protocol": "TCP",
66+
"port": 80
67+
}
68+
],
69+
"environmentVariables": [],
70+
"resources": {
71+
"requests": {
72+
"memoryInGB": 1.0,
73+
"cpu": 1
74+
}
75+
}
76+
}
77+
}
78+
],
79+
"restartPolicy": "Always",
80+
"ipAddress": {
81+
"ports": [
82+
{
83+
"protocol": "TCP",
84+
"port": 80
85+
}
86+
],
87+
"type": "Public"
88+
},
89+
"osType": "Linux",
90+
},
91+
"location": "eastus2euap",
92+
"tags": {}
93+
}
94+
]
95+
}
96+
```
97+
98+
## Deploy your container group
99+
100+
If you created and edited the deployment template file on your desktop, you can upload it to your Cloud Shell directory by dragging the file into it.
101+
102+
Create a resource group with the [az group create][az-group-create] command.
103+
104+
```azurecli-interactive
105+
az group create --name myResourceGroup --location eastus
106+
```
107+
108+
Deploy the template with the [az group deployment create][az-group-deployment-create] command.
109+
110+
```azurecli-interactive
111+
az group deployment create --resource-group myResourceGroup --template-file deployment-template.json
112+
```
113+
114+
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.
115+
116+
<!-- LINKS - Internal -->
117+
[az-group-create]: /cli/azure/group#az-group-create
118+
[az-group-deployment-create]: /cli/azure/group/deployment#az-group-deployment-create
119+
120+
<!-- LINKS - External -->
121+
[azure-support]: https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/newsupportrequest
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: Encrypt deployment data
3+
description: Learn about encryption of data persisted for your container instance resources and how to encrypt the data with a customer-managed key
4+
ms.topic: article
5+
ms.date: 01/10/2020
6+
ms.author: danlep
7+
---
8+
9+
# Encrypt deployment data
10+
11+
When running Azure Container Instances (ACI) resources in the cloud, the ACI service collects and persists data related to your containers. ACI automatically encrypts this data when it is persisted in the cloud. This encryption protects your data to help meet your organization's security and compliance commitments. ACI also gives you the option to encrypt this data with your own key, giving you greater control over the data related to your ACI deployments.
12+
13+
## About ACI data encryption
14+
15+
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.
16+
17+
## Encryption key management
18+
19+
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:
20+
21+
| | Microsoft-managed keys | Customer-managed keys |
22+
|----|----|----|
23+
| Encryption/decryption operations | Azure | Azure |
24+
| Key storage | Microsoft key store | Azure Key Vault |
25+
| Key rotation responsibility | Microsoft | Customer |
26+
| Key access | Microsoft only | Microsoft, Customer |
27+
28+
The rest of the document covers the steps required to encrypt your ACI deployment data with your key (customer-managed key).
29+
30+
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
31+
32+
## Encrypt data with a customer-managed key
33+
34+
### Create Service Principal for ACI
35+
36+
The first step is to ensure that your [Azure tenant](https://docs.microsoft.com/azure/active-directory/develop/quickstart-create-new-tenant) has a service principal assigned for granting permissions to the Azure Container Instances service.
37+
38+
The following CLI command will set up the ACI SP in your Azure environment:
39+
40+
```azurecli-interactive
41+
az ad sp create --id 6bb8e274-af5d-4df2-98a3-4fd78b4cafd9
42+
```
43+
44+
The output from running this command should show you a service principal that has been set up with "displayName": "Azure Container Instance Service."
45+
46+
### Create a Key Vault resource
47+
48+
Create an Azure Key Vault using [Azure portal](https://docs.microsoft.com/azure/key-vault/quick-create-portal#create-a-vault), [CLI](https://docs.microsoft.com/azure/key-vault/quick-create-cli), or [PowerShell](https://docs.microsoft.com/azure/key-vault/quick-create-powershell).
49+
50+
For the properties of your key vault, use the following guidelines:
51+
* Name: A unique name is required.
52+
* Subscription: Choose a subscription.
53+
* Under Resource Group, either choose an existing resource group, or create new and enter a resource group name.
54+
* In the Location pull-down menu, choose a location.
55+
* You can leave the other options to their defaults or pick based on additional requirements.
56+
57+
> [!IMPORTANT]
58+
> 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.
59+
60+
### Generate a new key
61+
62+
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.
63+
64+
![Generate a new key](./media/container-instances-encrypt-data/generate-key.png)
65+
66+
### Set access policy
67+
68+
Create a new access policy for allowing the ACI service to access your Key.
69+
70+
* Once your key has been generated, back in your key vault resource blade, under Settings, click **Access Policies**.
71+
* On the "Access Policies" page for your key vault, click **Add Access Policy**.
72+
* Set the *Key Permissions* to include **Get** and **Unwrap Key**
73+
![Set key permissions](./media/container-instances-encrypt-data/set-key-permissions.png)
74+
* For *Select Principal*, select **Azure Container Instance Service**
75+
* Click **Add** at the bottom
76+
77+
The access policy should now show up in your key vault's access policies.
78+
79+
![New access policy](./media/container-instances-encrypt-data/access-policy.png)
80+
81+
### Modify your JSON deployment template
82+
83+
> [!IMPORTANT]
84+
> Encrypting deployment data with a customer-managed key is available in the latest API version (2019-12-01) that is currently rolling out. Specify this API version in your deployment template. If you have any issues with this, please reach out to Azure Support.
85+
86+
Once the key vault key and access policy are set up, add the following property to your ACI deployment template. You can learn more about deploying ACI resources with a template in the [Tutorial: Deploy a multi-container group using a Resource Manager template](https://docs.microsoft.com/azure/container-instances/container-instances-multi-container-group).
87+
88+
Specifically, under the container group properties section of the deployment template, add an "encryptionProperties", which contains the following values:
89+
* vaultBaseUrl: the DNS Name of your key vault, can be found on the overview blade of the key vault resource in Portal
90+
* keyName: the name of the key generated earlier
91+
* 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)
92+
93+
94+
```json
95+
"resources": [
96+
{
97+
"name": "[parameters('containerGroupName')]",
98+
"type": "Microsoft.ContainerInstance/containerGroups",
99+
"apiVersion": "2019-12-01",
100+
"location": "[resourceGroup().location]",
101+
"properties": {
102+
"encryptionProperties": {
103+
"vaultBaseUrl": "https://example.vault.azure.net",
104+
"keyName": "acikey",
105+
"keyVersion": "xxxxxxxxxxxxxxxx"
106+
},
107+
"containers": {
108+
[...]
109+
}
110+
}
111+
}
112+
]
113+
```
114+
115+
### Deploy your resources
116+
117+
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.
118+
119+
Create a resource group with the [az group create][az-group-create] command.
120+
121+
```azurecli-interactive
122+
az group create --name myResourceGroup --location eastus
123+
```
124+
125+
Deploy the template with the [az group deployment create][az-group-deployment-create] command.
126+
127+
```azurecli-interactive
128+
az group deployment create --resource-group myResourceGroup --template-file deployment-template.json
129+
```
130+
131+
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.
132+
133+
<!-- LINKS - Internal -->
134+
[az-group-create]: /cli/azure/group#az-group-create
135+
[az-group-deployment-create]: /cli/azure/group/deployment#az-group-deployment-create
16 KB
Loading
36.1 KB
Loading
41 KB
Loading

includes/container-instances-limits.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ ms.author: danlep
77
---
88
| Resource | Default limit |
99
| --- | :--- |
10-
| Container groups per region per [subscription](../articles/billing-buy-sign-up-azure-subscription.md) | 100<sup>1</sup> |
10+
| Standard sku container groups per region per [subscription](../articles/billing-buy-sign-up-azure-subscription.md) | 100<sup>1</sup> |
11+
| Dedicated sku container groups per region per [subscription](../articles/billing-buy-sign-up-azure-subscription.md) | 0<sup>1</sup> |
1112
| Number of containers per container group | 60 |
1213
| Number of volumes per container group | 20 |
1314
| Ports per IP | 5 |

0 commit comments

Comments
 (0)