Skip to content

Commit e3872cc

Browse files
committed
Clarify Batch managed identity
- Resolves https://github.com/MicrosoftDocs/azure-docs/issues/92951
1 parent 4adde57 commit e3872cc

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

articles/batch/batch-customer-managed-key.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Configure customer-managed keys for your Azure Batch account with Azure Key Vault and Managed Identity
33
description: Learn how to encrypt Batch data using customer-managed keys.
44
ms.topic: how-to
5-
ms.date: 02/27/2023
5+
ms.date: 04/03/2023
66
ms.devlang: csharp
77
ms.custom: devx-track-azurecli
88
---
@@ -27,6 +27,11 @@ customer-managed keys at Batch account creation, as shown next.
2727

2828
If you don't need a separate user-assigned managed identity, you can enable system-assigned managed identity when you create your Batch account.
2929

30+
> [!IMPORTANT]
31+
> A system-assigned managed identity created for a Batch account for customer data encryption as described in this document
32+
> cannot be used as a [user-assigned managed identity on a Batch pool](managed-identity-pools.md). If you wish to use the
33+
> same managed identity on both the Batch account and Batch pool, then use a common user-assigned managed identity instead.
34+
3035
### Azure portal
3136

3237
In the [Azure portal](https://portal.azure.com/), when you create Batch accounts, pick **System assigned** in the identity type under the **Advanced** tab.
@@ -202,7 +207,7 @@ az batch account set \
202207
- **Can I disable customer-managed keys?** You can set the encryption type of the Batch Account back to "Microsoft managed key" at any time. You're free to delete or change the key afterwards.
203208
- **How can I rotate my keys?** Customer-managed keys aren't automatically rotated unless the [key is versionless with an appropriate key rotation policy set within Key Vault](../key-vault/keys/how-to-configure-key-rotation.md). To manually rotate the key, update the Key Identifier that the account is associated with.
204209
- **After I restore access how long will it take for the Batch account to work again?** It can take up to 10 minutes for the account to be accessible again once access is restored.
205-
- **While the Batch Account is unavailable what happens to my resources?** Any pools that are running when Batch access to the customer-managed key is lost will continue to run. However, the nodes in these pools will transition into an unavailable state, and tasks will stop running (and be requeued). Once access is restored, nodes become available again, and tasks are restarted.
210+
- **While the Batch Account is unavailable what happens to my resources?** Any pools that are active when Batch access to the customer-managed key is lost will continue to run. However, the nodes in these pools will transition into an unavailable state, and tasks will stop running (and be requeued). Once access is restored, nodes become available again, and tasks are restarted.
206211
- **Does this encryption mechanism apply to VM disks in a Batch pool?** No. For Cloud Services Configuration pools (which are [deprecated](https://azure.microsoft.com/updates/azure-batch-cloudserviceconfiguration-pools-will-be-retired-on-29-february-2024/)), no encryption is applied for the OS and temporary disk. For Virtual Machine Configuration pools, the OS and any specified data disks are encrypted with a Microsoft platform managed key by default. Currently, you can't specify your own key for these disks. To encrypt the temporary disk of VMs for a Batch pool with a Microsoft platform managed key, you must enable the [diskEncryptionConfiguration](/rest/api/batchservice/pool/add#diskencryptionconfiguration) property in your [Virtual Machine Configuration](/rest/api/batchservice/pool/add#virtualmachineconfiguration) Pool. For highly sensitive environments, we recommend enabling temporary disk encryption and avoiding storing sensitive data on OS and data disks. For more information, see [Create a pool with disk encryption enabled](./disk-encryption.md)
207212
- **Is the system-assigned managed identity on the Batch account available on the compute nodes?** No. The system-assigned managed identity is currently used only for accessing the Azure Key Vault for the customer-managed key. To use a user-assigned managed identity on compute nodes, see [Configure managed identities in Batch pools](managed-identity-pools.md).
208213

articles/batch/managed-identity-pools.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
title: Configure managed identities in Batch pools
33
description: Learn how to enable user-assigned managed identities on Batch pools and how to use managed identities within the nodes.
44
ms.topic: conceptual
5-
ms.date: 04/18/2022
5+
ms.date: 04/03/2023
66
ms.devlang: csharp
77
---
88
# Configure managed identities in Batch pools
99

10-
[Managed identities for Azure resources](../active-directory/managed-identities-azure-resources/overview.md) eliminate the need for developers having to manage credentials by providing an identity for the Azure resource in Azure Active Directory (Azure AD) and using it to obtain Azure Active Directory (Azure AD) tokens.
10+
[Managed identities for Azure resources](../active-directory/managed-identities-azure-resources/overview.md) eliminate
11+
complicated identity and credential management by providing an identity for the Azure resource in Azure Active Directory
12+
(Azure AD). This identity is used to obtain Azure Active Directory (Azure AD) tokens to authenticate with target
13+
resources in Azure.
1114

1215
This topic explains how to enable user-assigned managed identities on Batch pools and how to use managed identities within the nodes.
1316

@@ -16,12 +19,14 @@ This topic explains how to enable user-assigned managed identities on Batch pool
1619
>
1720
> Creating pools with managed identities can be done by using the [Batch .NET management library](/dotnet/api/overview/azure/batch#management-library), but is not currently supported with the [Batch .NET client library](/dotnet/api/overview/azure/batch#client-library).
1821
19-
## Create a user-assigned identity
22+
## Create a user-assigned managed identity
2023

21-
First, [create your user-assigned managed identity](../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md) in the same tenant as your Batch account. You can create the identity using the Azure portal, the Azure Command-Line Interface (Azure CLI), PowerShell, Azure Resource Manager, or the Azure REST API. This managed identity does not need to be in the same resource group or even in the same subscription.
24+
First, [create your user-assigned managed identity](../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md) in the same tenant as your Batch account. You can create the identity using the Azure portal, the Azure Command-Line Interface (Azure CLI), PowerShell, Azure Resource Manager, or the Azure REST API. This managed identity doesn't need to be in the same resource group or even in the same subscription.
2225

2326
> [!IMPORTANT]
24-
> Identities must be configured as user-assigned managed identities. The system-assigned managed identity is available for retrieving [customer-managed keys from Azure KeyVault](batch-customer-managed-key.md), but these are not supported in batch pools.
27+
> A system-assigned managed identity created for a Batch account for [customer data encryption](batch-customer-managed-key.md)
28+
> cannot be used as a user-assigned managed identity on a Batch pool as described in this document. If you wish to use the same
29+
> managed identity on both the Batch account and Batch pool, then use a common user-assigned managed identity instead.
2530
2631
## Create a Batch pool with user-assigned managed identities
2732

@@ -38,7 +43,7 @@ To create a Batch pool with a user-assigned managed identity through the Azure p
3843
1. In the search bar, enter and select **Batch accounts**.
3944
1. On the **Batch accounts** page, select the Batch account where you want to create a Batch pool.
4045
1. In the menu for the Batch account, under **Features**, select **Pools**.
41-
1. In the **Pools** menu, select **Add** to add a new Batch pool.
46+
1. In the **Pools** menu, select **Add** to add a new Batch pool.
4247
1. For **Pool ID**, enter an identifier for your pool.
4348
1. For **Identity**, change the setting to **User assigned**.
4449
1. Under **User assigned managed identity**, select **Add**.
@@ -58,7 +63,7 @@ To create a Batch pool with a user-assigned managed identity with the [Batch .NE
5863
```csharp
5964
var poolParameters = new Pool(name: "yourPoolName")
6065
{
61-
VmSize = "standard_d1_v2",
66+
VmSize = "standard_d2_v3",
6267
ScaleSettings = new ScaleSettings
6368
{
6469
FixedScale = new FixedScaleSettings
@@ -71,10 +76,10 @@ var poolParameters = new Pool(name: "yourPoolName")
7176
VirtualMachineConfiguration = new VirtualMachineConfiguration(
7277
new ImageReference(
7378
"Canonical",
74-
"UbuntuServer",
75-
"18.04-LTS",
79+
"0001-com-ubuntu-server-jammy",
80+
"22_04-lts",
7681
"latest"),
77-
"batch.node.ubuntu 18.04")
82+
"batch.node.ubuntu 22.04")
7883
},
7984
Identity = new BatchPoolIdentity
8085
{
@@ -92,12 +97,14 @@ var pool = await managementClient.Pool.CreateWithHttpMessagesAsync(
9297
resourceGroupName: "yourResourceGroupName",
9398
accountName: "yourAccountName",
9499
parameters: poolParameters,
95-
cancellationToken: default(CancellationToken)).ConfigureAwait(false);
100+
cancellationToken: default(CancellationToken)).ConfigureAwait(false);
96101
```
97102

98103
## Use user-assigned managed identities in Batch nodes
99104

100-
Many Azure Batch technologies which access other Azure resources, such as Azure Storage or Azure Container Registry, support managed identities. For more information on using managed identities with Azure Batch, see the following links:
105+
Many Azure Batch functions that access other Azure resources directly on the compute nodes, such as Azure Storage or
106+
Azure Container Registry, support managed identities. For more information on using managed identities with Azure Batch,
107+
see the following links:
101108

102109
- [Resource files](resource-files.md)
103110
- [Output files](batch-task-output-files.md#specify-output-files-using-managed-identity)
@@ -111,7 +118,7 @@ Within the Batch nodes, you can get managed identity tokens and use them to auth
111118
For Windows, the PowerShell script to get an access token to authenticate is:
112119

113120
```powershell
114-
$Response = Invoke-RestMethod -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource={Resource App Id Url}' -Method GET -Headers @{Metadata="true"}
121+
$Response = Invoke-RestMethod -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource={Resource App Id Url}' -Method GET -Headers @{Metadata="true"}
115122
```
116123

117124
For Linux, the Bash script is:

0 commit comments

Comments
 (0)