Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created May 3, 2017 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/a10cc6c3f1c99131b3cbfe0a3996d6a8 to your computer and use it in GitHub Desktop.
Save justinyoo/a10cc6c3f1c99131b3cbfe0a3996d6a8 to your computer and use it in GitHub Desktop.
Know Your Cloud Resource Costs on Azure
namespace CostMonitoring.Functions
{
public static class CostMonitoringTimerTrigger
{
public static async void Run(TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
// Defines all dependencies to be injected.
...
// Aggregates all usage data.
var aggregator = new CostAggregationService(...);
await aggregator.ProcessAsync(dateStart, dateEnd).ConfigureAwait(false);
// Sends alerts/warnings to applied users.
var reminder = new CostReminderService(...);
await reminder.ProcessAsync(dateStart, dateEnd, options.RunEntirePeriod, ...).ConfigureAwait(false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment