|
2 | 2 | title: Authenticate Azure Batch services with Microsoft Entra ID
|
3 | 3 | description: Learn how to authenticate Azure Batch service applications with Microsoft Entra ID by using integrated authentication or a service principal.
|
4 | 4 | ms.topic: how-to
|
5 |
| -ms.date: 06/27/2024 |
| 5 | +ms.date: 12/11/2024 |
6 | 6 | ms.custom: has-adal-ref, subject-rbac-steps
|
7 | 7 | ---
|
8 | 8 |
|
9 | 9 | # Authenticate Azure Batch services with Microsoft Entra ID
|
10 | 10 |
|
11 |
| -Azure Batch supports authentication with [Microsoft Entra ID](/azure/active-directory/fundamentals/active-directory-whatis), Microsoft's multi-tenant cloud based directory and identity management service. Azure uses Microsoft Entra ID to authenticate its own customers, service administrators, and organizational users. |
| 11 | +Azure Batch supports authentication with [Microsoft Entra ID](/azure/active-directory/fundamentals/active-directory-whatis), Microsoft's multitenant cloud based directory and identity management service. Azure uses Microsoft Entra ID to authenticate its own customers, service administrators, and organizational users. |
12 | 12 |
|
13 | 13 | This article describes two ways to use Microsoft Entra authentication with Azure Batch:
|
14 | 14 |
|
@@ -95,82 +95,18 @@ Follow these steps to create and copy the secret key to use in your code:
|
95 | 95 |
|
96 | 96 | ### Assign Azure RBAC to your application
|
97 | 97 |
|
98 |
| -Follow these steps to assign an Azure RBAC role to your application. For detailed steps, see [Assign Azure roles by using the Azure portal](/azure/role-based-access-control/role-assignments-portal). |
| 98 | +Follow these steps to assign an Azure RBAC role to your application. For more information, see [Role-based access control for Azure Batch service](./batch-role-based-access-control.md). |
99 | 99 |
|
100 | 100 | 1. In the Azure portal, navigate to the Batch account your application uses.
|
101 | 101 | 1. Select **Access control (IAM)** from the left navigation.
|
102 | 102 | 1. On the **Access control (IAM)** page, select **Add role assignment**.
|
103 |
| -1. On the **Add role assignment** page, select the **Role** tab, and then select either the [Contributor](/azure/role-based-access-control/built-in-roles#contributor) or [Reader](/azure/role-based-access-control/built-in-roles#reader) role for your app. |
| 103 | +1. On the **Add role assignment** page, select the **Role** tab, and then select one of [Azure Batch built-in RBAC roles](./batch-role-based-access-control.md#azure-batch-built-in-rbac-roles) the role for your app. |
104 | 104 | 1. Select the **Members** tab, and select **Select members** under **Members**.
|
105 | 105 | 1. On the **Select members** screen, search for and select your application, and then select **Select**.
|
106 | 106 | 1. Select **Review + assign** on the **Add role assignment** page.
|
107 | 107 |
|
108 | 108 | Your application should now appear on the **Role assignments** tab of the Batch account's **Access control (IAM)** page.
|
109 | 109 |
|
110 |
| -### Assign a custom role |
111 |
| - |
112 |
| -A custom role grants granular permission to a user for submitting jobs, tasks, and more. You can use custom roles to prevent users from performing operations that affect cost, such as creating pools or modifying nodes. |
113 |
| - |
114 |
| -You can use a custom role to grant or deny permissions to a Microsoft Entra user, group, or service principal for the following Azure Batch RBAC operations: |
115 |
| - |
116 |
| -- Microsoft.Batch/batchAccounts/pools/write |
117 |
| -- Microsoft.Batch/batchAccounts/pools/delete |
118 |
| -- Microsoft.Batch/batchAccounts/pools/read |
119 |
| -- Microsoft.Batch/batchAccounts/jobSchedules/write |
120 |
| -- Microsoft.Batch/batchAccounts/jobSchedules/delete |
121 |
| -- Microsoft.Batch/batchAccounts/jobSchedules/read |
122 |
| -- Microsoft.Batch/batchAccounts/jobs/write |
123 |
| -- Microsoft.Batch/batchAccounts/jobs/delete |
124 |
| -- Microsoft.Batch/batchAccounts/jobs/read |
125 |
| -- Microsoft.Batch/batchAccounts/certificates/write |
126 |
| -- Microsoft.Batch/batchAccounts/certificates/delete |
127 |
| -- Microsoft.Batch/batchAccounts/certificates/read |
128 |
| -- Microsoft.Batch/batchAccounts/read, for any read operation |
129 |
| -- Microsoft.Batch/batchAccounts/listKeys/action, for any operation |
130 |
| - |
131 |
| -Custom roles are for users authenticated by Microsoft Entra ID, not for the Batch shared key account credentials. The Batch account credentials give full permission to the Batch account. Jobs that use [autopool](nodes-and-pools.md#autopools) require pool-level permissions. |
132 |
| - |
133 |
| -> [!NOTE] |
134 |
| -> Certain role assignments need to be specified in the `actions` field, whereas others need to be specified in the `dataActions` field. For more information, see [Azure resource provider operations](/azure/role-based-access-control/resource-provider-operations#microsoftbatch). |
135 |
| -
|
136 |
| -The following example shows an Azure Batch custom role definition: |
137 |
| - |
138 |
| -```json |
139 |
| -{ |
140 |
| - "properties":{ |
141 |
| - "roleName":"Azure Batch Custom Job Submitter", |
142 |
| - "type":"CustomRole", |
143 |
| - "description":"Allows a user to submit jobs to Azure Batch but not manage pools", |
144 |
| - "assignableScopes":[ |
145 |
| - "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e" |
146 |
| - ], |
147 |
| - "permissions":[ |
148 |
| - { |
149 |
| - "actions":[ |
150 |
| - "Microsoft.Batch/*/read", |
151 |
| - "Microsoft.Authorization/*/read", |
152 |
| - "Microsoft.Resources/subscriptions/resourceGroups/read", |
153 |
| - "Microsoft.Support/*", |
154 |
| - "Microsoft.Insights/alertRules/*" |
155 |
| - ], |
156 |
| - "notActions":[ |
157 |
| - |
158 |
| - ], |
159 |
| - "dataActions":[ |
160 |
| - "Microsoft.Batch/batchAccounts/jobs/*", |
161 |
| - "Microsoft.Batch/batchAccounts/jobSchedules/*" |
162 |
| - ], |
163 |
| - "notDataActions":[ |
164 |
| - |
165 |
| - ] |
166 |
| - } |
167 |
| - ] |
168 |
| - } |
169 |
| -} |
170 |
| -``` |
171 |
| - |
172 |
| -For more information on creating a custom role, see [Azure custom roles](../role-based-access-control/custom-roles.md). |
173 |
| - |
174 | 110 | ## Code examples
|
175 | 111 |
|
176 | 112 | The code examples in this section show how to authenticate with Microsoft Entra ID by using integrated authentication or with a service principal. The code examples use .NET and Python, but the concepts are similar for other languages.
|
|
0 commit comments