Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Azure Functions pricing calculation
const decimal executionCountCost = 0.20m / 1000000m;
const decimal gbSecCost = 0.000016m;
const decimal executionUnitsToGbSecConversion = 1m / (1024 * 1000);
long executionCountPerHour = 6500012;
long executionUnitsPerHour = 90305037184;
int runDurationDays = 9;
Console.WriteLine("All prices in USD");
decimal gbSecPerHour = executionUnitsPerHour * executionUnitsToGbSecConversion;
Console.WriteLine("GB-seconds per hour: " + Math.Round(gbSecPerHour, 0));
decimal costPerHour = (executionCountPerHour * executionCountCost) + (gbSecPerHour * gbSecCost);
Console.WriteLine("Cost per hour: $" + Math.Round(costPerHour,2));
decimal costPerDay = costPerHour * 24;
Console.WriteLine("Cost per day: $" + Math.Round(costPerDay, 2));
decimal totalCost = costPerDay * runDurationDays;
Console.WriteLine("Total run cost: $" + Math.Round(totalCost, 2));
All prices in USD
GB-seconds per hour: 88189
Cost per hour: $2.71
Cost per day: $65.06
Total run cost: $585.58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.