How can I record a unique client / project identifier when using batch?

Chris 1 Reputation point
2021-01-27T07:22:38.737+00:00

Hi, we have a single batch account and want to use it for a number of different client engagements so when we set jobs off we would like to somehow tag the Azure costs associated with that job to a specific client / engagement so that when we extract the costs to bill them to a client I can apportion the costs accordingly.
E.g. we'd like to tag a job with E006 and then that tag is somehow associated with the billing data that I extract out of Azure.
Any ideas appreciated, thanks

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
320 questions
{count} votes

1 answer

Sort by: Most helpful
  1. prmanhas-MSFT 17,901 Reputation points Microsoft Employee
    2021-01-29T10:24:06.307+00:00

    @Chris Apologies for the delay in response and all the inconvenience caused because of the issue.

    Below is the information shared by our internal team:

    • There are currently no Batch-specific costs or billing meters, customers are billed for the cost of the underlying resources consumed by pools – mainly compute, but also networking and storage. No cost or billing meter for jobs.
    • There is currently some integration with Azure Cost Management and Billing for Batch pools:

    o Batch accounts/pools are resources that can be used to analyze use, create budgets, create alerts, etc.
    o We will be adding the ability for Azure Tags to be associated with Batch pools in the next few months. Will enable teams, project names, etc. to be associated with pools to better cater for chargeback and usage/cost tracking scenarios. Also, consistent with other Azure services which support tagging.

    • Customer could use a pool per client/engagement – would be worth checking if that would work for them. We have customers doing this (pool per customers) and other customers who have a Batch account per customer.

    • Jobs are tricky as there are no billing meters or underlying costs associated with them. Jobs will only ever account for a subset of the cost for a pool as there are times when the pool has no jobs running or is not fully utilized.

    • One option I’m considering is making it easy to get usage and cost info for jobs via Log Analytics.
    o Be able to add tags to jobs, then use execution time of all tasks, number of slots on pool, and pool VM cost to determine execution time and a cost of job tasks (job prep tasks, job tasks, job release tasks).
    o Be able to have queries and charts in the portal to analyze and chart job data, with ability to filter by job tags.
    o Having job usage information available, together with information for the whole pool, will allow pool efficiency to be determined and can drive efficiency updates; e.g. better auto-scale formula.
    o It may be possible to get basic job costs currently by using existing Task Complete Events with Log Analytics – use a naming convention to identify all tasks for a client, add up the task execution times (end time – start time), multiply by the cost of the VM being used for the pool (manually add to query), divide by the number of slots configured on the pool. Likely VERY painful to do, but we may choose to make this much easier with more and richer events, tags on jobs, plus pre-supplied queries.

    •We’ll also see if Cost Management and Billing can be used for jobs, but I believe that relies of billing meters for ARM resources – jobs aren’t currently ARM resources and do not have meters.

    •We could, in theory, add a pool configuration that hid underlying pool resources from customers in our subscriptions and Batch just billed for job/task execution, not the underlying resources. Similar to Functions. Jobs would be ARM resources, we’d have job/task execution time meters, tags could be placed on jobs, and Cost Management and Billing could be used.

    In case you have any further queries do let me know so that I can connect you with our internal team for further discussion.

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    1 person found this answer helpful.