PiCloud-like service on Azure? - azure

I'm looking for an execution environment on Windows Azure that is similar to PiCloud:
queued jobs
CPU charged in small increments (1ms in case of PiCloud)
Does anyone know of such a service?

Not off hand. Windows Azure is more like Amazon in that you get a dedicated VM with per hour pricing. I don't believe anyone has yet created a multi-tenant job processing framework on it with he ability to bill-back the time spent working on client jobs.
Sound like an interesting idea for a start-up though. :)

Related

How can I automatically scale up a VM, run a console app and scale down the VM Daily on Azure

I have this app that I need to execute on a specific Azure VM (GPU heavy) daily. I don't want to pay for the machine running 24/7 and I am looking for a way to automate this. What would be the best approach for this?
I am reading up on Azure Runbooks but I'm not 100% sure if this can be achieved. I was also thinking if scheduling an Azure Devops Pipeline to run and scale up the machine and execute the console app and then automatic scaling down of a machine if the CPU load is low.
This seems like a typical and basic scenario to which I cannot find an easy solution.
You can start/stop VMs on a schedule in Azure. You could also modify your app to shutdown the server as soon as it exits so the VM is running for least possible time (instead of waiting for the scheduled shutdown).

Saving on Azure billing cost with App Services?

I have a .NET Core application currently running as an Azure App Service, and I need it to do a lot of 'work' only about a few times a day. In order to save on the hourly billing, this is the solution I developed:
Using a runbook (Azure Automation): scale the App Service Plan to the 'Free' tier at 7:00 PM
Using a runbook (Azure Automation): scale the App Service Plan back up to the premium tier at 8:00 AM
Hard-code my .NET Core application to ensure it only does the heavy 'work' between 8:00 AM and 7:00 PM
This is fine as it saves me a significant portion of cost, as I'm only paying for the hours in which the App Service Plan is scaled up to the premium tier. However it is definitely not ideal.
My question is - what design pattern should I implement in order to accomplish what I'm trying to do? I need a lot of compute resources but only for a few hours out of the day. I know AWS has 'spot' instances that you can configure - is there a similar mechanism in Azure?
Ideally I could implement a solution that involves me only paying for those heavy compute resources when I actually need it (e.g.: a few times a day, while the sun is up)
Thank you for any insight and help!
EDIT in regards to the type of computation, my summary is essentially a few ML.NET trainers running in parallel with some moderate Elasticsearch document writing
It is pretty tough to answer this with the whole description of your workload being a "lot" of "heavy compute".
If you can put your "compute" into Azure Functions, going serverless with a consumption plan will probably be the nicest solution. However, individual function executions have a given timeout, so you need to see if your app fits the bill.
As an alternative, you can put your application into an Azure Container Instance, and spin that up on demand.
If you have REALLY high workload, you can use Azure Batch. If your current workload can be done on an AppService plan, this may be "overkill".
The equivalent to AWS spot instances is called Azure Spot Virtual Machines. You can also use them with Azure Batch.
Yes, you can switch to Serverless. Host front end on Storage Accounts and back end move to Azure Functions (Consumption Plan).
PS: If it's a long running processing, it may not be the best solution unless you use Durable Functions.

Compare: Azure Functions vs Azure Batch

Can we use Azure Functions along with Azure Batch? Please Advise.
I am working on a POC to decide which one to use for our background processes.
I too was in similar dilemma till I tried both of them for my use case.
The major difference between the two is that Azure Function has a hard timeout limit of I guess 10 minutes which you can not exceed. What I mean is that if your script/execution runs beyond 10 minutes then Azure function will kill it automatically.
Whereas Azure batch is essentially a configuration of pools or VMs in which you can run long running jobs where you are not bothered about the time of its execution. Essentially they are old VMs (low costs too). Difference between batch and Azure VMs is that Azure VMs have high speed VMs but in batch you can configure the periodic jobs where in Azure VMs you need to code in such a way that it executed like a periodic job
And yes it is possible to use Functions with Azure batch. You can configure your script as HTTP trigger in Function which you can call (get/post) through Azure Batch VMs.
Hope it helps.
May be we should expand this topic to Azure services for Batch processing in general. I did come across an article from Microsoft that goes through these options in general (which includes Web Jobs, and Kubernetes options).
But, frankly, even after reading the article; the confusion remains. For example, Azure Batches can be scheduled; but not sure if they can be triggered based on other Azure services like how Azure web jobs handles it. I get a feeling that Azure Batch is pitched where you need high + parallel computing at low costs. Because, none of the other options directly allow you to low-priority and low-cost compute instances. Correct me please!
#AzureBatch #AzureWebJobs #AzureAKS #AzureFunctions

What events does an Azure Windows VM receive during a planned maintenance shutdown?

When Azure shuts down a VM for planned maintenance, what messages do running services see, if any?
For example, do they get a ServiceBase.OnShutdown() message and, if so, how long does the service / server get to complete shutdown processing?
Does MS give any extra leeway to its own apps? E.g. if a VM is running SQL Server, will Azure wait for SQL Server to stop cleanly before shutting down the VM?
[I can't find this in the documentation and, unfortunately, I don't have the access or the programming skills to try it out for myself.]
what messages do running services see, if any?
Based on my knowledge, for now, Azure does not support this. Please refer to this feedback.
Typically maintenance is performed at weekends for VMs not in an availability set to minimize impact on services. Normally notification is given 7 days in advance with the minimum being 3 business days. A start time for the maintenance is given with the expected duration. More information please refer to this link.
According to your description, I suggest you could provision another IaaS VM with your SQL server and put in the same Availability set. By doing this, Azure will ensure that both your VMs do not go down simultaneously.

How can I set up a CRON job using Windows Azure?

Is there a way to use the windows scheduled task to kick off a url or a exe on a schedule?
Can I write a program as an exe then create a Azure VM then RDP into the Azure VM and hook it up to windows task scheduler?
Azure does have a scheduler now.
It allows invoking a Web Service over HTTP/s and post a message to a Windows Azure Storage Queue. It's very new but it can be free if you do not need the scheduler to be executed often. Otherwise it's a small monthly fee which come with scheduled task that can be up to every minute.
Things got much easier lately, please see this link https://azure.microsoft.com/en-us/services/scheduler/ to create a scheduled job in the new Azure Scheduler. There is a basic Free tier as well as some paid options but I think this is exactly what many of us were looking for. It is an excellent solution for triggering URLs with GET,POST,PUT,DELETE requests.
Just follow the simple instructions. Starting by selecting "Scheduler" from the Azure dashboard app menu:
Today the scheduler has been Azure Logic Apps:
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-overview
If you are looking for something like a cron job (which is a job, that is being run at specific time again and again), then check out Azure Functions:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview
Google Azure Storage Queues. They allow you to schedule jobs that will run at a later date. You can even specify when the job should run.

Resources