Azure – Pricing of time triggered Azure functions: What storage gets charged

azure

I cannot find definitive info on how much hosting a function (in C#) on Azure costs. Suppose I have nothing else running on azure, just a function that runs for 1 s and runs every hour and consumes only 1 MB of RAM (the first category is 128 MB as I have understood), how much costs that total including anything else I might need to make azure function run (the smallest consumption plan maybe?) per month? Are there soem monthly fix costs independently of usage? Is the total something below say $5/month? What alternatives do I have for $5 per month?

EDIT

Due to the lack of valuable replies I just thought I take the risk and I tried it out. After one day I am charged $0.01 for standard IO (sorry it's in German):

standard IO

I am not charged for the function itselt because it is less that the free grant. Can someone explain to me what storage (blob? files? tables? queues?) I am using when I am executing the following function? The function checks to see if a pdf is available for download by trying to download just the first byte of it.

public static void Run(TimerInfo myTimer, TraceWriter log)
{
  DateTime start = DateTime.Now;
  log.Info("-------------------------------------------");     
  log.Info($"C# Timer trigger function executed at: {start}");

  string[] urls = { "http://www.somewhere.com/foo.pdf", "http://www.somewhere.com/bar.pdf" };

  for (int i = 0; i < urls.Length; i++)
  {
    bool hasContent = HasWebPageContent(uri);
    string output = $"Exists {file} = {hasContent}";
    log.Info(output);
  }

  log.Info($"C# Timer trigger function execution ended and ran for {DateTime.Now.Subtract(start).TotalMilliseconds} ms.");
}

private static bool HasWebPageContent(string url)
{
  HttpWebRequest request;
  const int bytesToGet = 1;
  request = WebRequest.Create(url) as HttpWebRequest;
  var buffer = new char[bytesToGet];

  try
  {
    using (WebResponse response = request.GetResponse())
    {
      using (StreamReader sr = new StreamReader(response.GetResponseStream()))
      {
        sr.Read(buffer, 0, bytesToGet);
      }
    }
  }
  catch { return false; }

  return true;
}

Best Answer

The formula for Azure Functions cost per month is simple:

Memory Size X Execution Time x Executions/Mo

if Memory Size X Execution Time < 400,000 GB/s = Free

and

if Execution Time X Executions/Mo < 1,000,000 = Free

So for your particular case, 128MB x 1s x 1/Mo = Free

For $5 you can get memory as high as 1024MB, 1000s of execution time and run it more than 700 times a month.

Please refer to the Pricing Calculator to get a better estimate.

Related Topic