1
votes

Is it possible to tag the resources used from azure batch? I use the .NET SDK to create a batch pool, job and tasks. I'm wondering if I can tag the pool VM's that get created by the azure batch client. I looked through the properties and documentation and wasn't seeing anything obvious.

2

2 Answers

1
votes

Seems there is no way to tag the batch pool from .Net sdk but you can utilize Metadata Property for adding the information in key/value pair of CloudPool which will help you identifying the resources.

Gets or sets a list of name-value pairs associated with the pool as metadata.

 CloudPool.Metadata
    public System.Collections.Generic.IList<Microsoft.Azure.Batch.MetadataItem> Metadata { get; set; }

You can find more details here.

Also i would suggest you to create a resource group with tag and link all the resources in the same resource group.

Hope it helps.

0
votes

A Pool is an ARM resource (you can only add tags to ARM resources) so you should be able to get and update it with tags using the ARM SDK (https://docs.microsoft.com/en-us/dotnet/api/overview/azure/resource-manager?view=azure-dotnet)