.Net application development specialists
asp.net, c#, vb.net, html, javascript, jquery, html, xhtml, css, oop, design patterns, sql server, mvc and much more
contact: admin@paxium.co.uk

Paxium is the company owned by myself, Dave Amour and used for providing IT contract development services including


  • Application development - Desktop, Web, Services - with Classic ASP, Asp.net WebForms, Asp.net MVC, Asp.net Core
  • Html, Css, JavaScript, jQuery, React, C#, SQL Server, Ado.net, Entity Framework, NHibernate, TDD, WebApi, GIT, IIS
  • Database schema design, implementation & ETL activities
  • Website design and hosting including email hosting
  • Training - typically one to one sessions
  • Reverse Engineering and documentation of undocumented systems
  • Code Reviews
  • Performance Tuning
  • Located in Cannock, Staffordshire
Rugeley Chess Club Buying Butler Cuckooland Katmaid Pet Sitting Services Roland Garros 60 60 Golf cement Technical Conformity Goofy MaggieBears Vacc Track Find Your Smart Phone eBate Taylors Poultry Services Lafarge Rebates System Codemasters Grid Game eBate DOFF

CRON in Azure Functions: Why use */5 instead of 5?

In an Azure Functions CRON expression, each position represents a unit of time, for example: seconds minutes hours day month day-of-week. The asterisk (*) and step syntax (*/5) have different meanings:

This one - 0 */5 * * * * - would mean every minute that is divisible by 5 (00, 05, 10, 15, …) when the seconds is zero.

This one - 10 */2 * * * * - would mean every minute that is divisible by 2 when the seconds is 10. So if you started it at 7:49 it would run at 7:50:10 and then 7:52:10 and 7:54:10

The one below is tricky and would mean every second of every minute that is divisible by 5 (00, 05, 10, 15, …).

What * means

The asterisk (*) means “every possible value” for that field. For example:

  • * in the minutes field = every minute
  • * in the hours field = every hour
  • * in the day-of-week field = every day of the week

What */5 means

The pattern */5 is a step value and means “every 5 units” for that field, starting at 0. For example:

  • */5 in the minutes field = 0, 5, 10, 15, 20, …, 55
  • */2 in the hours field = 0:00, 2:00, 4:00, …, 22:00

What plain 5 means

A plain number like 5 means “only when the value is exactly 5” for that field, not “every 5 units.” For example:

  • 5 in the minutes field = only when minute = 5 (e.g. 12:05, 13:05, 14:05)
  • 5 in the hours field = only when hour = 5 (e.g. 05:00)

Concrete examples in Azure Functions


// Every 5 minutes (at second 0)
[TimerTrigger("0 */5 * * * *")]
public void RunEveryFiveMinutes() { }

// Once per hour, at minute 5 (e.g. 12:05, 13:05...)
[TimerTrigger("0 5 * * * *")]
public void RunAtMinuteFiveEachHour() { }
        
    

This one - * */5 * * * * - would mean Every second of every minute that is divisible by 5 (00, 05, 10, 15, …).

If you have one running at certain times but want it to also run at startup for ease of testing, you can add RunOnStartup = true as below

Summary: use */5 when you want a repeating interval (every 5 units). Use plain 5 when you want a specific value (only when the field equals 5).