How to Use Azure Logic Apps (formerly Azure Scheduler) to Reduce Resource Costs

Azure Scheduler was a service offered by Microsoft Azure that allowed you to create and run jobs in the cloud describing specific tasks or actions to be performed. Microsoft announced its retirement in December 2019 and has replaced it with Azure Logic Apps, a managed cloud service that runs in a company’s public cloud and helps users introduce scalable, cloud-based integrations and workflows to business processes. 

Azure Scheduler offered the capability to create jobs in the cloud that invoke services inside and outside of Azure such as calling HTTP/S endpoints or posting messages to Azure Storage queues, or Azure Service Bus queues or topics. 

Some typical Scheduler actions included:

  • Running recurring app actions: For example, periodically collect data from Twitter into a feed.
  • Performing daily maintenance: Such as pruning logs daily, performing backups, and other maintenance tasks.
  • If you are an administrator then you might use Scheduler to back up your database at 1:00 AM every day for the next nine months.

 

There are other Azure scheduling capabilities that use Scheduler in the background, for example, Azure WebJobs, which is a Web Apps feature in Azure App Service. You could manage communication for those actions by using the Scheduler REST API, which helped manage the communication for the actions. Note: Scheduler is no longer available in the Azure portal, but the REST API and Azure Scheduler PowerShell cmdlets remain available so that you can still manage your jobs and job collections.

Although you could use Azure Scheduler to create, maintain, and run scheduled workloads, Scheduler did not host the workloads or run code. The service only invoked the services or code hosted elsewhere, for example, in Azure, on-premises, or with another provider. 

But now, to continue working with the jobs that you would have set up in Azure Scheduler, Microsoft requires that you migrate to Azure Logic Apps to be able to continue running them. 

And, before you start to migrate from Azure Schedule to Azure Logic Apps, you are required to have an Azure subscription, and the Postman desktop app to trigger Azure Logic Apps by sending HTTP requests. 

Using Azure Logic Apps

Azure Logic Apps helps you schedule, automate, and orchestrate tasks, business processes, and workflows when you need to integrate apps, data, systems, and services across enterprises or organizations. 

Azure Logic Apps simplifies how you design and build scalable solutions for app integration, data integration, system integration, enterprise application integration, and business-to-business communication, whether in the cloud, on-premises, or both. You can also call Azure Functions and treat them as proper APIs. 

When you schedule a one-time and recurring jobs by creating automated workflows with Azure Logic Apps, rather than with Azure Scheduler, you get to:

  • Build jobs by using a visual designer and ready-to-use connectors from hundreds of services, such as Azure Blob Storage, Azure Service Bus, Office 365 Outlook, and SAP.
  • Manage each scheduled workflow as an Azure resource. Each logic app is an individual Azure resource, so no need to worry about the concept of a job collection.
  • You can run multiple one-time jobs by using a single logic app.
  • Set schedules that support time zones and automatically adjust to daylight savings time.

Azure Logic Apps Architecture

Azure Logic Apps comprises the following components: 

  • Workflows – Used to model your business process 
  • Managed Connectors – Connect to and work with the data provided for the workflow
  • Triggers – Initiate the workflow
  • Actions – Are the steps within the workflow

There are several types of triggers:

  • Poll triggers –  poll a service at frequent intervals of time to check for new data.
  • Push triggers: listen for new data or an event occurrence and then creates a new instance of the Azure Logic App workflow.
  • Recurrence triggers: instantiate an Azure Logic App workflow based on a predefined schedule.

Scheduling Jobs in Azure Logic Apps

Azure Logic Apps uses connectors to perform certain actions or processes. These connectors are designed to connect and work with user data. Users can use pre-defined connectors as well as create their own custom connectors. You can define connectors using ARM templates. Connectors in Azure Logic Apps may act either as actions or as triggers.

The triggers start the workflow that will fire when new data or event that meets the trigger condition occurs. Connectors themselves provide various triggers. Custom triggers can also be created using custom connectors. Users can also define multiple triggers in a Logic App. In general, triggers are of two types:

  • Built-in triggers – predefined triggers using Http protocol and schedule for triggering the Logic Apps.
  • Managed API triggers – are based on the API connections / API Webhook connections which check an endpoint using custom connectors.

For the actions, these are the steps that will run once the trigger is initiated to complete the workflow. These are performed based on the data provided by the end-user.  

To regularly run tasks, processes, or jobs on a specific schedule, you can start your logic app workflow with the built-in Recurrence – Schedule trigger. You can run them immediately and repeat them based on any number of designated parameters, such as: 

  • Seconds, minutes, hours, days, weeks, or months.
  • A specific date and time, then run and repeat by seconds, minutes, hours, days, weeks, or months.
  • Specific times of the day, for example, at 8:00 AM and 5:00 PM.
  • Specific days of the week, like Monday, Tuesday or Wednesday 

To make sure that your logic app doesn’t miss a recurrence, especially when the frequency is in days or longer, You need to specify advanced scheduling options, because future recurrences are based on the last run time and they might drift due to factors such as latency during storage calls.

Pricing: Pay-Per-Usage Billing 

Azure Logic Apps is a serverless engine that uses a pay-per-usage billing model. You only pay for each action that gets executed. However, it’s important to be aware that you will need to pay for polling triggers. 

If you want to benefit from the capabilities of the Integration Account, you should be aware that this comes with a fixed monthly bill for built-in actions. Additional Enterprise connectors will be charged based upon the Enterprise consumption price.

Using Programmatic Tasks to Reduce Other Azure Costs

Did you know that more than $11 billion will be wasted on idle cloud resources this year alone? That is – non-production VMs, databases, and other resources running on nights and weekends when no one is using them.

That’s why a common use case for scheduled tasks is to turn resources off outside of working hours. This can save 65% of the cost of these resources. You can use recurring, scheduled triggers to turn resources on and off. 

Maximizing Savings

However, once you start creating rule sets to turn resources off based on such triggers, you now need to maintain what is essentially a new app. Now you need to figure out how to apply it to new resources. And what if your users need to access those resources when they’re scheduled to be turned off? Is proper governance in place for these on/off mechanisms?

Once you start looking for swaths of your cloud bill that are wasted on unnecessary resources, you’ll find other areas that are not so easily addressed, such as rightsizing oversized resources and deleting unnecessary storage. 

ParkMyCloud created a platform to manage these cost optimization tasks for you – without the overhead of triggered tasks. It can assign schedules automatically, provides user governance, has a simple schedule override method, provides an easy-to-use UI, covers multiple accounts and cloud providers, offers robust reporting – and importantly, goes beyond simply scheduling. With your utilization data as a basis, ParkMyCloud discovers resources that can be rightsized, as well as unnecessary volumes/snapshots, and more.

Then, try it out with a free 14-day trial. After fourteen days, you can continue to use ParkMyCloud free of charge with limited features, or upgrade to standard or pro-tier – both offer premium feature-rich packages. Let ParkMyCloud’s automation do the work and get your Azure resource costs under control.