Skip to content

Commit 58de834

Browse files
author
Jill Grant
authored
Merge pull request #284220 from alfpark/alpark/batch
Add Batch account key rotation guide
2 parents 63e0233 + 6b1574c commit 58de834

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

articles/batch/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@
145145
href: batch-customer-managed-key.md
146146
- name: Move between regions
147147
href: account-move.md
148+
- name: Rotate Batch account keys
149+
href: account-key-rotation.md
148150
- name: Authenticate with Microsoft Entra ID
149151
items:
150152
- name: Microsoft Entra ID with Batch service
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Rotate Batch account keys
3+
description: Learn how to rotate Batch account shared key credentials.
4+
ms.topic: how-to
5+
ms.date: 08/09/2024
6+
---
7+
# Batch account shared key credential rotation
8+
9+
Batch accounts can be authenticated in one of two ways, either via shared key or Microsoft Entra ID. Batch accounts
10+
with shared key authentication enabled have two keys associated with them to allow for key rotation scenarios.
11+
12+
> [!TIP]
13+
> It's highly recommended to avoid using shared key authentication with Batch accounts. The preferred authentication
14+
> mechanism is through Microsoft Entra ID. You can disable shared key authentication during account creation or you
15+
> can update allowed [Authentication Modes](/rest/api/batchmanagement/batch-account/create#authenticationmode) for an
16+
> active account.
17+
18+
## Batch shared key rotation procedure
19+
20+
Azure Batch accounts have two shared keys, `primary` or `secondary`. It's important not to regenerate both
21+
keys at the same time, and instead regenerate them one at a time to avoid potential downtime.
22+
23+
> [!WARNING]
24+
> Once a key has been regenerated, it is no longer valid and the prior key cannot be recovered for use. Ensure
25+
> that your application update process follows the recommended key rotation procedure to prevent losing access
26+
> to your Batch account.
27+
28+
The typical key rotation procedure is as follows:
29+
30+
1. Normalize your application code to use either the primary or secondary key. If you're using both keys in your
31+
application simultaneously, then any rotation procedure leads to authentication errors. The following steps assume
32+
that you're using the `primary` key in your application.
33+
1. Regenerate the `secondary` key.
34+
1. Update your application code to utilize the newly regenerated `secondary` key. Deploy these changes and
35+
ensure that everything is working as expected.
36+
1. Regenerate the `primary` key.
37+
1. Optionally update your application code to use the `primary` key and deploy. This step isn't strictly
38+
necessary as long as you're tracking which key is used in your application and deployed.
39+
40+
### Rotation in Azure portal
41+
42+
First, sign in to the [Azure portal](https://portal.azure.com). Then, navigate to the **Keys** blade of your
43+
Batch account under **Settings**. Then select either `Regenerate primary` or `Regenerate secondary` to create a new key.
44+
45+
:::image type="content" source="media/account-key-rotation/batch-account-key-rotation.png" alt-text="Screenshot showing key rotation.":::
46+
47+
## See also
48+
49+
- Learn more about [Batch accounts](accounts.md).
50+
- Learn how to authenticate with [Batch Service APIs](batch-aad-auth.md)
51+
or [Batch Management APIs](batch-aad-auth-management.md) with Microsoft Entra ID.

articles/batch/batch-aad-auth-management.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.date: 04/27/2017
66
ms.custom: has-adal-ref, devx-track-csharp, devx-track-arm-template, devx-track-dotnet
77
---
88

9-
# Authenticate Batch Management solutions with Active Directory
9+
# Authenticate Batch Management solutions with Microsoft Entra ID
1010

11-
Applications that call the Azure Batch Management service authenticate with [Microsoft Authentication Library](../active-directory/develop/msal-overview.md) (Microsoft Entra ID). Microsoft Entra ID is Microsoft's multi-tenant cloud based directory and identity management service. Azure itself uses Microsoft Entra ID for the authentication of its customers, service administrators, and organizational users.
11+
Applications that call the Azure Batch Management service authenticate with [Microsoft Authentication Library](../active-directory/develop/msal-overview.md) (Microsoft Entra ID). Microsoft Entra ID is Microsoft's multitenant cloud based directory and identity management service. Azure itself uses Microsoft Entra ID for the authentication of its customers, service administrators, and organizational users.
1212

1313
The Batch Management .NET library exposes types for working with Batch accounts, account keys, applications, and application packages. The Batch Management .NET library is an Azure resource provider client, and is used together with [Azure Resource Manager](../azure-resource-manager/management/overview.md) to manage these resources programmatically. Microsoft Entra ID is required to authenticate requests made through any Azure resource provider client, including the Batch Management .NET library, and through Azure Resource Manager.
1414

40.7 KB
Loading

0 commit comments

Comments
 (0)