Skip to content

Commit f75494a

Browse files
authored
Update managed-identity-pools.md
1 parent 816ecd8 commit f75494a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

articles/batch/managed-identity-pools.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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: 08/12/2024
5+
ms.date: 12/23/2024
66
ms.devlang: csharp
77
ms.custom:
88
---
@@ -13,6 +13,10 @@ complicated identity and credential management by providing an identity for the
1313
(Azure AD ID). This identity is used to obtain Microsoft Entra tokens to authenticate with target
1414
resources in Azure.
1515

16+
When adding a User-Assigned Managed Identity to a Batch Pool, it is crucial to set the *Identity* property in your configuration. This property links the managed identity to the pool, enabling it to access Azure resources securely. Incorrect setting of the *Identity* property can result in common errors, such as access issues or upload errors.
17+
18+
For more information on configuring managed identities in Azure Batch, please refer to the [Azure Batch Managed Identities documentation](https://learn.microsoft.com/en-us/troubleshoot/azure/hpc/batch/use-managed-identities-azure-batch-account-pool).
19+
1620
This topic explains how to enable user-assigned managed identities on Batch pools and how to use managed identities within the nodes.
1721

1822
> [!IMPORTANT]
@@ -106,6 +110,23 @@ ArmOperation<BatchAccountPoolResource> armOperation = batchAccount.GetBatchAccou
106110
BatchAccountPoolResource pool = armOperation.Value;
107111
```
108112

113+
> [!NOTE]
114+
> To include the *Identity* property use the following example code:
115+
```csharp
116+
var pool = batchClient.PoolOperations.CreatePool(
117+
poolId: "myPool",
118+
virtualMachineSize: "STANDARD_D2_V2",
119+
cloudServiceConfiguration: new CloudServiceConfiguration(osFamily: "4"),
120+
targetDedicatedNodes: 1,
121+
identity: new PoolIdentity(
122+
type: PoolIdentityType.UserAssigned,
123+
userAssignedIdentities: new Dictionary<string, UserAssignedIdentity>
124+
{
125+
{ "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}", new UserAssignedIdentity() }
126+
}
127+
));
128+
```
129+
109130
## Use user-assigned managed identities in Batch nodes
110131

111132
Many Azure Batch functions that access other Azure resources directly on the compute nodes, such as Azure Storage or

0 commit comments

Comments
 (0)