Skip to content

Instantly share code, notes, and snippets.

@paulbatum
Last active July 12, 2022 15:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save paulbatum/2b16c5f92351ed1c59e3a2b8a727ca97 to your computer and use it in GitHub Desktop.
Save paulbatum/2b16c5f92351ed1c59e3a2b8a727ca97 to your computer and use it in GitHub Desktop.
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