Last active
May 11, 2024 08:14
-
-
Save paulbatum/2b16c5f92351ed1c59e3a2b8a727ca97 to your computer and use it in GitHub Desktop.
Azure Functions pricing calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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