Monday, 27 May 2024

Batch pool with user assigned Managed Identity and Key Vault extension

 

Batch pool with user assigned Managed Identity and Key Vault extension

Azure PaaS Blog > Batch pool with user assigned Managed Identity and Key Vault extension https://techcommunity.microsoft.com/t5/azure-paas-blog/batch-pool-with-user-assigned-managed-identity-and-key-vault/ba-p/4058893

On Feb 29th, 2024, the certificate feature in Azure Batch Account will be retired. To continue using the certificate with Batch task, user will need to migrate the Batch account certificates to Azure Key Vault. But since there is not an existing example provided, that might be a little difficult.

This blog will mainly focus on providing an example about how to recreate the Batch pool with required user assigned Managed Identity and Key Vault extension. Currently the Batch pool with user assigned Managed Identity and extension is only supported by ARM template and REST API call. Creating a pool with extension is unsupported in Azure Portal. Creating a pool with user assigned Managed Identity is unsupported in Az PowerShell module and Azure CLI.

Pre-requisite:


To follow this blog, please prepare the following points:



JerryZhangMS_0-1708057692831.png


 



JerryZhangMS_1-1708057692836.png


 


 


Reminder:


In this blog, a sample Batch pool with the only necessary setup is created. If any additional feature is needed, please kindly modify the related part in ARM/bicep template or REST API request payload.

The pool created in this blog contains the following properties:

  • OS:  Windows Server 2019 Datacenter with latest version

  • Node Agent:  batch.node.windows amd64

  • Key Vault extension version 3.0: Install one certificate with thumbprint FDBB….F3A0 into LocalMachine/My certificate store

  • Scale: 1 fixed dedicated node

  • VM SKU:  standard_ds2_v2


The expected result:


Created pool’s node can be in a healthy status:


JerryZhangMS_2-1708057692840.png


 


And if we RDP into the node, we should be able to see the expected certificate saved into LocalMachine/My path:


JerryZhangMS_3-1708057692853.png


 


JerryZhangMS_4-1708057692867.png


 


 


Sample REST API call: (The parts in red need to be replaced by own resource information)


HTTP method: PUT


URLhttps://management.azure.com/subscriptions/{subscription ID}/resourceGroups/{resource group name}/providers/Microsoft.Batch/batchAccounts/{batch account name}/pools/{pool name}?api-version=2023-11-01


Request headers:  Authorization header with Microsoft Entra ID authentication Bearer token is required. Please refer to this document, or just simply search for API Playground in Azure Portal. The second way is easier because it will automatically generate the Authorization header.


JerryZhangMS_5-1708057692869.png


No comments:

Post a Comment